[Tex/LaTex] What’s the advantage of using csquotes over using an editor’s auto-replacement for “

automationcsquoteseditorspunctuationquoting

Many editors (TeXnicCenter, Texmaker, TeXworks, …) offer auto-replacement of " by the desired form of quotation marks, be it `` and '' for English, "` and "' for German, or whatnot. Usually, I know right from the start which quotation marks I want to use throughout a document, and I hardly ever nest quotations. Seeing that csquotes has at least one disadvantage (see Wrong protrusion with csquotes and microtype) that is more likely to occur than nested quotes, I wonder:

What advantages would I get from using the csquotes package over these "manual" quotes? Obviously, I could set up auto-replacement of " through \csquotes{cursor here}, which would result in similar typing activity.

Best Answer

Advantage

If you use biblatex or multiple languages with babel or polyglossia, you can benefit from the integrated commands of csquotes. There are commands to quote in languages other than the main language so that the quoted text is typeset in accordance with the rules of the language. There are also commands to make formal quotes, both in the main language and in other languages, that gets the proper quotation marks from csquotes and a reference via biblatex.

If you use these commands rather than manually setting quotation marks, it may be easier to be consistent with quotations and hyphenation. Also, it can help you to be consistent with block quotes because csquotes has commands to make block quotes out of quotations that are longer than a certain threshold.

Here is an example of just a few of the available commands. You can read about the other commands in the manual.

\documentclass{article}

\usepackage{biblatex}
\usepackage{csquotes}
\usepackage[UKenglish,USenglish]{babel}
\usepackage{filecontents}

\begin{filecontents*}{\jobname.bib}
@book{nnt,
   author   = {N.N.},
   title    = {Title},
   year     = {2011}
   }
\end{filecontents*}
\addbibresource{\jobname.bib}

\begin{document}

\hyphenquote{UKenglish}{quote with UK English hyphenation}

\textcquote[1]{nnt}{formal quote}

\hyphentextcquote{UKenglish}[1]{nnt}{formal quote with UK English hyphenation}

\hyphenblockcquote{UKenglish}[1]{nnt}{A long formal quote with UK English hyphenation which happens to be longer than three lines and, thus, is typeset as a block quote. This text is just to make it long enough. This text is just to make it long enough. This text is just to make it long enough.}

\printbibliography

\end{document}

Output of example

Easier input of csquotes macros

If you find it bothering to write the macros of csquotes you can use a snippet manager for the ones that you use often. For example, in my setup I write enq and press Tab which expands enq to enquote{} and places the cursor between the braces. See Replace the `$$ ... $$` macro with the `\[ ... \]` macros? - Prefer the way LaTeX lays it out, but `$` are faster to write for a more elaborate example of snippet managers.

If you use AUCTeX, it can be configured so that " expands to csquotes macros by inserting the following into your .emacs:

;; " expands into csquotes macros
(setq LaTeX-csquotes-close-quote "}"
      LaTeX-csquotes-open-quote "\\enquote{")

Note that for this to work in conjunction with babel, babel must be loaded after csquotes.

Related Question