3

LaTeX has a tendency to format all quotation marks in the same direction. For double quotes, I've fixed this problem by adding:

\usepackage[autostyle, english = american]{csquotes}
\MakeOuterQuote{"}

However, I can't seem to figure out how to do the same for single quotes. At the moment, This is a 'quote'. results in:

enter image description here

As you can see, the opening ' should be mirrored. I've found multiple topics about this on StackExchange and most suggest to use \lq or a backtick instead. However, I was wondering if it would be possible to automatically format single quotes correctly, just like I did with the double quotes above. Suggestions are greatly appreciated!

3

Well you can do it. But you need to remove the quote first from the list of reserved characters.

But if you uncomment the l'enfer you will see why csquotes did put the character in the list (and so prevents you from using it as a \MakeInnerQuote character).

I would advise you to avoid such tricks. They bite you when you don't expect them. Using \enquote is a bit more typing work but much safer. Instead of trying to tweak LaTeX invest some time to setup your editor so that it inserts \enquote with a shortkey.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage[autostyle]{csquotes}
\MakeOuterQuote{"}
\MakeAutoQuote{«}{»}
\makeatletter
%Remove \do\' from the list of reserved chars
\def\csq@resrvdchars{%
  \do\[\do\]\do\*\do\@\do\~\do\-\do\`\do\.\do\,\do\;\do\:%
  \do\!\do\?\do\0\do\1\do\2\do\3\do\4\do\5\do\6\do\7\do\8\do\9}
\makeatother
\MakeInnerQuote{'}  

\begin{document}
"quote" 'quote'  %l'enfer
\enquote{quote}
\enquote*{quote}
«quote «inner quote» quote»
\end{document}

enter image description here

| improve this answer | |
3

csquotes decides which type of quotation marks to use based on the language setting. For example, in British typography it is custom to have single quote marks as the outer quote, and double as inner quote marks. For American English it's the opposite.

Hence,

\documentclass{article}
\usepackage[british]{babel}
\usepackage{csquotes}
\MakeOuterQuote{"}
\begin{document}  
"quote"
\end{document}

produces

enter image description here.

Change british to american, and you get

enter image description here.

| improve this answer | |
  • Was this helpful at all, or should I delete? – Torbjørn T. May 10 '16 at 9:37
  • It doesn't really answer my question, but it's surely interesting to know. Thanks! – Algorithm_NL May 10 '16 at 11:13

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.