获得德语 babel 快捷方式以与 biblatex 配合使用而无需 autolang=langname

获得德语 babel 快捷方式以与 biblatex 配合使用而无需 autolang=langname

我想在 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。您的示例中唯一相关的语言是englishngerman,因此人们可以合理地期望简写在所有情况下都有效。

事实上,在您的设置中,唯一不能使用简写的情况是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}

ngerman,Gisbert Fanselow。 1993.“作格”动词与德语中层语法结构。收录于 Ludger Hoffmann 主编的《德语句法——观察与观察》(德语研究所,年鉴 1991),276–303。柏林、纽约:de Gruyter。

相关内容