9

Example: Line 5 is my problem...

I want to use simple quotation marks in a multilingual document with csquotes AND babel, with the help of \MakeOuterQuote{"}, and I need the command \selectlanguage{ngerman} to return to German. (Line 2 and 3 show a solution with the environment otherlanguage* which I cannot use).

It seems that babel overwrites the OuterQuote of csquotes. Anybody an idea?

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{mathptmx}

\usepackage[french,ngerman]{babel}

\usepackage[babel,german=quotes,french=quotes]{csquotes}
\MakeOuterQuote{"}

\begin{document}

"abend", "beispiel" (\languagename) 

\begin{otherlanguage*}{french}
"abend", "beispiel" (\languagename) 
\end{otherlanguage*}

"abend", "beispiel" (\languagename)

\selectlanguage{french} 
"abend", "beispiel" (\languagename) 

\selectlanguage{ngerman} 
"abend", "beispiel" (\languagename) 

\end{document}
8
  • Welcome to TeX.SX! With the ngerman option activated, " becomes a shorthand prefix, and this interferes with your usage for quotes, because "a is used to type “ä”, for instance, and this has precedence. So "a produces ä but "b goes well, because it's not a defined shorthand.
    – egreg
    Jan 6, 2014 at 16:26
  • That's right, thank you, but the first and the third line are in ngerman option as well, with the wanted behaviour of csquotes.
    – user43669
    Jan 6, 2014 at 16:33
  • 1
    crossposting golatex.de/… Jan 6, 2014 at 16:37
  • I recommend using \enquote, or at least » and « to specify the outer delimiters.
    – Johannes_B
    Jan 6, 2014 at 16:40
  • 6
    @user43669 Your setting of \MakeOuterQuote{"} initially overrides the ngerman ones, but an explicit \selectlanguage{ngerman} restores the default of babel.
    – egreg
    Jan 6, 2014 at 16:50

2 Answers 2

4

I'm only answering to get the question from the "unanswered queue". Personally I don't think that it is a good idea to overload ascii chars like this. There are too much potential places (e.g. the bib-file) where the char needs to have the "other" meaning. I myself use \MakeAutoQuote{«}{»} together with a sensible shortcut in my editor to put the quotes around selected text.

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{mathptmx}

\usepackage[french,ngerman]{babel}

\usepackage[babel,german=quotes,french=quotes]{csquotes}
\MakeOuterQuote{"}

\begin{document}
\let\mycsouterquote"
\addto\extrasngerman{\let"\mycsouterquote}
\addto\extrasfrench {\let"\mycsouterquote}

"abend", "beispiel" (\languagename)

\begin{otherlanguage*}{french}
"abend", "beispiel" (\languagename)
\end{otherlanguage*}

"abend", "beispiel" (\languagename)

\selectlanguage{french}
"abend", "beispiel" (\languagename)

\selectlanguage{ngerman}
"abend", "beispiel" (\languagename)

\end{document}

enter image description here

1
3

Dealing with this problem myself, I decided to simply disable shorthands globally. My texts are generally UTF-8 encoded so that Umlauts et al are printed just fine.

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[shorthands=off, % Don't translate quotation marks followed by vocals to umlauts
            ngerman         % Neue deutsche Rechtschreibung
]{babel}
\usepackage[autostyle]{csquotes}
\MakeOuterQuote{"}
0

You must log in to answer this question.

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