我正在使用 BibLaTeX 和 Biber 后端来编制我的博士论文的参考书目,用英文撰写。
我的大学推荐的哈佛风格鼓励翻译用外语写的标题和期刊标题。
为了获得正确的连字符模式,可以使用该langid
字段来声明外语。但是,如果我想添加翻译成英文的标题怎么办?有没有办法以干净的方式“本地”声明语言?
此类条目的示例如下:
@article{doe2000,
title = {Die numerische Strömungsmechanik [Computational Fluid Dynamics]},
author = {J. Doe},
booktitle = {Internationalen Mathematiker Kongresses [International Congress of Mathematics]},
date = {2000},
langid = {german} % but translated titles are in English
}
答案1
这里的最佳输入在很大程度上取决于您的整体设置和期望的结果。
一般来说,在字段中添加过多的标记命令是个坏主意,因为格式应该符合样式,而且标记可能会给排序带来问题。但在这里,在字段末尾添加一些语言切换标记似乎并不完全疯狂(这对排序来说不太可能有影响)。
\documentclass[german,english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[style=authoryear, backend=biber, autolang=hyphen]{biblatex}
\begin{filecontents}{\jobname.bib}
@incollection{doe2000,
title = {Die numerische Strömungsmechanik
\foreignlanguage{english}{[Computational Fluid Dynamics]}},
author = {J. Doe},
booktitle = {Internationaler Mathematikerkongress
\foreignlanguage{english}{[International Congress of Mathematicians]}},
date = {2000},
langid = {german},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}
\begin{document}
\cite{doe2000}
\printbibliography
\end{document}
对于具有翻译某些字段可能性的完整多语言书目,您可能必须等到biblatex
多语言开发分支进入发布版本。请参阅https://github.com/plk/biblatex/issues/416了解更多详细信息和可用的测试版本。
同时,您可以使用字段注释进行一些翻译。
\documentclass[ngerman,english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[style=authoryear, backend=biber]{biblatex}
% expand the first argument of \foreignlanguage
% needs a modern TeX engine with \expanded primitive
\newcommand*{\foreignlanguageE}[1]{\foreignlanguage{\expanded{#1}}}
\newcommand*{\foreignlangbyannotation}[2][\currentfield]{%
\hasfieldannotation[#1][lang]
{\foreignlanguageE{\csuse{abx@annotation@literal@field@#1@lang}}{#2}}
{#2}}
\newcommand*{\printtranslation}[1][\currentfield]{%
\hasfieldannotation[#1][translation]
{\addspace \mkbibbrackets{\getfieldannotation[#1][translation]}}
{}}
\DeclareFieldFormat{title}{%
\mkbibemph{%
\foreignlangbyannotation[title]{#1}%
\printtranslation[title]}}
\DeclareFieldFormat
[article,inbook,incollection,inproceedings,patent,thesis,unpublished]
{title}{%
\mkbibquote{%
\foreignlangbyannotation[title]{#1}%
\printtranslation[title]\isdot}}
\DeclareFieldFormat
[suppbook,suppcollection,suppperiodical]
{title}{%
\foreignlangbyannotation[title]{#1}%
\printtranslation[title]}
\DeclareFieldFormat{booktitle}{%
\mkbibemph{%
\foreignlangbyannotation[booktitle]{#1}%
\printtranslation[booktitle]}}
\begin{filecontents}{\jobname.bib}
@incollection{doe2000,
title = {Die numerische Strömungsmechanik},
title+an:lang = {="ngerman"},
title+an:translation = {="Computational Fluid Dynamics"},
author = {J. Doe},
booktitle = {Internationaler Mathematikerkongress},
booktitle+an:lang = {="ngerman"},
booktitle+an:translation = {="International Congress of Mathematicians"},
date = {2000},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}
\begin{document}
\cite{doe2000}
\printbibliography
\end{document}
我在 TeXwelt 上展示了类似的方法:https://texwelt.de/fragen/24268/biblatexbiber-deutscher-autorenname-eines-bibliographie-eintrags-englischer-rest