Citação com texto entre colchetes e com ponto e vírgula

Citação com texto entre colchetes e com ponto e vírgula

Minha pergunta é muito parecida comEste. Usando uma parte da resposta aceita como referência na minha pergunta,

\begin{filecontents*}{\jobname.bib}
@book{01,
 author={Caesar, Gaius Iulius},
 title={Commentarii de bello {Gallico}},
 year={703},
}
\end{filecontents*}
\documentclass{article}

\makeatletter
\let\cite\relax
\DeclareRobustCommand{\cite}{%
  \let\new@cite@pre\@gobble
  \@ifnextchar[\new@cite{\@citex[]}}
\def\new@cite[#1]{\@ifnextchar[{\new@citea{#1}}{\@citex[#1]}}
\def\new@citea#1{\def\new@cite@pre{#1}\@citex}
\def\@cite#1#2{[{\new@cite@pre\space#1\if\relax\detokenize{#2}\relax\else, #2\fi}]}
\makeatother

\begin{document}

Here's a citation \cite[See:][p.~2]{01}

Another: \cite[p.~3]{01}.

Another: \cite{01}.

Again: \cite[See:][]{01}

\bibliographystyle{plain}
\bibliography{\jobname}

\end{document}

produz insira a descrição da imagem aqui

No entanto, em vez de vírgulas para as duas primeiras linhas do documento renderizado, eu preferiria ponto e vírgula. Como eu conseguiria isso?

Responder1

Está ,na definição de \@cite, a última linha antes \makeatother, logo após \else. Substitua essa vírgula por ponto e vírgula:

Exemplo de saída

\begin{filecontents*}{\jobname.bib}
@book{01,
 author={Caesar, Gaius Iulius},
 title={Commentarii de bello {Gallico}},
 year={703},
}
\end{filecontents*}
\documentclass{article}

\makeatletter
\let\cite\relax
\DeclareRobustCommand{\cite}{%
  \let\new@cite@pre\@gobble
  \@ifnextchar[\new@cite{\@citex[]}}
\def\new@cite[#1]{\@ifnextchar[{\new@citea{#1}}{\@citex[#1]}}
\def\new@citea#1{\def\new@cite@pre{#1}\@citex}
\def\@cite#1#2{[{\new@cite@pre\space#1\if\relax\detokenize{#2}\relax\else; #2\fi}]}
\makeatother

\begin{document}

Here's a citation \cite[See:][p.~2]{01}

Another: \cite[p.~3]{01}.

Another: \cite{01}.

Again: \cite[See:][]{01}

\bibliographystyle{plain}
\bibliography{\jobname}

\end{document}

A propósito bibtexavisa que falta uma editora para esta obra :-)

informação relacionada