![获得德语 babel 快捷方式以与 biblatex 配合使用而无需 autolang=langname](https://linux22.com/image/415439/%E8%8E%B7%E5%BE%97%E5%BE%B7%E8%AF%AD%20babel%20%E5%BF%AB%E6%8D%B7%E6%96%B9%E5%BC%8F%E4%BB%A5%E4%B8%8E%20biblatex%20%E9%85%8D%E5%90%88%E4%BD%BF%E7%94%A8%E8%80%8C%E6%97%A0%E9%9C%80%20autolang%3Dlangname.png)
我想在 bibtex 条目中使用 babel 语言快捷方式。除非autolang=langname
使用,否则这似乎是不可能的。但是如果我使用此设置,则该项目将使用德语 Hrsg 而不是 ed。
通过此设置,autolang=hyphen
语言快捷键似乎被忽略了,即使它们在文档的参考书目之外可见。有办法解决这个问题吗?
\documentclass{article}
\usepackage[ngerman,main=english]{babel}
\useshorthands*{"}
\addto\extrasenglish{\languageshorthands{ngerman}}
\begin{filecontents}{ref.bib}
@incollection{Fanselow92,
Address = {Berlin, New York},
Author = {Gisbert Fanselow no langid},
Booktitle = {{Deutsche Syntax -- Ansichten und Aussichten}},
Editor = {Ludger Hoffmann},
Pages = {276--303},
Publisher = {de Gruyter},
Series = {Institut für deutsche Sprache, Jahrbuch 1991},
Title = {{{"`Ergative"' Verben und die Test/""Test Struktur des deutschen Mittelfelds}}},
Year = {1992}}
@incollection{Fanselow93,
Address = {Berlin, New York},
Author = {Gisbert Fanselow ngerman},
Booktitle = {{Deutsche Syntax -- Ansichten und Aussichten}},
Editor = {Ludger Hoffmann},
Pages = {276--303},
Publisher = {de Gruyter},
Series = {Institut für deutsche Sprache, Jahrbuch 1991},
Title = {{{"`Ergative"' Verben und die Test/""Test Struktur des deutschen Mittelfelds}}},
langid = {ngerman},
Year = {1993}}
\end{filecontents}
\usepackage{bibentry}
\usepackage[
style=langsci-unified,
%autolang=langname,
autolang=hyphen,
backend=biber,
]{biblatex}
\addbibresource{ref.bib}
\begin{document}
Test"=Sequenz "`Ergative"' Verben Test/""Test
\nocite{*}
\printbibliography
\end{document}
答案1
babel
简写仅适用于 ,这并不完全正确autolang=langname
。在您的示例中,您还明确为 启用了德语(特别是ngerman
)简写english
。您的示例中唯一相关的语言是english
和ngerman
,因此人们可以合理地期望简写在所有情况下都有效。
事实上,在您的设置中,唯一不能使用简写的情况是autolang=hyphen,
。这是因为hyphenrules
使用的环境明确禁用了语言简写( containsautolang=hyphen,
的定义)。您可以使用以下代码轻松验证这一点\hyphenrules
\languageshorthands{none}%
\begin{hyphenrules}{ngerman}
Test"=Sequenz "`Ergative"' Verben Test/""Test
\end{hyphenrules}
和
\makeatletter
\def\hyphenrules#1{%
\edef\bbl@tempf{#1}%
\bbl@fixname\bbl@tempf
\bbl@iflanguage\bbl@tempf{%
\expandafter\bbl@patterns\expandafter{\bbl@tempf}%
\expandafter\ifx\csname\bbl@tempf hyphenmins\endcsname\relax
\set@hyphenmins\tw@\thr@@\relax
\else
\expandafter\expandafter\expandafter\set@hyphenmins
\csname\bbl@tempf hyphenmins\endcsname\relax
\fi}}
\makeatother
您可以停止hyphenrules
禁用语言简写。我们只需\languageshorthands{none}%
从定义中删除即可。这意味着您将能够使用周围语言激活的简写。
\documentclass{article}
\usepackage[ngerman,main=english]{babel}
\useshorthands*{"}
\addto\extrasenglish{\languageshorthands{ngerman}}
\makeatletter
\def\hyphenrules#1{%
\edef\bbl@tempf{#1}%
\bbl@fixname\bbl@tempf
\bbl@iflanguage\bbl@tempf{%
\expandafter\bbl@patterns\expandafter{\bbl@tempf}%
\expandafter\ifx\csname\bbl@tempf hyphenmins\endcsname\relax
\set@hyphenmins\tw@\thr@@\relax
\else
\expandafter\expandafter\expandafter\set@hyphenmins
\csname\bbl@tempf hyphenmins\endcsname\relax
\fi}}
\makeatother
\begin{filecontents}{\jobname.bib}
@incollection{Fanselow92,
Address = {Berlin, New York},
Author = {Gisbert Fanselow no langid},
Booktitle = {{Deutsche Syntax -- Ansichten und Aussichten}},
Editor = {Ludger Hoffmann},
Pages = {276--303},
Publisher = {de Gruyter},
Series = {Institut für deutsche Sprache, Jahrbuch 1991},
Title = {{{"`Ergative"' Verben und die
Test/""Test
Struktur des deutschen Mittelfelds}}},
Year = {1992},
}
@incollection{Fanselow93,
Address = {Berlin, New York},
Author = {Gisbert Fanselow ngerman},
Booktitle = {{Deutsche Syntax -- Ansichten und Aussichten}},
Editor = {Ludger Hoffmann},
Pages = {276--303},
Publisher = {de Gruyter},
Series = {Institut für deutsche Sprache, Jahrbuch 1991},
Title = {{{"`Ergative"' Verben und die
Test/""Test
Struktur des deutschen Mittelfelds}}},
langid = {ngerman},
Year = {1993},
}
\end{filecontents}
\usepackage[
style=langsci-unified,
autolang=hyphen,
backend=biber,
]{biblatex}
\addbibresource{\jobname.bib}
\begin{document}
Test"=Sequenz "`Ergative"' Verben Test/""Test
\begin{hyphenrules}{ngerman}
Test"=Sequenz "`Ergative"' Verben Test/""Test
\end{hyphenrules}
\nocite{*}
\printbibliography
\end{document}