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)

9
  • 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
    Commented Nov 18, 2019 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
    Commented Nov 18, 2019 at 9:25
  • What are you trying to typeset? If you want to show code better use \verb or some other verbatim command. Commented Nov 18, 2019 at 9:29
  • this is being generated from a bookdown-markdown file, so I can't change the environment.
    – thias
    Commented Nov 18, 2019 at 9:33
  • 2
    If you don't need the " shorthand, disable it with \shorthandoff{"}. You can also use \usepackage[norsk,shorthands=off]{babel} Commented Nov 18, 2019 at 9:45

1 Answer 1

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}

You must log in to answer this question.

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