[Tex/LaTex] babel: Adding ngerman’ s language shorthands to english as the main document language

babelhyphenationlanguagesshorthands

The (n)german language option of the babel package provides various shorthands related to hyphenation, e.g. "-: "an explicit hyphen sign, allowing hyphenation in the
rest of the word"
(manual, section 22). At least some of these shorthands are also useful for English texts — e.g., typing zoning-facil"-itated results in the following legal breakpoints (assuming English hyphenation patterns): zoning-facil-i-tated. (Note: hyphenation before "- is disabled in this case because of the explicit hyphen after "zoning".)

When using ngerman as the main document language and switching to english within the document body, \addto allows to carry over language shorthands:

\documentclass{article}

\usepackage[english,ngerman]{babel}
\addto\extrasenglish{\languageshorthands{ngerman}}

\begin{document}

\selectlanguage{english}

Adding \textsf{ngerman} language shorthands to \textsf{english}: zoning-facil"-itated.

\end{document}

However, this doesn't work with english as the main document language (and ngerman still specified as additional option):

\documentclass{article}

\usepackage[ngerman,english]{babel}
\addto\extrasenglish{\languageshorthands{ngerman}}

\begin{document}

Adding \textsf{ngerman} language shorthands to \textsf{english}: zoning-facil"-itated.

\end{document}

How can I add ngermans language shorthands to english while using english as the main document language?

Best Answer

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

\minipage{1cm}\hrulefill

\hspace{0pt}zoning-facilitated

\hspace{0pt}zoning"=facil"-itated
\endminipage
\end{document}

enter image description here

With lualatex you do not need the \hspace{0pt} (LuaTeX hyphenates the first word of a paragraph, which TeX doesn't)

Related Question