What would the best way to typeset HI to designate molecular gas as in the title of this article, with a capital H and a slightly smaller numeral I ? I am using the scrbook class.

I tried to define

\newcommand{\HI}{H {\uppercase{\romannumeral 1}} }

but this results in H i, with a lowercase i.

I also tried


but this doesn't behave properly when I use it in \section{}, resulting in "H i" rather than "H I".

I also haven't found anything like this in chemmacros, which is more geared towards chemists.

This is a standard way of writing molecules in astrophysics, so I'm surprised there isn't a package that does this easily.

  • it's a tex generated file on arxiv, can't you just download the tex source and see, there is no need to use \uppercase and \romannumeral they would just generate a normal I anyway so you could simply use HI Mar 8, 2019 at 9:24
  • 4
    perhaps \textsc{Hi} Mar 8, 2019 at 9:29
  • 1
    I would not recommand the way it seems in this article... The distance between H and I makes it difficult in reading as one "thing" and possibly the author would try to use another way of defining a command in future edition of this article. @DavidCarlisle's above comment would give a better result I suppose.
    – koleygr
    Mar 8, 2019 at 9:42
  • 2
    The article you linked to uses H\,{\footnotesize I} - however I don't think this is the best way to go (you can download the tex source of the article from arxiv.org/format/1608.02601) Mar 11, 2019 at 10:55
  • 2
    Personally I would use the \ion macro from the "Astronomy & Astrophysics" journal class: fits.gsfc.nasa.gov/standard30/aa.cls Mar 11, 2019 at 12:55

3 Answers 3


Use the size of subscripts linked to the current font size.


  \mbox{H\check@mathfonts\fontsize\sf@size\z@\selectfont I}%

\textheight=3cm % just to shorten the image


\section{About \HI}

Here we talk about \HI.\footnote{Yes, about \HI.}


enter image description here

The kernel command \check@mathfonts computes \sf@size and \ssf@size starting from the current font size, either with the parameters stored with \DeclareMathSizes or with a heuristic otherwise.

  • The spacing is off when HI is in the middle of a sentence. \HI is cool ends up in the document as HIis cool.
    – usernumber
    Jun 5, 2019 at 17:27
  • @usernumber That's a well known fact; just add {} at the end: \HI{}. It is discussed in tex.stackexchange.com/q/31091/4427, but adding {} is the most effective way, notwithstanding what others suggest.
    – egreg
    Jun 5, 2019 at 17:29

Adjust 1.2ex to suit.


\section{This is \HI}

And in text: \HI{} and \LARGE \HI

enter image description here

Because scalerel operates, by default, in math mode, the $I$ is actually an escape out of math mode. If that is too confusing, you could always just operate in math mode as: \newcommand\HI{H\protect\scaleto{\textrm{I}}{1.2ex}}

If you wanted a version without packages, you could do this, but it requires a separate macro for bold style:


\section{This is \HIbold}

And in text: \HI{} and \LARGE \HI

enter image description here


Another way to do it is the way it is implemented by the Astronomy & Astrophysics class.

Add this declaration to the header :


Then in the body of the document, use


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.