来自 babel 的 biblatex 德语引文简写

来自 babel 的 biblatex 德语引文简写

我尝试""从 开始来babel工作biblatex如何使 babel 的语言简写在具有 autolang=hyphen 和 langid 字段的 biblatex 条目中发挥作用?解释了一般问题,但解决方案对我来说不起作用。这是我的 MWE:

\documentclass{scrbook}

\usepackage{filecontents}

\usepackage[natbib]{biblatex}

\usepackage[german,english]{babel}
%\useshorthands*{"} 
%\addto\extrasenglish{\useshorthands{"}\languageshorthands{german}}

\usepackage{csquotes}

\useshorthands*{"}
\defineshorthand{""}{\babelhyphen{empty}}
\defineshorthand{"=}{\babelhyphen{hard}}

\begin{filecontents}{SM.bib}
@article{BPYC2011a,
        Author = {Robert C. Berwick and Paul Pietroski and Beracah Yankama and Noam Chomsky},
        Journal = {Cognitive Science},
        Number = {7},
        Pages = {1207--1242},
        Title = {{Poverty of the Stimulus} Hallo/""Halli Revisited},
        Volume = {35},
        Year = {2011}}
\end{filecontents}

\bibliography{SM}

\title{Doing bibliographies with the stars}

\begin{document}

Hallo/""Halli \citep{BPYC2011a} haben gezeigt, dass \ldots.


\printbibliography[heading=subbibliography,notkeyword=this]
\end{document}

快捷方式在正文中有效,但在参考文献中无效: 在此处输入图片描述

答案1

稍后您应该加载 biblatex。简写在 \begin{document} 处激活,并且 bib 条目也在那里读取,因此顺序很重要:

\documentclass{scrbook}

\usepackage{filecontents}

\usepackage[german,english]{babel}
%\useshorthands*{"}
%\addto\extrasenglish{\useshorthands{"}\languageshorthands{german}}

\useshorthands*{"}
\defineshorthand{""}{\babelhyphen{empty}}
\defineshorthand{"=}{\babelhyphen{hard}}

\usepackage[natbib]{biblatex}

\usepackage{csquotes}

\begin{filecontents}{SM.bib}
@article{BPYC2011a,
        Author = {Robert C. Berwick and Paul Pietroski and Beracah Yankama and Noam Chomsky},
        Journal = {Cognitive Science},
        Number = {7},
        Pages = {1207--1242},
        Title = {{Poverty of the Stimulus} Hallo/""Halli Revisited},
        Volume = {35},
        Year = {2011}}
\end{filecontents}

\bibliography{SM}

\title{Doing bibliographies with the stars}

\begin{document}

Hallo/""Halli \citep{BPYC2011a} haben gezeigt, dass \ldots.


\printbibliography[heading=subbibliography,notkeyword=this]
\end{document}

在此处输入图片描述

编辑

使用注释中提到的 langscibook 类,可以像这样反转加载顺序:

\RequirePackage{scrlfile}
\AfterClass{scrbook}{%
  \RequirePackage[german,english]{babel}%
  \useshorthands*{"}
  \defineshorthand{""}{\babelhyphen{empty}}
  \defineshorthand{"=}{\babelhyphen{hard}}}
\documentclass[biblatexbackend=biber]{langscibook}
\usepackage{filecontents}

\begin{filecontents}{SM.bib}
@article{BPYC2011a,
        Author = {Robert C. Berwick and Paul Pietroski and Beracah Yankama and Noam Chomsky},
        Journal = {Cognitive Science},
        Number = {7},
        Pages = {1207--1242},
        Title = {{Poverty of the Stimulus} Hallo/""Halli Revisited},
        Volume = {35},
        Year = {2011}}
\end{filecontents}

\addbibresource{SM.bib}

\title{Doing bibliographies with the stars}

\begin{document}

Hallo/""Halli \citep{BPYC2011a} haben gezeigt, dass \ldots.


\printbibliography[heading=subbibliography,notkeyword=this]
\end{document}

但是如果类可以更早地加载 babel 会更好。许多软件包都喜欢检测语言......

相关内容