I want to disable babel's shorthands in my own sty file.
But since I can use \shorthands{off}
only inside the document environment, I struggle with this.
Is there a way to disable babel's shorthands in the preamble already?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this community\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\let\LanguageShortHands\languageshorthands
\def\languageshorthands#1{}
\begin{document}
"`foo"'
\LanguageShortHands{ngerman}
"`foo"'
\end{document}
hyperref
Babel 3.9 now provides a package option to deactive shorthands at once:
\usepackage[shorthands=off,ngerman]{babel}
Their functionality are still available with \babelshorthand
.
There is a beta package babeltools
, to be loaded before babel
, that plans to allow this, with the addition of selectively enabling some shorthands.
babeltools
and its inclusion in TeX Live, perhaps not?
Yes, just use PassOptionsToPackage
before documentclass
like this:
\PassOptionsToPackage{shorthands=off}{babel}
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\begin{document}
"`foo"'
\LanguageShortHands{ngerman}
"`foo"'
\end{document}
\AtBeginDocument{...}