I wouldn't use upquote
generally as normally it's better to use the quotes designed for the font you are using. If your keyboard makes typing left and right quotes difficult I would use your editor to change
"text"
to
\mydoubleq{text}
and
'text'
to
\mysingleq{text}
Then you can define those commands as
\def\mydoubleq#1{``#1''}
\def\mysingleq#1{`#1'}
so then you never need to type any of the quote characters (you can cut and paste the definitions from this page so you don't need the keyboard to enter those either).
(Minor update, April 2022: loading the textcomp
package to access the glyph generated by \textquotesingle
is not necessary if the vintage of your TeX distribution is more recent than 2019.)
You write
I ... just [want to] get the occasional straight quote.
The typographically correct marks for "feet" and "inches" are not (single or double, resp.) straight quote marks, but angled quote marks. These may be produced in "normal LaTeX" via $'$
and $''$
, resp.
Addendum, prompted by the OP's comment that interest lies only in "straight" (vertical) quotes. In addition to the "single-quote" command \textquotesingle
(requires loading the textcomp
package -- if the vintage of your TeX distribution is older than 2020), there's also the \textquotedbl
macro, which is available as long as a font encoding other than the original TeX font encoding (aka OT1
) is used.
Here, then, is a quick MWE. Note that the text font is TNR (Times New Roman). If your publisher wants to use a font encoding other than T1
-- which is what I use in the MWE -- that's no problem at all, as long as your publisher's template doesn't impose OT1
...
\documentclass{article}
% access \textquotedbl:
\usepackage[T1]{fontenc}
% access \textquotesingle:
\usepackage{textcomp} % not needed for TeX vintages more recent than 2019)
% load "Times New Roman" text font:
\usepackage{mathptmx} % (note: the "times" package is obsolete!)
\begin{document}
He exclaimed, \textquotedbl Hello,
\textquotesingle Stranger\textquotesingle.\textquotedbl
\end{document}
Second Addendum, to address a late comment by @FlashSheridan, who claims that
\textquotesingle (with or without textcomp) produces a curly closing quote, not the straight quote I need for a short C fragment.
This claim simply cannot be correct in general. As \textquotesingle
is defined in the textcomp
package but not the LaTeX kernel, \textquotesingle
without textcomp
produces an error message, not a curly closing quote. (Update April 2022: This paragraph is irrelevant if your TeX distribution is more recent than 2019.)
The following screenshots (first for Latin Modern, then for Times Roman) demonstrate conclusively that \textquotesingle
does produce a straight vertical quote. In contrast, \textsf{'}
does not produce a straight vertical quote -- unless, of course, some sans-serif font with straight single quote glyphs has been loaded.
Finally, the code to produce the preceding screenshots:
\documentclass[border=1pt,preview]{standalone}
\usepackage[T1]{fontenc}
\usepackage{textcomp} % for \textquotesingle macro
\usepackage{mathptmx} % or: lmodern
\begin{document}
Times Roman
\verb+\textquotesingle+: \textquotesingle
\verb+\textsf{'}+: \textsf{'}
\end{document}
Best Answer
The Inconsolata font doesn't have a straight quote character, as testified by the lines
in your
.log
file. You can work around this by using the cmtt font and doing similarly to whatupquote
does:Maybe the quotes should be raised a bit: