
Cito dos artículos y quiero cambiar el estilo de la bibliografía, es decir, cambiar el estilo de uno y mantener el otro sin cambios.
\documentclass[12pt,a4paper]{article}
\usepackage[round]{natbib}
\begin{document}
My citation \citep{desmet2015geography}
another citation \citep{roberts2012evaluating}
\medskip
\bibliographystyle{plainnat}
\bibliography{citation}
\end{document}
Archivo de bibliografía (citation.bib)
@article{roberts2012evaluating,
Author = {Roberts, Mark and Deichmann, Uwe and Fingleton, Bernard and Shi, Tuo},
Journal = {Regional Science and Urban Economics},
Number = {4},
Pages = {580--594},
Publisher = {Elsevier},
Title = {Evaluating China's road to prosperity: A new economic geography approach},
Volume = {42},
Year = {2012}}
@techreport{desmet2015geography,
Author = {Desmet, Klaus and Nagy, D{\'a}vid Kriszti{\'a}n and Rossi-Hansberg, Esteban},
Date-Added = {2016-09-03 13:29:14 +0000},
Date-Modified = {2016-09-03 13:29:14 +0000},
Institution = {National Bureau of Economic Research},
Title = {The geography of development: Evaluating migration restrictions and coastal flooding},
Year = {2015}}
IDE: Texpad 1.731
Motor: Xelatex, BibTex
Respuesta1
La única información que se transmite entre LaTeX y BibTeX es la clave de cita. Entonces, si desea distinguir entre las entradas que deberían usar "y" y las que deberían usar "&", entonces parece que debería pasar esta información con la clave de cita. Así que aquí está mi solución que hace eso.
Las entradas que deben usar "&" obtendrán una clave de cita que termina en "&". En el ejemplo anterior, esto está en el archivo de bibliografía:
@article{roberts2012evaluating&, Author = {Roberts, Mark and Deichmann, Uwe and Fingleton, Bernard and Shi, Tuo}, Journal = {Regional Science and Urban Economics}, Number = 4, Pages = {580--594}, Publisher = {Elsevier}, Title = {Evaluating {China}'s road to prosperity: A new economic geography approach}, Volume = 42, Year = 2012}
y el comando de cita se convierte
\citep{roberts2012evaluating&}
(Curiosamente, &
se permite un desnudo.)
- Ahora tenemos que cambiar el estilo de la bibliografía para generar una macro
\AND
en lugar de "y". Entonces hacemos una copiaplainnat.bst
y lo llamamosmyplainnat.bst
. Las diferencias son (reemplace la primera línea por la segunda):
l. 232 y 325
{ " and " * t * }
{ " \AND{} " * t * }
l. 1111
{ " and " * s #2 "{vv~}{ll}" format.name$ * }
{ " \AND{} " * s #2 "{vv~}{ll}" format.name$ * }
- Ahora úsalo
\bibliographystyle{myplainnat}
en lugar delplainnat
uno. Y tenemos que reescribir\bibitem
para verificar si la clave de cita termina en&
y luego definir\AND
como&
si es así y comoand
de otra manera.
Así que aquí está el MWE adaptado:
\documentclass[12pt,a4paper]{article}
\usepackage[round]{natbib}
\usepackage{ifthen}
\newcommand\AND{and}
\let\origbibitem\bibitem
\renewcommand\bibitem[2][]{%
\bibitemcheckkey{#2}\origbibitem[#1]{#2}}
\newcommand\bibitemcheckkey[1]{%
\bibitemampcheck#1&\relax}
\def\bibitemampcheck#1\relax{%
\ifthenelse{\equal{#2}{&}}{\def\AND{\&}}{\def\AND{and}}}
\begin{document}
My citation \citep{desmet2015geography}
another citation \citep{roberts2012evaluating&}
\medskip
\bibliographystyle{myplainnat}
\bibliography{citation}
\end{document}