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

1 Answer 1

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 ....

4
  • Thanks! I use a class from the publisher that already has biblatex loaded. Is there anything I could do in this situation? Jan 12, 2018 at 13:30
  • Difficult to say without the class. does it at least load babel before biblatex? Jan 12, 2018 at 13:47
  • It is the langsci class: ctan.org/pkg/langsci It loads babel with options I do not want, so I prevent the class from loading babel and load it myself. Since the class loads biblatex it is loaded before babel. Jan 12, 2018 at 14:20
  • I added an edit. Jan 12, 2018 at 14:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .