4

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

0

2 Answers 2

6

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

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

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

You must log in to answer this question.

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