6

We all know csquotes and the multiple facilities it provides for displaying quotations and related content. One feature I'm particularly fond of are the active quotes, using \MakeAutoQuote. That's especially nice, for it allows to blend the power of csquotes for handling quote marks with code legibility.

However, the choice of active character to be used in \MakeAutoQuote and \MakeAutoQuote* is quite a tricky one. It is easy to make mistakes there, and getting a nice workflow out of it is not that easy.

For example, if one happens to use:

\MakeOuterQuote{"}

conflits with babel (in a number of languages) or in file paths would be very likely.

A less obvious pitfall would be:

\MakeAutoQuote{“}{”}
\MakeAutoQuote*{‘}{’}

which would result in unbalanced quotes as soon as one writes:

“I don’t know what I’m doing.”

For another one, see csquotes \MakeAutoQuote{>}{<} and the graphicx creates problems under LuaTeX.

So, I'm interested in the following:

  • What characters one should not use for the purpose of active quotes in csquotes?

  • What are good candidates for the purpose? Are there any expected conflicts or trade-offs for those candidates?

I'm aware that choice here may well be dependent on the language(s) of the document and on the particular input setup at hand (including keyboard and editor in use). So I'd be glad to hear of particular setups, and the reasons behind them and their eventual caveats. But, if at all possible, I'd be specially interested in some general guidelines on the matter.

7
  • 1
    The biblatex docs have \MakeAutoQuote{«}{»}\MakeAutoQuote*{<}{>} The latter looks dangerous (see the linked question), but hasn't exploded into our faces yet and I never use the former because I can't make those symbols on my keyboard easily.
    – moewe
    Jan 29, 2019 at 12:23
  • @moewe I had those for a while. And it seems «» is a relatively common choice. But my keyboard, as yours, doesn't like them very much. I always end up with some kind of trade-off, so I'm asking for others' experience on the matter.
    – gusbrs
    Jan 29, 2019 at 12:29
  • 2
    Tricky... Most ASCII characters already mean something else and should probably not be redefined. And I guess with most Latin-derived keyboards you are going to end up with ASCII plus a few accented letters, so the 'safe' chars would probably have to be accessed by some kind of editor feature. Additionally you'll want to pick symbols that make a good pair and don't look to outlandish so that they can easily be recognised as quotation marks (otherwise there is little point in the exercise and \enquote{...} might be clearer). That's why I've always stuck with \enquote{...}
    – moewe
    Jan 29, 2019 at 13:34
  • 1
    I normally use «» or \enquote{}. And I have shortcuts in my editor (alt qqq and alt qqe) to put them around a word or a selection. Jan 29, 2019 at 13:35
  • @UlrikeFischer Thanks! But, if I may ask. "alt qqq/qqe": which editor would that be?
    – gusbrs
    Jan 29, 2019 at 13:56

1 Answer 1

4

I was hoping to hear the voice of experience on this one, but I will try to provide a reasonable self-answer, based on the comments received (which were appreciated), what I found on the site on this matter, the csquotes documentation, and my personal experience.

Don'ts

You certainly don't want to make a LaTeX reserved character a csquotes active character. This thus excludes:

#, $, %, ^, &, _, {, }, ~, \

The csquotes docs extend this list to:

In general, an active quote may be any single character with category code 12 or 13, or any multibyte UTF-8 sequence representing a single character. However, there are a few exceptions: numbers, punctuation marks, the apostrophe, the hyphen, and all characters which are part of the LaTeX syntax are rejected. In sum, the following characters will be considered as reserved by this package: A–Z a–z 0–9 . , ; : ! ? ' - # $ % & ^ _ ` ~ \ @ ∗ { } [ ]

ASCII: Convenient, but some care is needed

As most keyboards go, the ASCII range is likely to be the most convenient in terms of input. But, net of the above list, the options are scant. Some working setups may be found here though, depending on your environment. In examining related questions on the site, I've met two relatively common uses:

  • the quotation mark ", the regular straight one. Which, in this case is used with, \MakeOuterQuote{"}, given the lack of a pair.

  • less-than and greater-than signs <>.

csquotes goes great lengths to try to avoid conflicts. In particular, in math mode and verbatim environments:

All quotation commands are designed for use in text mode and will issue an error message in math mode. Note that all active quotes retain their original function in math mode. It is perfectly possible to use a character like the greater-than symbol as an active quote without interfering with math mode. In a verbatim context, the active quotes will normally be disabled.

However, some care is still needed:

Some care is still required when choosing active quotes. Note that you normally cannot use active characters in the argument to commands expecting a string of characters, such as \input, \label, or \cite. There are two packages which try to remedy this situation: the babel package and the underscore package (when loaded with the strings option). Both packages redefine several standard commands affected by this general problem. If any one of these packages is loaded, csquotes will take advantage of all improvements automatically. Unfortunately, both packages patch a different set of commands and neither one covers all possibly vulnerable commands.

Some examples of pitfalls of these choices are to be found here on the site. But they are certainly manageable. In particular, csquotes also provides \DisableQuotes and \EnableQuotes to manage active quotes locally.

This discussion may also be of interest, though not directly related with csquotes: How do I prevent "s from turning into ß with babel?

Popular candidates: non ASCII quotes characters

Those are:

  • curved quotes, single and double: , , ,
  • pointing quotes, or guillemets, usually the double ones, but there are also single ones: «, », ,

The only care needed here, that I'm aware of, is in the use of single curved quotes. If you choose them as csquotes' active quotes characters, you should take the care of using straight quotes when an apostrophe is meant, otherwise you will end up with unbalanced quotes.

Other than this, the only concern is then how to conveniently type in these characters.

Input considerations

This will hang on both your keyboard and your editor. Many editors do provide some sort of on the fly substitution of straight quotes for curved ones, or eventually other quotes (aka "smart quotes"). Some editors will grant you more flexibility to configure input of particular keys or allow you to access with enough ease the typing of any particular character of your choice.

One trade-off, that might arise in the use of "smart quotes" and related facilities is that, as the quotes are automatically substituted by curved ones as you type, you may face inconvenience when you actually need regular straight ones for one reason or another (babel shortcuts, paths etc). Again, how this affects you will depend on your editor and setup.

Depending on your system, your keyboard can be reconfigured too, if that's to your liking. And, you might get lucky and have some of those characters available in your keyboard by default, with the use of modifier keys. For example, the US International keyboard layout seems to have guillemets available with AltGr + [ and AltGr + ]. If you follow egreg's advice and "buy whatever keyboard you prefer, so long as it is International English", you shall be sorted there. (I use a pt_br keyboard, where they're available with AltGr + z and AltGr + x).

Coda: Active inner quotes too?

csquotes supports the use of active quotes for both \enquote and \enquote*, that is, for outer and inner quotes (and more, of course), namely:

\MakeOuterQuote{<character>}
\MakeInnerQuote{<character>}

\MakeAutoQuote{<character 1>}{<character 2>}
\MakeAutoQuote*{<character 1>}{<character 2>}

You should consider, though, if both are actually equally convenient to you. csquotes handles the nesting of quotes automatically and Does The Right Thing™. So, you will likely very frequently meet the need to input a standard outer quote, whereas very rarely will need to force an inner quote at any particular moment. Hence, setting an active character for the frequent outer quote, and relying on \enquote* for the eventual exception, may be the most interesting setup.

Examples on the site:

  • of straight quotes with \MakeOuterQuote:

Isn't there any other way of doing double quotes in LaTeX besides `` + ''?

Automatic german quotation marks

Quotations spanning multiple paragraphs in csquotes with french guillemets under LyX

  • of some (fixable) trouble between straight quotes and babel:

Using \selectlanguage with csquotes

  • of trouble between straight quotes and paths with spaces:

Make " an active quote while including subfiles with spaces in their path

  • of use of less-than / greater-than signs:

Replace quotation marks (or: use << and >> as csquote like auto-quotes)

How to type apostrophes in an easier way?

Depending on the edition, but in the same language, I want different kind of quotes

  • of some trouble with the use of less-than / greater-than signs:

Problem with csquotes and hyperref color links together

csquotes \MakeAutoQuote{>}{<} and the graphicx creates problems under LuaTeX

csquotes, hyperref and scrartcl produce multiple errors when \makeautoquote and \makeautoquote* are used

  • of guillemets use:

What's the advantage of using csquotes over using an editor's auto-replacement for "?

csquotes: Using Auto Quotes to Create Block Quotes if Required

How to quote correctly with csquotes?

LaTeX compiles <" a> to <ä>

biblatex: sentence case and nested quotation marks (might this be the source of biblatex's docs settings?)

  • of curved double and single quotes:

How can I conditionally designate an active quote in csquotes.cfg?

Get Emacs' electric quote mode to work with AUCTeX and BibTeX mode

Consistent typography (note the care with the apostrophes)

Is it safe to “fake” smart quotes with active characters while using a T1 font?

You must log in to answer this question.

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