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?

alper
  • 1,389
  • normally in math you would use a prime, so \Upsilon' – David Carlisle Apr 20 '22 at 14:50
  • @DavidCarlisle did you remember the ^{hr}? So it might be ^{\prime hr}? – daleif Apr 20 '22 at 15:05
  • 1
    @daleif Did you remember that ' looks ahead for a following ^ and produces ^{\prime hr} :-) – David Carlisle Apr 20 '22 at 15:53
  • 1
    @DavidCarlisle right – daleif Apr 20 '22 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 '22 at 16:46
  • can I wrap \textquotesingle inside \text{}? I have tried it but the length of the quote was pretty small @Mico – alper Apr 20 '22 at 17:17
  • @alper - I'm reluctant to provide advice here since I have no understanding of the math formula you are trying to typeset. It appears that you're averse to using ' (or, equivalently, ^{\prime) even though that glyph is much longer than what's produced by either \textquotesingle or \textup{\textquotesingle}. Why? – Mico Apr 20 '22 at 17:20

1 Answers1

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.

Sandy G
  • 42,558
  • Noooooo, try adding \itshape before the equation to see why. \text is never the answer. Perhaps \textup is better. – daleif Apr 20 '22 at 15:16
  • @daleif: Fair enough. Edited. – Sandy G Apr 20 '22 at 15:26
  • 1
    @daleif: Thanks. – Sandy G Apr 20 '22 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: https://gist.github.com/avatar-lavventura/3d0a41a177499a795ab09d0ee83b8563?permalink_comment_id=4139551#gistcomment-4139551 – alper Apr 20 '22 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 '22 at 20:17