
나는 종종 독일어와 영어로 텍스트를 작성하고 JabRef를 사용하여 참고문헌을 정리합니다. 많은 컨퍼런스 논문을 인용하다 보면 문서의 언어에 따라 항상 해당 위치의 언어를 변경하는 것이 상당히 귀찮은 경우가 많습니다. 그래서 매번 데이터베이스를 조정할 필요가 없도록 일종의 사전을 biblatex에 제공할 수 있는지 궁금했습니다.
예를 들어 서문에서 다음을 정의하고 싶습니다.
Munich = München
Germany = Deutschland
문서나 바벨 언어가 ngerman
.
이것이 가능합니까?
MWE
\documentclass[ngerman]{article}
\usepackage[ngerman]{babel}
\begin{filecontents}{bla.bib}
@inproceedings{Orwell1984,
author = "George Orwell",
title = "1984",
year = "1948",
booktitle = "Books about big brothers",
location = "Munich, Germany",
}
\end{filecontents}
\RequirePackage[backend=biber,style=ieee-alphabetic]{biblatex}
\addbibresource{bla.bib}
\begin{document}
\cite{Orwell1984}. \\
\printbibliography
\end{document}
답변1
biblatex
의 턱받이 문자열을 사용하여 특정 문구를 번역할 수 있습니다 . 문제는 좋은 인터페이스가 무엇인지입니다. 한 필드에서 임의의 용어를 결합하려면 다음과 같은 작업을 수행해야 합니다(조금 투박하게 느껴짐).
\documentclass[ngerman]{article}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[backend=biber,style=ieee-alphabetic]{biblatex}
\NewBibliographyString{munich,germany}
\DefineBibliographyStrings{german}{
munich = {München},
germany = {Deutschland},
}
\begin{filecontents}{\jobname.bib}
@inproceedings{Orwell1984,
author = {George Orwell},
title = {1984},
year = {1948},
booktitle = {Books about big brothers},
location = {\bibstring{munich}, \bibstring{germany}},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\autocite{Orwell1984}
\printbibliography
\end{document}
필드당 하나의 문자열만 사용해도 괜찮다면 상황을 좀 더 좋게 만들 수 있습니다.
\documentclass[ngerman]{article}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[backend=biber,style=ieee-alphabetic]{biblatex}
\NewBibliographyString{de-munich}
\DefineBibliographyStrings{german}{
de-munich = {München},
}
\DefineBibliographyStrings{english}{
de-munich = {Munich, Germany},
}
\DeclareListFormat{location}{%
\usebibmacro{list:delim}{#1}%
\ifbibstring{#1}{\bibstring{#1}}{#1}\isdot
\usebibmacro{list:andothers}}
\begin{filecontents}{\jobname.bib}
@inproceedings{Orwell1984,
author = {George Orwell},
title = {1984},
year = {1948},
booktitle = {Books about big brothers},
location = {de-munich},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\autocite{Orwell1984}
\printbibliography
\end{document}
더 많은 BibTeX-y 솔루션은 @string
s를 사용합니다. 다양한 파일(언어별로 하나씩)의 각 위치에 대한 문자열을 정의한 .bib
다음 .bib
문서에 필요한 언어에 대한 파일을 선택할 수 있습니다.
\documentclass[ngerman]{article}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[backend=biber,style=ieee-alphabetic]{biblatex}
\begin{filecontents}{locationstrings-german.bib}
@string{de:munich = "München"}
\end{filecontents}
\begin{filecontents}{locationstrings-english.bib}
@string{de:munich = "Munich, Germany"}
\end{filecontents}
% select the bib file for the language you want
\addbibresource{locationstrings-german.bib}
\begin{filecontents}{\jobname.bib}
@inproceedings{Orwell1984,
author = {George Orwell},
title = {1984},
year = {1948},
booktitle = {Books about big brothers},
location = de:munich,
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\autocite{Orwell1984}
\printbibliography
\end{document}
여전히 매우 실험적인 멀티스크립트 버전 biblatex
도 흥미로울 수 있습니다:https://github.com/plk/biblatex/issues/416
답변2
\documentclass[ngerman]{article}
\usepackage[ngerman]{babel}
\begin{filecontents}{german-strings.bib}
@string{muenchen={München}}
@string{germany={Deutschland}}
\end{filecontents}
\begin{filecontents}[overwrite]{bla.bib}
@inproceedings{Orwell1984,
author = "George Orwell",
title = "1984",
year = "1948",
booktitle = "Books about big brothers",
location = muenchen # ", " # germany
}
\end{filecontents}
\RequirePackage[backend=biber,style=ieee-alphabetic]{biblatex}
\addbibresource{german-strings.bib}
\addbibresource{bla.bib}
\begin{document}
\cite{Orwell1984}. \\
\printbibliography
\end{document}