4

What I want to have are single quotes in an equation which are just straight down like 'a'. It seems that the default is somewhat italic like ´a´.

I found lots of example to change the fontstyles inline of a text but they never affected the equation.

\begin{equation} sometext = 'abc' \end{equation}

produces:

sometext = ´abc´ (1)

I need :

sometext = 'abc' (1)

Werner
  • 603,163
jam
  • 153

3 Answers3

3

upquote and textcomp can help here:

enter image description here

\documentclass{article}

\usepackage{upquote,textcomp,amsmath}
\newcommand{\upquote}{\text{\textquotesingle}}

\begin{document}

\begin{equation}
   f(x) = \upquote abc \upquote
\end{equation}

\end{document}
Werner
  • 603,163
3

The character ' is already taken for denoting, in math mode, a prime like in derivatives; in text mode it produces an apostrophe/right quote.

You can define a new math symbol font (if you have room for it}

\documentclass{article}
\usepackage{textcomp} % for TS1
\usepackage{amsmath}

\DeclareSymbolFont{textsymbols}{TS1}{\familydefault}{m}{n}
\SetSymbolFont{textsymbols}{bold}{TS1}{\familydefault}{m}{n}

\DeclareMathSymbol{\ulq}{\mathopen}{textsymbols}{39}
\DeclareMathSymbol{\urq}{\mathclose}{textsymbols}{39}

\begin{document}

\begin{equation}
f(x) = \log\ulq x \urq
\end{equation}

\end{document}

Otherwise a less efficient definition that spares a math group, but requires some more work for respecting \boldmath:

\documentclass{article}
\usepackage{textcomp} % for TS1
\usepackage{amsmath}

\newcommand{\ulq}{\mathopen{\textnormal{\textquotesingle}}}
\newcommand{\urq}{\mathclose{\textnormal{\textquotesingle}}}

\begin{document}

\begin{equation}
f(x) = \log\ulq x \urq
\end{equation}

\end{document}

enter image description here

If you want upright text in your equation:

\begin{equation}
\textnormal{sometext}=\ulq\textnormal{abc}\urq
\end{equation}

but this is a different thing than straight quotes.

egreg
  • 1,121,712
  • what bothers me a bit about latex is the afford it takes to put upright qoutes. – jam Oct 12 '16 at 09:34
  • @jam Straight quotes are a leftover of typewriters, they have no real place in typography; they can have their usage, but I'd recommend using different symbols, if possible: there are \ulcorner and \urcorner (with \usepackage{amssymb}) that might do better. – egreg Oct 12 '16 at 09:41
  • For up-to-date releases of LaTeX, loading textcomp is no longer necessary – egreg Jun 29 '22 at 08:33
1

have you tried this:

\begin{equation} \text{sometext} = \text{'abc'} \end{equation}
Mehdi
  • 143