참고문헌 스타일 사용자 정의

참고문헌 스타일 사용자 정의

나는 두 개의 논문을 인용하고 참고문헌의 스타일을 변경하고 싶습니다. 즉, 한 논문의 스타일을 바꾸고 다른 논문은 변경하지 않고 유지하는 것입니다.

\documentclass[12pt,a4paper]{article}
\usepackage[round]{natbib}

\begin{document}

 My citation \citep{desmet2015geography}

 another citation \citep{roberts2012evaluating}

\medskip
\bibliographystyle{plainnat}
\bibliography{citation}

\end{document}

참고문헌 파일(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:텍스트패드 1.731

엔진: Xelatex, BibTex

미니 예제의 컴파일된 출력: 여기에 이미지 설명을 입력하세요 원하는 출력: 여기에 이미지 설명을 입력하세요

답변1

LaTeX와 BibTeX 사이에 이동되는 유일한 정보는 인용 키입니다. 따라서 "and"를 사용해야 하는 항목과 "&"를 사용해야 하는 항목을 구별하려면 cite 키를 사용하여 이 정보를 전달해야 하는 것 같습니다. 그래서 여기에 그것을 수행하는 내 솔루션이 있습니다.

  1. "&"를 사용해야 하는 항목은 "&"로 끝나는 인용 키를 받게 됩니다. 위의 예에서 이는 참고문헌 파일에 있습니다.

    @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}
    

인용 명령은 다음과 같습니다.

\citep{roberts2012evaluating&}

(흥미롭게도 베어 &도 허용됩니다.)

  1. \AND이제 "and" 대신 매크로를 생성하도록 참고문헌 스타일을 변경해야 합니다 . 그래서 우리는 의 복사본을 만들어서 plainnat.bst이라고 부릅니다 myplainnat.bst. 차이점은 다음과 같습니다(첫 번째 줄을 두 번째 줄로 대체).

엘. 232와 325

       { " and " * t * }
       { " \AND{} " * t * }

엘. 1111

    { " and " * s #2 "{vv~}{ll}" format.name$ * }
    { " \AND{} " * s #2 "{vv~}{ll}" format.name$ * }
  1. 이제 하나 \bibliographystyle{myplainnat}대신 사용하십시오 plainnat. 그리고 \bibitem인용 키가 다음으로 끝나는지 확인한 &다음 그런 것처럼 \AND정의 하고 그렇지 않은 경우를 정의하기 위해 다시 작성해야 합니다 .&and

적응된 MWE는 다음과 같습니다.

\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&#2\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}

관련 정보