3

When I write "test" in latex (TeXStudio), I get this:

enter image description here

Clearly this is not what quotation marks should look like. There are a lot of answers on stackexchange about this question, but the ones I've seen seem pretty complex. What is the easiest and quickest way to get them to look properly without me having to go through my entire document and change any quotation marks?

ps. Why is this the default behaviour of quotation marks in Latex? It seems to me that nobody would ever want this.

7
  • 2
    Welcome to TeX-SE! You explained what you do not want. However, you may want to also explain what you want to achieve, i.e. how should these marks look like?
    – user121799
    May 9, 2019 at 4:59
  • 4
    Load package csquotes and use \enquote{I am a wombat} in your text.
    – Johannes_B
    May 9, 2019 at 5:03
  • 1
    Normal sane standards of quotation marks ... you know that different languages are using different quotation marks?
    – Johannes_B
    May 9, 2019 at 5:31
  • 4
    the input is a user error, it is like asking why latex does not produce the text 20% from input 20% the " should not be used, use `` and '' May 9, 2019 at 6:47

4 Answers 4

4

As explained in the Not So Short Introduction to LaTeX2e by Tobias Oetiker, page 19, you should not use " for quotation marks. Use two ` for opening and two ' for closing.

enter image description here

This is implicit in the answer of @Andrew, but I really do not see the need of making a command for that, instead of using it directly.

4

Configure Texstudio to get the correct quotation marks. For example for German quotations (http://texstudio.sourceforge.net/manual/current/usermanual_en.html#SECTION01):

enter image description here

Then the "-key will output the defined quotations:

 Input "quote" -> Output "`quote"'. in the editor window
3

If you change the category code of the double quote character then you can define a macro that typesets "test" as ``test''. In doing this, the only downside that I can see is that you will run into problems if you forget a closing quote. It is also not unlikely that this will cause havoc with some packages -- for example, double quotes are used by tikz so this will almost certainly not work if you want to use this in documents that also uses these features of tikz. You'd really be better off using the recommended quoting style of LaTeX, which is to use repeated left and right quotation marks instead of double quotes. A global search and replace in any decent editor that supports regular expressions should fix your current document.

For completeness I have added a \quot command to access the "real" double quote character and I have checked that accents like \"a still work as expected.

Here's the code:

\documentclass{article}

\newcommand\quot{"}% allow access to the real double quote

\catcode`\"=13     % change the category code of "
\def"#1"{``#1''}   % and make "stuff" expand to ``stuff''

\begin{document}

  "test"

  Universit\"at

  You can also write \quot test\quot

\end{document}

and here is the output:

enter image description here

2
  • 1
    You shouldn't use \def. Your \def\quote destroys the quote environment. May 9, 2019 at 7:51
  • @UlrikeFischer Thanks, I forgot about the quote environment. I've changed \quote to \quot.
    – user30471
    May 9, 2019 at 7:55
2

You can use the csquotes package to make an " an outer quote. It will even adapt to conventions of different languages. But I personnally avoid to make ascii chars active, and have setup my editor so that it allows me to insert real quotes or \enquote with a shortcut.

\documentclass{article}
\usepackage[ngerman]{babel}
\usepackage{csquotes}
\MakeOuterQuote{"}
\MakeAutoQuote{«}{»}

\begin{document}

  "test" 

  «text with some «inner quote»» 

  \enquote{text with some \enquote{inner quote}}

\end{document}

enter image description here

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