0

I need to write a formula where the following symbol should appear as a subscript:

enter image description here

which is provided by \usepackage{wasysym}.

Here a MWE

\documentclass{article}
\usepackage{mathtools}
\usepackage{pifont} 
\usepackage{bbding}
\usepackage{wasysym}

\begin{document}


Some random text $g_{\mbox{\leftmoon}}=1.623\,[m/s^2]$ and some more random text.
 

\end{document}

As you can see, the output is not the one I would get. How can it be solved?

9
  • 1
    This works fine for me. I think that \mbox actually leaves math mode and enters LR mode so you may need to add $ inside the \mbox argument, like \mbox{$\leftmoon$}, although \leftmoon works in both math and text mode. On an unrelated note look into the siunitx package for typesetting units.
    – Willoughby
    Jun 28, 2021 at 17:15
  • 1
    What about $g_{\scalebox{0.6}{\leftmoon}}=1.623\,[m/s^2]$ ?
    – koleygr
    Jun 28, 2021 at 17:16
  • 2
    Use _{\text{\leftmoon}} in the place of \mbox.
    – Bernard
    Jun 28, 2021 at 17:16
  • Thank you you all. Each different solution works fine. Just one more question: since I have activated \usepackage{wasysym}, in some part of my document I get the following warning: Font shape U/wasy/b/n in size <9> not available - Font shape U/wasy/m/n tried instead. What does it mean? Why has it appeared only now?
    – Catarella
    Jun 28, 2021 at 17:22
  • It means there's no bold version of the font in size 9pt, so it uses the normal weight.
    – Bernard
    Jun 28, 2021 at 17:25

1 Answer 1

3

Use \text, but it's better to define a proper command. The \normalfont command is meant to avoid spurious warnings for missing fonts.

\documentclass{article}
\usepackage{amsmath}
\usepackage{wasysym}
\usepackage{siunitx}

\NewDocumentCommand{\mathleftmoon}{}{{\text{\normalfont\leftmoon}}}

\begin{document}

Some random text $g_{\mathleftmoon}=\SI{1.623}{\meter\per\square\second}$
and some more random text.

$\mathleftmoon$

\end{document}

enter image description here

Note that 1.623\,[m/s^2] is wrong under at least two respects:

  1. units should not be in brackets;
  2. unit symbols should be upright.

Use siunitx and be happier.

4
  • Thank you very much @egreg, before accepting your answer, I just want to inform you that warnings about Font shape [...] not available still persist, even after using your \NewDocumentCommand. Have you any idea why these kind of warnings do not go away?
    – Catarella
    Jun 28, 2021 at 21:31
  • @Catarella What shape is not available?
    – egreg
    Jun 28, 2021 at 22:01
  • Font shape U/wasy/b/n' in size <9> not available(Font) -- Font shape U/wasy/m/n' tried instead. The same message is repeated for size <5>,<6> and <8>. in other parts of the text. This happened since I've activated \usepackage{wasysym}, before doing it, I didn't received any warnings about those shapes. It seems to be linked to \chi and \Chi when inserted in \boldsymbol or \footnote environments. @egreg
    – Catarella
    Jun 28, 2021 at 22:11
  • 1
    @Catarella I get no such warning, so it must depend on other symbols and other situations. Impossible to debug without information. Anyway, they are harmless warnings.
    – egreg
    Jun 28, 2021 at 22:17

You must log in to answer this question.

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