150

Possible Duplicate:
What is the best way to use quotation mark glyphs
Automatically convert quotations in the form of “abc” to become ``abc"

I am (obviously) new to LaTeX and have about 40 pages of text where it seems like half the quote marks are going the wrong way for American English. The opening and closing quotes are both pointing the same way (as if they were all closing quotes). I copied some text from MS Word to texmaker, but I believe that's unrelated because this version, with my headers and newly typed text, does the same thing (using PDFLatex):

\documentclass[11pt,letterpaper,titlepage]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[top=1.25in, bottom=1.25in, left=1.25in, right=1.25in]{geometry}
\usepackage{etoolbox}
\apptocmd{\thebibliography}{\raggedright}{}{}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage[hyphens]{url}
\author{Me}
\title{Hello world}
\begin{document}
\section*{Acknowledgements}
Here are some people I'd like to thank. "Thanks!"
\end{document}

The single quote in "I'd" is curled right and so is the double quote after !. But the one before Thanks goes the wrong way. They all appear to be straight in the editor window.

My understanding is that little inline quotes like this is not what \quote{} is for. Is there some way to fix that doesn't involve going through all 40 pages with a fine-toothed comb?

Three different styles!

2
  • Of no direct relevance to your question about how to get typographic opening and closing quotes right, but of consequence for the appearance of your bibliography: Don't use \apptocmd{\thebibliography}{\raggedright}{}{}; instead, use \AtBeginEnvironment{thebibliography}{\raggedright}. The former macro is used to patch commands, whereas the latter affects the setup on an entire environment (such as the thebibliography environment).
    – Mico
    Commented Apr 18, 2012 at 3:36
  • 1
    And a related question Automatically convert quotes of the form "abc" to ``abc''.
    – Alan Munn
    Commented Apr 18, 2012 at 4:27

2 Answers 2

245

LaTeX tends to require you to use

`` <quoted text here> '' 

for double quotes and

` <quoted text here> '

for single quotes. The "smart quotes" will be done by the compilers.

if you have already typed your text with " " throughout your document you can use the csquotes package to deal with them:

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

Adding this to your preamble will use the double quotation mark character as your delimiter for outer quotes. csquotes will then translate it to what it needs to be in your chosen language, which in your case is american english and so will appear as “ ”. You should therefore have nothing else to change in your document.

8
  • Thank you, this seems really promising, but it's still not working right. See the tiny screenshot I added to the bottom of the question. It's hard to see, but in two lines, there are three different combinations of quote directions! They all look the same in the texmaker edit window but I wonder if the ones that I originally copy/pasted from Word are actually a different character than than the ones I'm typing in texmaker.
    – umbraphile
    Commented Apr 18, 2012 at 14:17
  • @umbraphile that is quite possible, MS Word has the nasty default habit of auto replacing quotes with "smart quotes". with a utf8 input latex will be able to parse them and display them but it does mess things up if you don't realise they are there. You could try and change the font used in your editor and see if the characters look different.
    – ArTourter
    Commented Apr 18, 2012 at 14:32
  • This is incredibly strange! I've made the editor font huge and a serif font, and they all look identical and straight in the editor. If I copy and paste a correct-looking one to one that isn't correct, nothing changes. If I try to manually fix one of the ones that's wrong by using backticks and single quotes, the ones after it become wrong. Your solution fixed about 75% of them but to fix that last 25% I fear I'm going to have to go back and make them all backticks and single quotes. And here I thought I'd be saving time by doing thinking first, formatting later.
    – umbraphile
    Commented Apr 18, 2012 at 15:20
  • 2
    You must have an non-terminated pair somewhere. csquotes will parse things in a way that goes: I see a " so I will start a quote, and then I see another one, so I will close it. If at some point you opened a quote without closing it or closed one without an opener, then every things will shift. if you have multiple instances of this, it will be messy.
    – ArTourter
    Commented Apr 18, 2012 at 15:27
  • Yes, I think that's it! I was scrutinizing the opening quotes, because they're the ones that look wrong. But every so often, there's a close quote that's a curly one instead of straight (which I can only see at about 26pt font). That seems to interrupt the open/close pattern, so I just need to zap those into non-curly ones, and then the following ones are fixed. Whew.
    – umbraphile
    Commented Apr 18, 2012 at 17:07
67

Opening quotes are `` and closing quotes are ". For instance,

\documentclass{article}

\begin{document}

``Thanks!"

\end{document}

enter image description here

For greater control over your quotations (in particular, for your concrete "search and replace" problem), you could consider using the csquotes package:

\documentclass{article}
\usepackage[english]{babel}
\usepackage[autostyle]{csquotes}

\begin{document}

\enquote{Thanks!}

\end{document}

a

3
  • 12
    If you are using `` to open the quotes, you should use '' (two single quotes) to close as some fonts use a different quote mark character for the " character. I also think mixing can make the source look messy. See ArTourter's answer.
    – flungo
    Commented Apr 23, 2017 at 10:17
  • Note, this solution can induce a problem with rendering the entire document - IF there is an unmatched " , you may find this following error: "csquotes Error ! Package csquotes Error: Unbalanced groups or invalid nesting" or " ! File ended while scanning use of \@newl@bel." - often with the wrong line number identified in the log. Scan for unmatched " - especially near the end of the document / prior to references section, if you have one. Commented Oct 23, 2020 at 8:28
  • 1
    `` '' is not working for me. I can't find out why. Commented Apr 1, 2021 at 1:36

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