2
  • I am writing an English document.
  • Normally I write in German.
  • The babelpackage offers for German specific commands/shorthands like "= for a - that does not suppress other hyphenations in the word.
  • I would like to be able to use the ngerman shorthands in English.
  • I found \addto\extrasenglish{\languageshorthands{ngerman}} in the current babel manual but it did show now effect.

\documentclass{article}

\usepackage[ngerman,english]{babel}

\begin{document}
Testtext. Test"=Text. \foreignlanguage{ngerman}{Test"=Text}
\end{document}

% Related (the first link is in German)
% http://homepage.ruhr-uni-bochum.de/Georg.Verweyen/silbentrennung.html
% https://tex.stackexchange.com/questions/256740

enter image description here

enter image description here (Taken from an old version of the babel manual (2005). In the current manual, I did not find this table.)

2

After reading "| shortcut no longer available in babel? from 2015 more carefully, I could copy and paste a solution. But I am still interested, if that's the intended way to solve this (2015 vs. 2020)?!

\documentclass{article}

\usepackage[ngerman,english]{babel}
% See "Languages with only " as defined shorthand character" in babel manual.
% ngerman is one of the languages that uses '"' as the only shorthand character.
\useshorthands{"} 
\addto\extrasenglish{\languageshorthands{ngerman}}

\begin{document}
Testtext. Test"=Text. \foreignlanguage{ngerman}{Test"=Text}
\end{document}

enter image description here

The command \languageshorthands can be used to switch the shorthands on the language level. It takes one argument, the name of a language or none (the latter does what its name suggests). Note that for this to work the language should have been specified as an option when loading the babel package. For example, you can use in english the shorthands defined by ngerman with [...] (You may also need to activate them as user shorthands in the preamble with, for example, \useshorthands{...} or \useshorthands{...}*.)

| improve this answer | |
  • Remark: I can include this in the question, if this is preferred. – Dr. Manuel Kuehner Jan 5 at 7:25
  • 1
    Looks like the correct answer to me. – cgnieder Jan 5 at 8:12
  • @clemens Thanks for the feedback! – Dr. Manuel Kuehner Jan 5 at 8:29

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.