Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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!

share|improve this question

marked as duplicate by Peter Grill, Alan Munn, percusse, Joseph Wright Apr 18 '12 at 6:48

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
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 Apr 18 '12 at 3:36
    
And a related question Automatically convert quotes of the form "abc" to ``abc''. –  Alan Munn Apr 18 '12 at 4:27
add comment

2 Answers

up vote 20 down vote accepted

LaTeX tends to require you to use

`` '' 

for double quotes and

` '

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.

share|improve this answer
    
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 Apr 18 '12 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 Apr 18 '12 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 Apr 18 '12 at 15:20
    
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 Apr 18 '12 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 Apr 18 '12 at 17:07
add comment

Opening quotes are ``and closing quotes are ":

\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

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.