我正在重新定义“title”bibmacro,以便包含作品的原始标题。正如这里所见,它有时有效,有时无效。如果不明显的话,第二个条目的括号后有很多奖励空间。
以下是生成此图像的我的 MWE:
\documentclass[varwidth,border=0.2in]{standalone}
\RequireXeTeX
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguages{czech,spanish}
\usepackage[backend=biber,bibstyle=standard]{biblatex}
\renewbibmacro*{title}{%
\printtext[title]{%
\printfield[titlecase]{title}%
\iffieldundef{subtitle}%
{}%
{\setunit{\addcolon\addspace}\printfield[titlecase]{subtitle}}%
\iffieldundef{origtitle}%
{}%
{\setunit{\addspace}\printtext[brackets]{\printfield{origtitle}}}}%
\newunit}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{Grusa,
Author = {Jiří Gruša},
Location = {New York},
Origlanguage = {czech},
Origtitle = {\textczech{Dotazník, aneb modlitba za jedno město a přítele}},
Publisher = {Farrar Straus Giroux},
Title = {The Questionnaire, or Prayer for a Town and a Friend},
Translator = {Peter Kussi},
Year = {1982}}
@book{Cortazar:Fires,
Author = {Julio Cortázar},
Location = {New York},
Origlanguage = {spanish},
Origtitle = {\textspanish{Todos los fuegos el fuego}},
Publisher = {Pantheon Books},
Title = {All Fires the Fire and Other Stories},
Translator = {Suzanne Jill Levine},
Year = {1973}}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\nocite{*}
\printbibliography[heading = none]
\end{document}
根据我目前的情况,我不知道奖励空间从何而来。我坦白承认,我不知道这是否是实现我想要实现的目标的最佳方式,因此,如果有更好的方法,请告诉我。
答案1
正如 barbara beeton 所怀疑的以及 Ulrike Fischer 所提到的,问题是由于的捷克语模块%
中缺少 s而导致的一些虚假空格。无需polyglossia
biblatex
\documentclass{article}
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguages{czech,spanish}
\begin{document}
A\textczech{B}C
A\textspanish{B}C
\end{document}
此类问题应报告给polyglossia
维护人员。他们通常会很快处理这些问题。我报告了这个问题https://github.com/reutenauer/polyglossia/issues/423(该问题在报告后不久就得到了修复,应该会在下一个polyglossia
版本中修复,如果紧急情况下,可以.ldf
从以下位置获取文件https://github.com/reutenauer/polyglossia/commit/e088311159a5db2403d2ed672eaf42c0a74a24fd并将它们用作有故障文件的直接替代品)。
作为一种快速解决方法,您可以将选项设置polyglossia-czech
为vlna
。false
您很可能不想在包含大量捷克语文本的文档中这样做,但如果只有简短的捷克语段落,那么这样做可能没问题。
\documentclass{article}
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage[vlna=false]{czech}
\setotherlanguage{spanish}
\begin{document}
A\textczech{B}C
A\textspanish{B}C
\end{document}
为了让这个答案包含一些有趣的东西,这里有一个根据值\text<language>
自动添加的解决方案(参见origtitle
origlanguage
https://github.com/plk/biblatex/issues/594)。
\documentclass{article}
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage[vlna=false]{czech}% TEMPORARY workaround
% for https://github.com/reutenauer/polyglossia/issues/423
\setotherlanguage{spanish}
\usepackage[backend=biber]{biblatex}
\renewcommand*{\subtitlepunct}{\addcolon\space}
\DeclareFieldFormat{origtitle:origlang:polyglossia}{%
\iflistundef{origlanguage}
{#1}
{\ifcsundef{text\thefirstlistitem{origlanguage}}
{\PackageWarning{biblatex}{%
No language switching for
\thefirstlistitem{origlanguage}}%
#1}
{\csuse{text\thefirstlistitem{origlanguage}}{#1}}}}
\renewbibmacro*{title}{%
\printtext[title]{%
\printfield[titlecase]{title}%
\iffieldundef{subtitle}%
{}%
{\setunit{\subtitlepunct}%
\printfield[titlecase]{subtitle}}%
\iffieldundef{origtitle}%
{}%
{\setunit{\addspace}%
\printtext[brackets]{\printfield[origtitle:origlang:polyglossia]{origtitle}}}}%
\newunit}
\begin{filecontents}{\jobname.bib}
@book{Grusa,
Author = {Jiří Gruša},
Location = {New York},
Origlanguage = {czech},
Origtitle = {Dotazník, aneb modlitba za jedno město a přítele},
Publisher = {Farrar Straus Giroux},
Title = {The Questionnaire, or Prayer for a Town and a Friend},
Translator = {Peter Kussi},
Year = {1982},
}
@book{Cortazar:Fires,
Author = {Julio Cortázar},
Location = {New York},
Origlanguage = {spanish},
Origtitle = {Todos los fuegos el fuego},
Publisher = {Pantheon Books},
Title = {All Fires the Fire and Other Stories},
Translator = {Suzanne Jill Levine},
Year = {1973},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\nocite{*}
\printbibliography[heading = none]
\end{document}