2

When using the package babel with the norwegian option (\usepackage[norsk]{babel}), double-quotation marks (") in \texttt{} disappear if they occur before certain letters (e.g., b, d, and f), but not for others. Is there any solution to this?

Minimal working example:

\documentclass[]{article}
\usepackage[norsk]{babel}
\begin{document}
\texttt{"a" "b" "c" "d" "e" "f"} 

\texttt{"a"} \texttt{"b"} \texttt{"c"} \texttt{"d"} \texttt{"e"} \texttt{"f"}
\end{document}

with \usepackage[norsk]{babel} (leading " removed sometimes)

without \usepackage[norsk]{babel} (this is how I want it to be)

  • 3
    As in Danish " is an active character in Norsk, if we look in norsk.ldf we see for example that \declare@shorthand{norsk}{"e}{\textormath{\bbl@disc e{\'e}}{}}, honestly I have no idea what it is doing here, but there is your rexplanation – daleif Nov 18 at 9:22
  • 1
    Ahh it is explained further in norsk.pdf you should hjave it on your computer, else find it on texdoc.net – daleif Nov 18 at 9:25
  • What are you trying to typeset? If you want to show code better use \verb or some other verbatim command. – Ulrike Fischer Nov 18 at 9:29
  • this is being generated from a bookdown-markdown file, so I can't change the environment. – thias Nov 18 at 9:33
  • 2
    If you don't need the " shorthand, disable it with \shorthandoff{"}. You can also use \usepackage[norsk,shorthands=off]{babel} – Ulrike Fischer Nov 18 at 9:45
6

You can disable shorthands completly

\documentclass[]{article}
\usepackage[norsk,shorthands=off]{babel}
\begin{document}
\texttt{"a" "b" "c" "d" "e" "f"} 

\texttt{"a"} \texttt{"b"} \texttt{"c"} \texttt{"d"} \texttt{"e"} \texttt{"f"}
\end{document}

or locally

\documentclass[]{article}
\usepackage[norsk]{babel}
\begin{document}
\texttt{"a" "b" "c" "d" "e" "f"} 

\shorthandsoff{"} 
\texttt{"a"} \texttt{"b"} \texttt{"c"} \texttt{"d"} \texttt{"e"} \texttt{"f"}
\end{document}

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.