3

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

4

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

You can use the star version of \useshorthands to keep it active in all languages:

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

enter image description here

  • Indeed, this works -- i missed the starred version. Shame that I can't accept two answers :-( Thanks! – FredFisch Jul 26 '16 at 15:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.