1

I try to get "" from babel to work with biblatex. How to get babel's language shorthands work inside biblatex entries with autolang=hyphen and langid fields? explains the general problem, but the solution does not work for me. This is my 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}

The shortcuts work in the main text but not in the references: enter image description here

Stefan Müller
  • 6,901
  • 3
  • 29
  • 61

1 Answers1

5

You should load biblatex later. The shorthands are activated at \begin{document}, and the bib-entries are read there too, so the order matters:

\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}

enter image description here

Edit

with the class langscibook mentioned in the comment one can reverse the loading order like this:

\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}

But it would be better if the class would load babel earlier. Lots of packages like to detect the language ....

Ulrike Fischer
  • 327,261