[Tex/LaTex] Babel: Add german language shorthands

babelhyphenationlanguagesshorthands

I want to use the German language shorthands provided by babel with other languages; the main language of the document is German.

In following MWE the shorthands "= and /"" don't work when the English language is selected; uncommenting \useshorthands{"} doesn't have any effect.

I tried this with pdflatex of TeXLive 2014 and 2016.

(Reversing the order of the languages in the option list of babel has the desired effect, but I want to have German as the main language)

\documentclass{scrartcl}
\usepackage[english,ngerman]{babel}
%\useshorthands{"}
\addto\extrasenglish{\languageshorthands{ngerman}}

\begin{document}
erster/""zweiter Teil \\
Bindestrich"=Wort

\selectlanguage{english}

first/""second part\\
Hyphen"=Word

\selectlanguage{ngerman}
erster/""zweiter Teil\\
Bindestrich"=Wort
\end{document}

output of MWE

Best Answer

It works for me with

\addto\extrasenglish{\languageshorthands{ngerman}\useshorthands{"}}

enter image description here

Code:

\documentclass{scrartcl}
\usepackage[english,ngerman]{babel}
\addto\extrasenglish{\languageshorthands{ngerman}\useshorthands{"}}

\begin{document}
erster/""zweiter Teil \\
Bindestrich"=Wort

\selectlanguage{english}

first/""second part\\
Hyphen"=Word

\selectlanguage{ngerman}
erster/""zweiter Teil\\
Bindestrich"=Wort
\end{document}
Related Question