How to get straight quotation marks?












40















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




















  • 2





    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








  • 1





    @xport But your prediction was not correct, … sorry.

    – ȷ̇c
    Dec 25 '10 at 19:48


















40















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




















  • 2





    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








  • 1





    @xport But your prediction was not correct, … sorry.

    – ȷ̇c
    Dec 25 '10 at 19:48
















40












40








40


18






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
















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.







xetex punctuation fontspec






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 29 '12 at 4:27









doncherry

35.3k23137209




35.3k23137209










asked Dec 25 '10 at 17:36









ȷ̇cȷ̇c

85611020




85611020








  • 2





    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








  • 1





    @xport But your prediction was not correct, … sorry.

    – ȷ̇c
    Dec 25 '10 at 19:48
















  • 2





    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








  • 1





    @xport But your prediction was not correct, … sorry.

    – ȷ̇c
    Dec 25 '10 at 19:48










2




2





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







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






1




1





@xport But your prediction was not correct, … sorry.

– ȷ̇c
Dec 25 '10 at 19:48







@xport But your prediction was not correct, … sorry.

– ȷ̇c
Dec 25 '10 at 19:48












9 Answers
9






active

oldest

votes


















27














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:



usepackage{fontspec,xltxtra,xunicode}
defaultfontfeatures{Mapping=tex-text}
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:



usepackage{fontspec,xltxtra,xunicode}
%defaultfontfeatures{Mapping=tex-text}
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 5feet 6inch 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





















  • 5





    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.

    – ȷ̇c
    Feb 18 '11 at 4:11








  • 3





    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








  • 3





    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








  • 5





    Argh—feet and inches glyphs are not straight quotes, they're primes. Use renewcommand{feet}{char"2032relax} renewcommand{inch}{char"2033relax} instead.

    – Will Robertson
    May 18 '15 at 7:38



















21














alt text



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



documentclass{article}
usepackage[T1]{fontenc}
usepackage{upquote}

begin{document}

textquotesingle single straight quotetextquotesingle
and "double straight quote"

vspace{5mm}

`single curly quote' and ``double curly quote''
end{document}





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…)

    – ȷ̇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.

    – ȷ̇c
    Dec 25 '10 at 20:20





















17














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.



documentclass{article}

usepackage[T1]{fontenc}
usepackage{textcomp}

defshowq#1{texttt{string#1}&abc#1xyz\}

begin{document}


begin{tabular}{ll}
multicolumn{2}{c}{T1}\
showqquotedblbase
showqquotesinglbase
showqtextquotedblleft
showqtextquotedblright
showqtextquotedbl
showqtextquoteleft
showqtextquoteright
multicolumn{2}{c}{TS1}\
showqtextquotestraightbase
showqtextquotestraightdblbase
showqtextquotesingle
end{tabular}

end{document}


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






  • 1





    @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



















12














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



documentclass{article}
usepackage[T1]{fontenc}
begin{document}
"foo"
end{document}





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.

    – ȷ̇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



















6














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:



newcommand{apostrophe}{XeTeXglyphXeTeXcharglyph"0027relax}


Use it!:



Jamesapostrophe{}, ‘wasnapostrophe{}t’, itapostrophe{}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



















3














How about this approach:



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

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

Here are the {ttfamilychar'15}single{ttfamilychar'15} quotes.


output






share|improve this answer





















  • 3





    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



















1














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.



documentclass{article}

usepackage{textcomp}
usepackage{siunitx}
DeclareSIUnitinch{in}
DeclareSIUnitfeet{ft}

usepackage{polyglossia}
setmainlanguage[variant=american]{english}
usepackage{fontspec}
defaultfontfeatures{Ligatures=Common} % or Ligatures=TeX
setmainfont{XITS}
usepackage{unicode-math}
setmathfont{XITS Math}

usepackage[english=american]{csquotes}

%% ==================
begin{document}
section{About quotes}
The enquote{antique} table is SI{5}{feet} SI{6}{inch} long. \
The enquote{modern} table is SI{168}{centimeter} long. \
Just a textquotesingle{}singletextquotesingle{} straight quote. \
And textquotedbl{}doubletextquotedbl{} straight quotes.
end{document}





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 '16 at 8:36



















0














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:



defaultfontfeatures
[rmfamily,sffamily]
{Ligatures=TeX}


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



















0














To write a straight quote, add usepackage{textcomp} to the preamble. Then, type textquotesingle and for double quotes type textquotesingle twice in your document






share|improve this answer
























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "85"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f7735%2fhow-to-get-straight-quotation-marks%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    9 Answers
    9






    active

    oldest

    votes








    9 Answers
    9






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    27














    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:



    usepackage{fontspec,xltxtra,xunicode}
    defaultfontfeatures{Mapping=tex-text}
    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:



    usepackage{fontspec,xltxtra,xunicode}
    %defaultfontfeatures{Mapping=tex-text}
    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 5feet 6inch 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





















    • 5





      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.

      – ȷ̇c
      Feb 18 '11 at 4:11








    • 3





      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








    • 3





      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








    • 5





      Argh—feet and inches glyphs are not straight quotes, they're primes. Use renewcommand{feet}{char"2032relax} renewcommand{inch}{char"2033relax} instead.

      – Will Robertson
      May 18 '15 at 7:38
















    27














    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:



    usepackage{fontspec,xltxtra,xunicode}
    defaultfontfeatures{Mapping=tex-text}
    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:



    usepackage{fontspec,xltxtra,xunicode}
    %defaultfontfeatures{Mapping=tex-text}
    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 5feet 6inch 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





















    • 5





      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.

      – ȷ̇c
      Feb 18 '11 at 4:11








    • 3





      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








    • 3





      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








    • 5





      Argh—feet and inches glyphs are not straight quotes, they're primes. Use renewcommand{feet}{char"2032relax} renewcommand{inch}{char"2033relax} instead.

      – Will Robertson
      May 18 '15 at 7:38














    27












    27








    27







    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:



    usepackage{fontspec,xltxtra,xunicode}
    defaultfontfeatures{Mapping=tex-text}
    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:



    usepackage{fontspec,xltxtra,xunicode}
    %defaultfontfeatures{Mapping=tex-text}
    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 5feet 6inch 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















    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:



    usepackage{fontspec,xltxtra,xunicode}
    defaultfontfeatures{Mapping=tex-text}
    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:



    usepackage{fontspec,xltxtra,xunicode}
    %defaultfontfeatures{Mapping=tex-text}
    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 5feet 6inch 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














    share|improve this answer



    share|improve this answer








    edited May 18 '15 at 7:39









    Will Robertson

    59.1k13157202




    59.1k13157202










    answered Feb 18 '11 at 2:00









    MichaelMichael

    28624




    28624








    • 5





      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.

      – ȷ̇c
      Feb 18 '11 at 4:11








    • 3





      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








    • 3





      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








    • 5





      Argh—feet and inches glyphs are not straight quotes, they're primes. Use renewcommand{feet}{char"2032relax} renewcommand{inch}{char"2033relax} instead.

      – Will Robertson
      May 18 '15 at 7:38














    • 5





      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.

      – ȷ̇c
      Feb 18 '11 at 4:11








    • 3





      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








    • 3





      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








    • 5





      Argh—feet and inches glyphs are not straight quotes, they're primes. Use renewcommand{feet}{char"2032relax} renewcommand{inch}{char"2033relax} instead.

      – Will Robertson
      May 18 '15 at 7:38








    5




    5





    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.

    – ȷ̇c
    Feb 18 '11 at 4:11







    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.

    – ȷ̇c
    Feb 18 '11 at 4:11






    3




    3





    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







    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






    3




    3





    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







    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






    5




    5





    Argh—feet and inches glyphs are not straight quotes, they're primes. Use renewcommand{feet}{char"2032relax} renewcommand{inch}{char"2033relax} instead.

    – Will Robertson
    May 18 '15 at 7:38





    Argh—feet and inches glyphs are not straight quotes, they're primes. Use renewcommand{feet}{char"2032relax} renewcommand{inch}{char"2033relax} instead.

    – Will Robertson
    May 18 '15 at 7:38











    21














    alt text



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



    documentclass{article}
    usepackage[T1]{fontenc}
    usepackage{upquote}

    begin{document}

    textquotesingle single straight quotetextquotesingle
    and "double straight quote"

    vspace{5mm}

    `single curly quote' and ``double curly quote''
    end{document}





    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…)

      – ȷ̇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.

      – ȷ̇c
      Dec 25 '10 at 20:20


















    21














    alt text



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



    documentclass{article}
    usepackage[T1]{fontenc}
    usepackage{upquote}

    begin{document}

    textquotesingle single straight quotetextquotesingle
    and "double straight quote"

    vspace{5mm}

    `single curly quote' and ``double curly quote''
    end{document}





    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…)

      – ȷ̇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.

      – ȷ̇c
      Dec 25 '10 at 20:20
















    21












    21








    21







    alt text



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



    documentclass{article}
    usepackage[T1]{fontenc}
    usepackage{upquote}

    begin{document}

    textquotesingle single straight quotetextquotesingle
    and "double straight quote"

    vspace{5mm}

    `single curly quote' and ``double curly quote''
    end{document}





    share|improve this answer















    alt text



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



    documentclass{article}
    usepackage[T1]{fontenc}
    usepackage{upquote}

    begin{document}

    textquotesingle single straight quotetextquotesingle
    and "double straight quote"

    vspace{5mm}

    `single curly quote' and ``double curly quote''
    end{document}






    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Dec 25 '10 at 18:29

























    answered Dec 25 '10 at 17:52









    xportxport

    22.2k30140263




    22.2k30140263













    • 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…)

      – ȷ̇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.

      – ȷ̇c
      Dec 25 '10 at 20:20





















    • 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…)

      – ȷ̇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.

      – ȷ̇c
      Dec 25 '10 at 20:20



















    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…)

    – ȷ̇c
    Dec 25 '10 at 19:43





    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…)

    – ȷ̇c
    Dec 25 '10 at 19:43













    Use textquotesingle provided by usepackage{upquote}, and what happens?

    – xport
    Dec 25 '10 at 19:52







    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.

    – ȷ̇c
    Dec 25 '10 at 20:20







    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.

    – ȷ̇c
    Dec 25 '10 at 20:20













    17














    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.



    documentclass{article}

    usepackage[T1]{fontenc}
    usepackage{textcomp}

    defshowq#1{texttt{string#1}&abc#1xyz\}

    begin{document}


    begin{tabular}{ll}
    multicolumn{2}{c}{T1}\
    showqquotedblbase
    showqquotesinglbase
    showqtextquotedblleft
    showqtextquotedblright
    showqtextquotedbl
    showqtextquoteleft
    showqtextquoteright
    multicolumn{2}{c}{TS1}\
    showqtextquotestraightbase
    showqtextquotestraightdblbase
    showqtextquotesingle
    end{tabular}

    end{document}


    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






    • 1





      @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
















    17














    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.



    documentclass{article}

    usepackage[T1]{fontenc}
    usepackage{textcomp}

    defshowq#1{texttt{string#1}&abc#1xyz\}

    begin{document}


    begin{tabular}{ll}
    multicolumn{2}{c}{T1}\
    showqquotedblbase
    showqquotesinglbase
    showqtextquotedblleft
    showqtextquotedblright
    showqtextquotedbl
    showqtextquoteleft
    showqtextquoteright
    multicolumn{2}{c}{TS1}\
    showqtextquotestraightbase
    showqtextquotestraightdblbase
    showqtextquotesingle
    end{tabular}

    end{document}


    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






    • 1





      @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














    17












    17








    17







    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.



    documentclass{article}

    usepackage[T1]{fontenc}
    usepackage{textcomp}

    defshowq#1{texttt{string#1}&abc#1xyz\}

    begin{document}


    begin{tabular}{ll}
    multicolumn{2}{c}{T1}\
    showqquotedblbase
    showqquotesinglbase
    showqtextquotedblleft
    showqtextquotedblright
    showqtextquotedbl
    showqtextquoteleft
    showqtextquoteright
    multicolumn{2}{c}{TS1}\
    showqtextquotestraightbase
    showqtextquotestraightdblbase
    showqtextquotesingle
    end{tabular}

    end{document}


    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















    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.



    documentclass{article}

    usepackage[T1]{fontenc}
    usepackage{textcomp}

    defshowq#1{texttt{string#1}&abc#1xyz\}

    begin{document}


    begin{tabular}{ll}
    multicolumn{2}{c}{T1}\
    showqquotedblbase
    showqquotesinglbase
    showqtextquotedblleft
    showqtextquotedblright
    showqtextquotedbl
    showqtextquoteleft
    showqtextquoteright
    multicolumn{2}{c}{TS1}\
    showqtextquotestraightbase
    showqtextquotestraightdblbase
    showqtextquotesingle
    end{tabular}

    end{document}


    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














    share|improve this answer



    share|improve this answer








    edited Jun 2 '17 at 21:28

























    answered May 3 '12 at 13:08









    David CarlisleDavid Carlisle

    497k4111441891




    497k4111441891













    • 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






    • 1





      @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



















    • 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






    • 1





      @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

















    I can produce a straight apostrophe with textquotesingle without either TS1 or T1, using the old OT1.

    – Sverre
    Aug 28 '13 at 18:05





    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





    @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





    You're right. It's apparently defined by the libertine package.

    – Sverre
    Aug 28 '13 at 18:23




    1




    1





    @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





    @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











    12














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



    documentclass{article}
    usepackage[T1]{fontenc}
    begin{document}
    "foo"
    end{document}





    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.

      – ȷ̇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
















    12














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



    documentclass{article}
    usepackage[T1]{fontenc}
    begin{document}
    "foo"
    end{document}





    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.

      – ȷ̇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














    12












    12








    12







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



    documentclass{article}
    usepackage[T1]{fontenc}
    begin{document}
    "foo"
    end{document}





    share|improve this answer













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



    documentclass{article}
    usepackage[T1]{fontenc}
    begin{document}
    "foo"
    end{document}






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Dec 25 '10 at 17:51









    TH.TH.

    48.1k10131198




    48.1k10131198













    • @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.

      – ȷ̇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



















    • @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.

      – ȷ̇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

















    @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





    @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





    @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.

    – ȷ̇c
    Dec 25 '10 at 19:42





    @(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.

    – ȷ̇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





    @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





    @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











    6














    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:



    newcommand{apostrophe}{XeTeXglyphXeTeXcharglyph"0027relax}


    Use it!:



    Jamesapostrophe{}, ‘wasnapostrophe{}t’, itapostrophe{}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
















    6














    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:



    newcommand{apostrophe}{XeTeXglyphXeTeXcharglyph"0027relax}


    Use it!:



    Jamesapostrophe{}, ‘wasnapostrophe{}t’, itapostrophe{}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














    6












    6








    6







    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:



    newcommand{apostrophe}{XeTeXglyphXeTeXcharglyph"0027relax}


    Use it!:



    Jamesapostrophe{}, ‘wasnapostrophe{}t’, itapostrophe{}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















    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:



    newcommand{apostrophe}{XeTeXglyphXeTeXcharglyph"0027relax}


    Use it!:



    Jamesapostrophe{}, ‘wasnapostrophe{}t’, itapostrophe{}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














    share|improve this answer



    share|improve this answer








    edited Apr 13 '17 at 12:34









    Community

    1




    1










    answered Apr 7 '13 at 17:58









    James HaighJames Haigh

    16111




    16111













    • 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



















    • 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

















    Welcome to TeX.sx!

    – texenthusiast
    Apr 7 '13 at 18:02





    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





    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











    3














    How about this approach:



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

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

    Here are the {ttfamilychar'15}single{ttfamilychar'15} quotes.


    output






    share|improve this answer





















    • 3





      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
















    3














    How about this approach:



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

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

    Here are the {ttfamilychar'15}single{ttfamilychar'15} quotes.


    output






    share|improve this answer





















    • 3





      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














    3












    3








    3







    How about this approach:



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

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

    Here are the {ttfamilychar'15}single{ttfamilychar'15} quotes.


    output






    share|improve this answer















    How about this approach:



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

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

    Here are the {ttfamilychar'15}single{ttfamilychar'15} quotes.


    output







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Nov 29 '12 at 4:34









    doncherry

    35.3k23137209




    35.3k23137209










    answered Apr 7 '11 at 12:32







    user4737















    • 3





      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














    • 3





      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








    3




    3





    Switching the font is not really the nicest way.

    – Martin Scharrer
    May 3 '12 at 13:31







    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





    @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











    1














    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.



    documentclass{article}

    usepackage{textcomp}
    usepackage{siunitx}
    DeclareSIUnitinch{in}
    DeclareSIUnitfeet{ft}

    usepackage{polyglossia}
    setmainlanguage[variant=american]{english}
    usepackage{fontspec}
    defaultfontfeatures{Ligatures=Common} % or Ligatures=TeX
    setmainfont{XITS}
    usepackage{unicode-math}
    setmathfont{XITS Math}

    usepackage[english=american]{csquotes}

    %% ==================
    begin{document}
    section{About quotes}
    The enquote{antique} table is SI{5}{feet} SI{6}{inch} long. \
    The enquote{modern} table is SI{168}{centimeter} long. \
    Just a textquotesingle{}singletextquotesingle{} straight quote. \
    And textquotedbl{}doubletextquotedbl{} straight quotes.
    end{document}





    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 '16 at 8:36
















    1














    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.



    documentclass{article}

    usepackage{textcomp}
    usepackage{siunitx}
    DeclareSIUnitinch{in}
    DeclareSIUnitfeet{ft}

    usepackage{polyglossia}
    setmainlanguage[variant=american]{english}
    usepackage{fontspec}
    defaultfontfeatures{Ligatures=Common} % or Ligatures=TeX
    setmainfont{XITS}
    usepackage{unicode-math}
    setmathfont{XITS Math}

    usepackage[english=american]{csquotes}

    %% ==================
    begin{document}
    section{About quotes}
    The enquote{antique} table is SI{5}{feet} SI{6}{inch} long. \
    The enquote{modern} table is SI{168}{centimeter} long. \
    Just a textquotesingle{}singletextquotesingle{} straight quote. \
    And textquotedbl{}doubletextquotedbl{} straight quotes.
    end{document}





    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 '16 at 8:36














    1












    1








    1







    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.



    documentclass{article}

    usepackage{textcomp}
    usepackage{siunitx}
    DeclareSIUnitinch{in}
    DeclareSIUnitfeet{ft}

    usepackage{polyglossia}
    setmainlanguage[variant=american]{english}
    usepackage{fontspec}
    defaultfontfeatures{Ligatures=Common} % or Ligatures=TeX
    setmainfont{XITS}
    usepackage{unicode-math}
    setmathfont{XITS Math}

    usepackage[english=american]{csquotes}

    %% ==================
    begin{document}
    section{About quotes}
    The enquote{antique} table is SI{5}{feet} SI{6}{inch} long. \
    The enquote{modern} table is SI{168}{centimeter} long. \
    Just a textquotesingle{}singletextquotesingle{} straight quote. \
    And textquotedbl{}doubletextquotedbl{} straight quotes.
    end{document}





    share|improve this answer















    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.



    documentclass{article}

    usepackage{textcomp}
    usepackage{siunitx}
    DeclareSIUnitinch{in}
    DeclareSIUnitfeet{ft}

    usepackage{polyglossia}
    setmainlanguage[variant=american]{english}
    usepackage{fontspec}
    defaultfontfeatures{Ligatures=Common} % or Ligatures=TeX
    setmainfont{XITS}
    usepackage{unicode-math}
    setmathfont{XITS Math}

    usepackage[english=american]{csquotes}

    %% ==================
    begin{document}
    section{About quotes}
    The enquote{antique} table is SI{5}{feet} SI{6}{inch} long. \
    The enquote{modern} table is SI{168}{centimeter} long. \
    Just a textquotesingle{}singletextquotesingle{} straight quote. \
    And textquotedbl{}doubletextquotedbl{} straight quotes.
    end{document}






    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Jun 15 '17 at 19:04









    David Carlisle

    497k4111441891




    497k4111441891










    answered May 3 '12 at 14:30









    matthmatth

    9,34344268




    9,34344268













    • 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 '16 at 8:36



















    • 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 '16 at 8:36

















    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 '16 at 8:36





    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 '16 at 8:36











    0














    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:



    defaultfontfeatures
    [rmfamily,sffamily]
    {Ligatures=TeX}


    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
















    0














    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:



    defaultfontfeatures
    [rmfamily,sffamily]
    {Ligatures=TeX}


    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














    0












    0








    0







    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:



    defaultfontfeatures
    [rmfamily,sffamily]
    {Ligatures=TeX}


    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















    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:



    defaultfontfeatures
    [rmfamily,sffamily]
    {Ligatures=TeX}


    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














    share|improve this answer



    share|improve this answer








    edited May 19 '15 at 3:57

























    answered May 18 '15 at 3:35









    drammockdrammock

    140111




    140111













    • 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



















    • 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

















    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





    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





    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





    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











    0














    To write a straight quote, add usepackage{textcomp} to the preamble. Then, type textquotesingle and for double quotes type textquotesingle twice in your document






    share|improve this answer




























      0














      To write a straight quote, add usepackage{textcomp} to the preamble. Then, type textquotesingle and for double quotes type textquotesingle twice in your document






      share|improve this answer


























        0












        0








        0







        To write a straight quote, add usepackage{textcomp} to the preamble. Then, type textquotesingle and for double quotes type textquotesingle twice in your document






        share|improve this answer













        To write a straight quote, add usepackage{textcomp} to the preamble. Then, type textquotesingle and for double quotes type textquotesingle twice in your document







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 24 at 8:50









        user169363user169363

        61




        61






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f7735%2fhow-to-get-straight-quotation-marks%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to change which sound is reproduced for terminal bell?

            Can I use Tabulator js library in my java Spring + Thymeleaf project?

            Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents