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.

user56834
  • 463

4 Answers4

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
user187802
  • 16,850
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

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

Ulrike Fischer
  • 327,261