防止 biblatex 打印语言名称并仅使用语言进行连字符连接

防止 biblatex 打印语言名称并仅使用语言进行连字符连接

在我的.bib文件中language,所有条目均已填写该字段。

作为 MWE,它们看起来(正如预期的那样)像:

@Collection{Bakker:Grammar,
  editor =   {Egbert J[an] Bakker},
  gender =   {sm},
  title =    {Grammar as Interpretation},
  subtitle = {Greek Literature in its Linguistic Context},
  shorttitle = {Grammar},
  language = {english},
  year =     1997,
  series =   {Mnemosyne. Supplementum},
  number =   171,
  publisher = {Brill},
  location ={Leiden AND New York AND K{\"o}ln}
  }

为了打印书目,我创建了这个文件

\documentclass[paper=a4,twoside,ngerman]{scrartcl}
\usepackage[LGR,T1]{fontenc}
\usepackage[utf8]{inputenc}
\input{ix-utf8enc.dfu}
\usepackage{savesym}
\usepackage{gfsdidot,gfsporson}
\savesymbol{og}
\usepackage[main=ngerman,greek,italian,frenchb,english,british,german]{babel}
\usepackage[GlyphNames,boldLipsian]{teubner}
\savesymbol{breve}
\savesymbol{aa}
\usepackage[osf,sc]{mathpazo}
\restoresymbol{pplj}{breve}
\usepackage{courier}
\usepackage[scaled=.9]{DejaVuSansCondensed}
\Lipsiantrue
\ifFamily{pplj}{porson}
\usepackage{textcase}
\usepackage{textcomp}
\usepackage{xpatch}
\usepackage[pdftex]{hyperref}
\usepackage[style=german, german=guillemets]{csquotes}
\usepackage[style=philosophy-modern, sortlocale=de_DE,
            sorting=nyvt, autolang=hyphen, alldates=terse,
            annotation=true, useprefix=true, language=ngerman,
             datezeros=false,  bibencoding=auto, pagetracker=spread,
             publocformat= loccolonpub, backend=biber, 
             citetracker = constrict, ibidtracker=constrict,
             opcittracker=constrict, idemtracker=constrict,
             relatedformat=parens,  clearlang=true]{biblatex}
\usepackage{moredefs}
\usepackage{lips}
\usepackage{ragged2e}
\usepackage[twothirds,nonegthinspace]{thinsp}
\usepackage[babel]{microtype}
\usepackage{fixltx2e}

编译后biber --bblsafechars mybib,我latex mybib.tex得到

埃格伯特·J·巴克尔

1997 人力资源语法即解释。语言背景中的希腊文学、英语、记忆女神。补编 171,莱顿、纽约和科隆:Brill。

但我不希望 LaTeX 打印语言的名称(上例中为“Englisch”),而是使用它仅适用于连字符,尽管我尝试了几个月的所有方法,但我只找到了将每个条目放入另一个otherlanguage环境(通过将选项传递babel=other给 biblatex)或通过将所有已知语言放入\DeclareRedundantLanguages{ngerman}{german,english,french,italian,british,franconian,vedic,malaysian ...}

language另一个想法是将文件中的字段更改.bibhyphenation,但我仍然在每个条目中获得了语言的名称。

答案1

您需要biblatexautolang=hyphen选项 (以前称为babel=hyphen)。必须通过langid(以前称为 [<= 2.7] hyphenation) 字段指定连字语言。

有一种方法可以自动将language字段映射到langid 字段。序言中的以下几行应该足以做到这一点。

\DeclareSourcemap{
  \maps{
    \map{
      \step[fieldsource=language, fieldset=langid, origfieldval, final]
      \step[fieldset=language, null]
    }
  }
}

此命令会将language字段复制到字段中langid,然后删除language字段的内容。只有成功将语言字段复制到字段中后,语言字段才会被删除langid

我上面评论中的警告仍然适用:在language字段中可以写german或甚至langlatin and langgerman,而langid字段应该采用适当的babel/polyglossia语言标识符(并且只能采用其中之一;“标识符必须是babel/polyglossia包已知的语言名称。”,§2.2.3,第 24 页biblatex文档(版本 2.8))尤其对于新德语正字法中的条目来说,language当然应该是german,而langid应该是ngerman

参见此 MWE

\documentclass[ngerman,english]{article}
\usepackage{babel}
\usepackage[autolang=hyphen, backend=biber]{biblatex}
\begin{filecontents}{\jobname.bib}
@Book{vangennep:trans,
  author       = {van Gennep, Arnold},
  title        = {The Rites of Passage},
  year         = 1960,
  translator   = {Vizedom, Monika B. and Caffee, Gabrielle L.},
  language     = {english},
  origlanguage = {french},
  publisher    = {University of Chicago Press},
}
@Book{cicero,
  author       = {Cicero, Marcus Tullius},
  title        = {De natura deorum. {\"U}ber das Wesen der G{\"o}tter},
  date         = 1995,
  editor       = {Blank-Sangmeister, Ursula},
  translator   = {Blank-Sangmeister, Ursula},
  afterword    = {Thraede, Klaus},
  language     = {langlatin and langgerman},
  publisher    = {Reclam},
  location     = {Stuttgart},
  hyphenation  = {german},
}
@book{testbook,
  author        = {Walter Ordsmith},
  title         = {The Work},
  subtitle      = {Subtitle},
  year          = {1983},
  publisher     = {P. Ublisher \& Co.},
  address       = {Townsville},
  language      = {german},
}
@article{testart1,
  author  = {Steven C. Ientist and Paula Rofessor},
  title   = {Thrilling, Intelligent and True Limes of Erudition},
  journal = {Journal of Articles},
  volume  = {20},
  number  = {3},
  year    = {1935},
  pages   = {1--46},
  language= {american},
}
@incollection{ordChap3,
  author     = {Walter Ordsmith and William Riter},
  title      = {A Chapter},
  booktitle  = {The Second Work},
  publisher  = {Academic Press},
  year       = {1977},
  language   = {french},
}

\end{filecontents}

\addbibresource{\jobname.bib}

\DeclareSourcemap{
  \maps{
    \map{
      \step[fieldsource=language, fieldset=langid, origfieldval, final]
      \step[fieldset=language, null]
    }
  }
}

\begin{document}
  \nocite{*}
  \printbibliography
\end{document}

产量 在此处输入图片描述

相关内容