![Natbib 참조에 중복된 약어가 있습니다.](https://rvso.com/image/472711/Natbib%20%EC%B0%B8%EC%A1%B0%EC%97%90%20%EC%A4%91%EB%B3%B5%EB%90%9C%20%EC%95%BD%EC%96%B4%EA%B0%80%20%EC%9E%88%EC%8A%B5%EB%8B%88%EB%8B%A4..png)
나는 많은 기술 및 정부 보고서를 인용하는 연구 논문의 일부를 가지고 있습니다. 이름이 다루기 힘들기 때문에 다음을 따르세요.natbib의 약어에 대한 이 좋은 솔루션나는 참고문헌을 정리했다.
불행하게도 제가 사용하고 있는 .bst 파일은 제대로 재생되지 않고 참고문헌의 두 가지 다른 항목에 조직 이름과 약어가 기재되어 있습니다. 나는 사용하고있다다케다 시로의 멋진 econ.bst. 그래서 내 질문은 어떻게 인용을 올바르게 얻을 수 있습니까? 이상적으로는 .bst 파일의 자체 분기를 만들 필요가 없지만 형식을 유지하는 우아한 솔루션이 있는 경우 biblatex를 사용할 수 있습니다. 미리 감사드립니다!
내 문제를 생성하는 MWE는 다음과 같습니다.
\documentclass[12pt,letterpaper]{article}
\usepackage[margin=1.5in]{geometry}
\usepackage{natbib}
% Abbreviations in natbib
\usepackage{etoolbox}
\newif\ifabbreviation
\pretocmd{\thebibliography}{\abbreviationfalse}{}{}
\AtBeginDocument{\abbreviationtrue}
\DeclareRobustCommand\acroauthor[2]{%
\ifabbreviation #2\else #1 (\mbox{#2})\fi}
% econ.bst style of choice
\bibliographystyle{aer}
\begin{document}
In Germany, feed-in-tariffs for renewable energy last for 20 years \citep{OECDFIT} while similar Chinese tax cuts last for 6\citep{kpmgwind}.
\bibliography{citations}
\end{document}
내 citations.bib 파일에는 다음이 포함됩니다.
@techreport{OECDFIT,
author={{\acroauthor{Organization for Economic Co-Operation and Development}{OECD}}},
institution = {{Organization for Economic Co-Operation and Development}},
year ={2022},
title = {Renewable Energy Feed-in-tariffs}
}
@techreport{kpmgwind2020,
title = {The Power of Nature: Taxation of Wind Power - 2022 A Country Overview},
pages = {27--29},
author = {Nyberg, Per and Thorvaldsen, Trond and Greni, Jan},
institution = {{KPMG Law Advokatfirma}},
year = {2020}
}
이것이 바로 "경제협력개발기구(OECD)"의 이상한 이중 모습에 주목해 보는 것입니다.
답변1
이 문제는 natbib의 구현 세부 사항으로 인해 발생합니다. 파일에서 볼 수 있듯이 .bbl
다음 항목이 생성됩니다.
\harvarditem[Nyberg et al.]{Nyberg, Thorvaldsen and Greni}{2020}{kpmgwind2020}
{\bf Nyberg, Per, Trond Thorvaldsen, and Jan Greni}, ``The Power of Nature:
Taxation of Wind Power - 2022 A Country Overview,'' Technical Report, {KPMG
Law Advokatfirma} 2020.
\harvarditem[{\acroauthor{Organization for Economic Co-Operation and
Development}{OECD}}]{{\acroauthor{Organization for Economic Co-Operation and
Development}{OECD}}}{2022}{OECDFIT}
{\bf {\acroauthor{Organization for Economic Co-Operation and
Development}{OECD}}}, ``Renewable Energy Feed-in-tariffs,'' Technical Report,
{Organization for Economic Co-Operation and Development} 2022.
에서 시작하는 부분이 {\bf
문서의 실제 출력이고 그 앞에는 해당 파일 \harvarditem
에 해당하는 citekey, Short Author, Full Author, Year에 대한 장부를 수행하는 명령 .aux
과 다양한 \cite
명령이 있습니다.
Natbib은 \harvarditem
기본 명령을 둘러싼 래퍼로 정의합니다 \bibitem
. 다음을 사용하여 첫 번째(선택적) 인수가 비어 있는지 확인합니다 \if\relax#1\relax
.
% definition from natbib.sty
\newcommand\harvarditem[4][]{%
\if\relax#1\relax
\bibitem[#2(#3)]{#4}%
\else
\bibitem[#1(#3)#2]{#4}%
\fi
}%
그러나 이 검사는 와 같은 명령이 포함된 \if\relax#1\relax
경우 제대로 작동하지 않습니다 . 왜냐하면 이 명령이 확장되고 그렇게 하면 해당 지점에서 인쇄되기 때문입니다.#1
\acroauthor
#1 (\mbox{#2})
예를 들어 설명했듯이\detokenize의 정확한 의미는 무엇입니까?, 인수의 토큰화 해제된 표현을 확인하는 것이 더 안전합니다.
\documentclass[12pt,letterpaper]{article}
\usepackage[margin=1.5in]{geometry}
\usepackage{natbib}
\renewcommand\harvarditem[4][]{%
\if\relax\detokenize{#1}\relax
\bibitem[#2(#3)]{#4}%
\else
\bibitem[#1(#3)#2]{#4}%
\fi
}%
% Abbreviations in natbib
\usepackage{etoolbox}
\newif\ifabbreviation
\pretocmd{\thebibliography}{\abbreviationfalse}{}{}
\AtBeginDocument{\abbreviationtrue}
\DeclareRobustCommand\acroauthor[2]{%
\ifabbreviation#2\else#1 (\mbox{#2})\fi}
% econ.bst style of choice
\bibliographystyle{aer}
\begin{document}
In Germany, feed-in-tariffs for renewable energy last for 20 years \citep{OECDFIT} while similar Chinese tax cuts last for 6 \citep{kpmgwind2020}.
\bibliography{techrepauth}
\end{document}
결과: