0

I have following piece of code:

\documentclass{article}
\usepackage{textcomp}
\begin{document}
\begin{equation}
    \Upsilon\textquotesingle^{hr}
\end{equation}
\end{document}

its output, where both single-quotes looks kind of italic:

enter image description here


Instead is it possible to have a straight quote, like this one: Y'

I have applied following question but seems like it does not work inside equation: Straight quotes?

7
  • normally in math you would use a prime, so \Upsilon' Apr 20, 2022 at 14:50
  • @DavidCarlisle did you remember the ^{hr}? So it might be ^{\prime hr}?
    – daleif
    Apr 20, 2022 at 15:05
  • 1
    @daleif Did you remember that ' looks ahead for a following ^ and produces ^{\prime hr} :-) Apr 20, 2022 at 15:53
  • 1
    @DavidCarlisle right
    – daleif
    Apr 20, 2022 at 16:11
  • @alper - \textquotesingle is a text-mode command. You shouldn't use in math mode. Instead, use eitehr ' or, equivalently, ^{\prime}.
    – Mico
    Apr 20, 2022 at 16:46

1 Answer 1

1

If you really want the vertical quote, I suggest a macro using \textup.

enter image description here

\documentclass{article}
\usepackage{textcomp}

\newcommand{\quot}{\textup{\textquotesingle}}

\begin{document}
\begin{equation}
    \Upsilon\quot^{hr}
\end{equation}
\end{document}

Alternatively, you can use \Upsilon^{\quot hr}, which produces

enter image description here

One more option is to define \quot inside a \raisebox:

\newcommand{\quot}{\raisebox{.3ex}{\textup\textquotesingle}{}}

Then \Upsilon\quot^{hr} produces

enter image description here

Of course, you can raise more or less by changing the .3ex.

5
  • Noooooo, try adding \itshape before the equation to see why. \text is never the answer. Perhaps \textup is better.
    – daleif
    Apr 20, 2022 at 15:16
  • @daleif: Fair enough. Edited.
    – Sandy G
    Apr 20, 2022 at 15:26
  • 1
    @daleif: Thanks.
    – Sandy G
    Apr 20, 2022 at 15:50
  • @SandyG When I tried your solution quote shows up shorter and little bit to the right (I believe something on my code prevents its original position) , when I tried to change .3ex it did not made much change : example figure: gist.github.com/avatar-lavventura/…
    – alper
    Apr 20, 2022 at 18:57
  • @alper: That is not the font from your MWE. It's probably not difficult to adjust the spacing but not without knowing the font information.
    – Sandy G
    Apr 20, 2022 at 20:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .