TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I get straight quotation marks, i.e., " and ' in TeX? (No, \verb changes the font and this is unacceptable.)

[Edit] I forgot to mention that I’m using XeLaTeX, and fontspec is a necessity. The first two proposed answers did work, without fontspec.

share|improve this question
It seems you want to include code snippet in your latex document. If my prediction is correct, the following might be what you are looking for: Double quotes with monospaced font and LuaLaTeX – xport Dec 25 '10 at 19:09
@xport But your prediction was not correct, … sorry. – J̲C̲ Dec 25 '10 at 19:48
up vote 25 down vote accepted

I found this post in the last few days while searching for an answer to the same problem. I'm also using XeLaTeX, and also need fontspec, so I feel your pain. I tried all kinds of things, which I won't list here.

Here's the solution I came up with:

As you discovered, the Mapping=tex-text option is what is changing the straight quotes to curly (no matter what). As you also saw, removing it results in no curly quotes anywhere. That's no good either.

The standard XeLaTeX template in TeXShop (I've excluded the sans and mono font declarations) has:

\setmainfont[Mapping=tex-text]{Hoefler Text}

I decided to define a new font, using the same typeface as the roman font, but not include any mapping.

\newfontfamily{\S}{Hoefler Text}

As a final step, the \defaultfontfeatures{Mapping=tex-text} line must be deleted or commented out. If not, it adds mapping to all font declarations. I suppose that's meant to be helpful in case one forgets it, but in this case, it's holding us back. Since \setromanfont above already declared its mapping, removing it as a default feature won't alter the appearance of normal typing, giving you access to curly quotes.

The altered preamble section will then be:

\setmainfont[Mapping=tex-text]{Hoefler Text}
\newfontfamily{\S}{Hoefler Text}

When you need straight quotes, put them within the custom font call. Since there is no mapping, you will get finally them.

The ``antique'' table is 5{\S '}6{\S "} long.

I set custom commands to make writing easier.

\newcommand{\inch}{{\S "}}
\newcommand{\feet}{{\S '}}

This allows me to write:

The ``antique'' table is 5\feet 6\inch\ long.

I hope this helps. I was creating a 100+ page document, and needed both curly and straight quotes frequently. This is the only thing I've tried that works, period. If there is a more elegant way (in XeLaTeX with fontspec), I'd love to learn it. I've only been using TeX/XeLaTeX for 2-3 months, so I'm kind of a newbie.

share|improve this answer
Thanks for your advice which works. BTW, I tried to keep \defaultfontfeatures{Mapping=tex-text} and define the font family \S with \newfontfamily{\S}[Mapping=tex-ansi]{...}, --- this also works. – J̲C̲ Feb 18 '11 at 4:11
Good to know! Thanks. – Michael Feb 18 '11 at 4:14
from the fontspec documentation: Using the Mapping=tex-text is equivalent to writing Ligatures=TeX. The use of the latter syntax is recommended for better compatibility with LuaTEX documents. In addition to ligatures, this will emulate TeX's behaviour for ASCII input of curly quotes and punctuation. If you do NOT want this additional emulation, just use Ligatures=Common instead. – matth May 3 '12 at 16:02
Alternatively, you can also \defaultfontfeatures{Mapping=tex-text} and then load the monospaced font with \setmonofont[Mapping=]{Monaco} to clear the Mapping out! – NoWhereMan Oct 3 '14 at 13:11
Argh—feet and inches glyphs are not straight quotes, they're primes. Use \renewcommand{\feet}{\char"2032\relax} \renewcommand{\inch}{\char"2033\relax} instead. – Will Robertson May 18 '15 at 7:38

alt text

Using \usepackage[T1]{fontenc} is @TH's idea. I just add \usepackage{upquote} to provide a single straight quote using \textquotesingle.



\textquotesingle single straight quote\textquotesingle\ 
and "double straight quote"


`single curly quote' and ``double curly quote''
share|improve this answer
This works well if <i>fontspec</i> is not used, but it’s necessary for me. (Sorry I forgot to mention I’m using XeLaTeX…) – J̲C̲ Dec 25 '10 at 19:43
Use \textquotesingle provided by \usepackage{upquote}, and what happens? – xport Dec 25 '10 at 19:52
It works, provided I don’t use \setmainfont[Mapping=tex-text]{...}. If I do not specify the mapping, curly quotes will be unavailable; if I do, \textquotesingle becomes curly too. – J̲C̲ Dec 25 '10 at 20:20

enter image description here

The LaTeX encoding specific commands for quotes of various sorts are listed below. The first group are defined in (at least) T1 encoding and the second group are defined in (at least) TS1 encoding. If in addition to loading the encodings (via \usepackage[TS1,T1]{fontenc} the TS1 encoding is loaded via \usepackage{textcomp} then in addition to declaring the TS1 quotes for TS1 encoding, this is made the default encoding, so if you use \textquotesingle in an encoding for which the straight quote is not declared then LaTeX will switch to TS1 encoding just for this character.







It's advisable to use \textquotedbl rather than simply " to get straight double quotes even if your document encoding is T1. These will produce the same character (and " is easier to type) but using \textquotedbl will make your text more easily usable if it is reused in other contexts that may be set up to use other default encodings.

share|improve this answer
I can produce a straight apostrophe with \textquotesingle without either TS1 or T1, using the old OT1. – Sverre Aug 28 '13 at 18:05
@Sverre by default you get ` Undefined control sequence. \textquotesingle` so you must have defined it somehow: there is no straight quote in OT1 just ' (which is only straight in tt fonts) – David Carlisle Aug 28 '13 at 18:09
You're right. It's apparently defined by the libertine package. – Sverre Aug 28 '13 at 18:23
@Sverre and produces ....\TS1/LinuxLibertineT-TLF/m/n/10 ' that is, it uses the TS1 encoded font for the symbol. – David Carlisle Aug 28 '13 at 18:29

The OT1 font encoding does not contain a " character. However, T1 does.

share|improve this answer
@TH, If he wants only some quotes to be straight, setting the global encoding will change all quotes in his document, right? – xport Dec 25 '10 at 17:55
@xport: no, since most quotes are done with `` and '' or ` and ', and fontenc makes whatever arrangements are necessary for these to produce the usual results (which may well amount to \relax). – SamB Dec 25 '10 at 18:00
@(TH, xport) With <code>\usepackage[T1]{fontenc}</code> I was only able to get straight double quotes; single quotes remained curly. And if I use <i>fontspec</i>, double quotes become curly too, —sorry I forgot to say I’m using XeLaTeX. – J̲C̲ Dec 25 '10 at 19:42
@Jetcheng: Yeah, ' are still curly. xport's answer handled that (although I think you want the textcomp package–upquote does additional things). I'm afraid I don't know anything about XeLaTeX though. – TH. Dec 25 '10 at 20:23
@xport: only by typing " will he get any "straight quotes"; I doubt if any variant of cmr actually has a straight ', though Knuth certainly has some designs for not only the conventional backtick (`\') and single quote ('` unless you have a strange font) glyphs, but also a forward tick glyph (which he offers as another possible rendition of ') -- see page 3 of the TeX book, or search for "American keyboards" in texbook.tex -- it's in the last sentence of the second paragraph of Chapter 2. – SamB Dec 26 '10 at 5:36

I had the same question; how to get the apostrophe (U+0027) AKA the neutral, vertical, or straight single quote. I searched thoroughly and virtually all of the ‘solutions’ I found seemed to either have no effect in XeTeX, be overly complicated, and/or make additional undesired changes to the document, font, etc..

I have found one solution that works really well with XeTeX.

Define the apostrophe:


Use it!:

James\apostrophe{}, ‘wasn\apostrophe{}t’, it\apostrophe{}s, “\apostrophe{}tis”.

Using XeTeX, that should render like:

James', ‘wasn't’, it's, “'tis”.

For LyX users out there, I can confirm that this solution also works well in LyX (tested on version 2). Make sure that XeTeX is installed and ToolsReconfigure LyX if you have just installed XeTeX. In DocumentSettingsFonts, check ‘Use non-TeX fonts (via XeTeX/LuaTeX)’. I define the apostrophe in DocumentSettingsLaTeX Preamble. Then use Ctrl+L and enter \apostrophe{}

Btw, I've only recently started using XeTeX (I'm trying it out because I use so much Unicode!). Before the switch I was using the ‘\textquotesingle’ command from the ‘upquote’ package. This stopped working when switching to XeTeX. It wasn't very good though anyway because the apostrophe looked big and ugly; this XeTeX solution is much better and was definitely worth the time digging out!

share|improve this answer
Welcome to TeX.sx! – texenthusiast Apr 7 '13 at 18:02
The only thing I'm missing now is to define ‘'’ as \apostrophe{} so that I don't have to type all that each time. If I want a right single quote (), I just type it; I don't need LaTeX to stupidly try to be clever! Anyway, that's one for another day, I think I'll just settle with defining the apostrophe as ‘’ for now. – James Haigh Apr 7 '13 at 18:08

How about this approach:

% cf. http://ubuntuforums.org/showthread.php?t=1286215

Here are the {\ttfamily"}straight{\ttfamily"} quotes. 

Here are the {\ttfamily\char'15}single{\ttfamily\char'15} quotes.


share|improve this answer
Switching the font is not really the nicest way. – Martin Scharrer May 3 '12 at 13:31
@MartinScharrer Since this user is unregistered and likely not returning, I implemented your suggestion. I suggest you edit out the second half of your comment (and delete this comment of mine). – doncherry Nov 29 '12 at 4:35

The units foot and inch should be abbreviated as ft and in, see e.g. Wikipedia.

For real quotes quoting someone, there is the excellent csquotes package. It has some very nice features for short quotes, blockquotes etc. And it will give gramatically correct quote marks.

If you just want single and double straight quote marks for some other use, you can use the package textcomp which makes available the commands \textquotesingle and \textquotedbl.

The following MWE contains examples for all three cases. As requested by the OP, it is compilable with XeLaTeX and makes use of \usepackage{fontspec}.

According to section 10.1 Ligatures of the fontspec documentation \defaultfontfeatures{Mapping=tex-text} in XeLaTeX is equivalent to \defaultfontfeatures{Ligatures=TeX}. As you noted, this will also alter your quotes. If you want ligatures AND straight quotes, use \defaultfontfeatures{Ligatures=Common} instead.



\defaultfontfeatures{Ligatures=Common} % or Ligatures=TeX
\setmathfont{XITS Math}


%% ==================    
\section{About quotes}
The \enquote{antique} table is \SI{5}{\feet} \SI{6}{\inch} long. \\
The \enquote{modern} table is \SI{168}{\centi\meter} long. \\
Just a \textquotesingle{}single\textquotesingle{} straight quote. \\
And \textquotedbl{}double\textquotedbl{} straight quotes.
share|improve this answer
The majority of this answer is irrelevant to the question as doncherry never suggested he wanted to use straight quotes for feet and inches. – richard Jul 7 at 8:36

Another possible reason why you might have trouble getting straight quotes when using fontspec: the config file. I'm not sure where it lives on other platforms; on linux locate fontspec.cfg will show you where it is. I just discovered that my wife's laptop (TeX Live 2014) had a very different fontspec.cfg than my laptop (TeX Live 2013). Specifically, hers contained the following lines:


This caused documents compiled on her computer to render straight quotes in the source as right-hand double curly quotes, whereas the same document compiled on my computer rendered them as straight quotes. Commenting out the three lines above from her fontspec.cfg fixed the problem. If the fontspec devs read this, I'd be curious to know why that default was added.

share|improve this answer
Because everyone wants curly quotes :) More seriously, because the default in TeX is to provide curly quotes. In fact, because the default for every book ever printed by a serious publisher is to use curly quotes. If you're using straight quotes in a document seriously, you're on your own. (Consider using the csquotes package to customise how it looks if you like the shorthand input syntax.) Adding a new (empty, if you like) fontspec.cfg file in your local texmf tree will prevent fontspec from loading the default one installed by the package. – Will Robertson May 18 '15 at 7:37
thanks @WillRobertson. Is there a way to specify something like Ligatures=None when loading fontspec? Or is editing the system fontspec.cfg (or adding a user-tree file to override it, as you suggest) the only way to override this new default? FYI, my use case is to insert proper Unicode quotation marks in the source file (via an editor snippet) and occasionally needing straight quotes when discussing things like SAMPA or similar ASCII shorthands. – drammock May 18 '15 at 8:05
There's currently no way to override the defaults one a case-by-case basis, which is a bit of an oversight on my behalf. I'll try to add something. But if you want to remove them altogether without a .cfg file, you could also write \defaultfontfeatures[\rmfamily,\sffamily]{} after loading fontspec. – Will Robertson May 18 '15 at 23:54
Great, thanks again @WillRobertson. – drammock May 19 '15 at 3:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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