5

Summary: Unhappy with spacing between 'J' and 'a' in my equation

The paper I am looking at has the Jakob number as follows: Desired Jakob number

I try to repeat the same formula using

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{equation}
        Ja = \text{Ja} = \frac{c_{pl} \left( T_w - T_{sat} \right)}{h_{fg}}
\end{equation}
\end{document}

but my equation ends up looking like: Current Jakob Number

and after adding suggested solutions:

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{equation}
    \mathit{Ja} = Ja = \mathrm{Ja} = \text{Ja} = \frac{c_{pl} \left( T_w - T_{sat} \right)}{h_{fg}}
\end{equation}
\end{document}

Updated Current Jakob Number

Take a look at the Jakob number, the 'Ja' part between the two pictures. What should I do to achieve the first Jakob number letter spacing, without having to change the font?

8
  • 2
    multi letter identifiers should use \mathit{Ja} or \mathrm{ja} \mathrm{sat} (not \text) adjacent letters are otherwised spaced so they do not look like a word, but like a product of 1-letter variables. Commented Aug 10 at 15:14
  • 2
    but you should show a full example you mention some font packages "in case it is useful" but the spacing is entirely dependent on the fonts used. Your initial image is using completely different fonts, look at the letter shapes. Commented Aug 10 at 15:16
  • Off-topic: The amssymb package loads the amsfonts package automatically. Hence, no need for the \usepackage{amsfonts} directive.
    – Mico
    Commented Aug 10 at 15:21
  • 1
    @simply_a_student basically no, there is no space added by tex, it is simply part of the font design which bits are black and which bits are white. Commented Aug 10 at 15:43
  • 1
    changing fonts is easy: for example add \usepackage{newtx} but you should provide an example like the code in Mico's example a complete document that produces the output shown, and without all the unrelated packages. Commented Aug 10 at 15:45

2 Answers 2

7

You want to use \mathit{Ja}, so text italic rather than math italic is used. The same treatment should probably be done for “pl”, “sat” and “fg”, which don't seem like product of variables.

\documentclass[twocolumn]{article} % twocolumn just for a smaller picture
\usepackage{amsmath}

\newcommand{\Jakob}{\mathit{Ja}}
\newcommand{\tsub}[1]{\mathit{#1}}% for textual subscripts

\begin{document}

\subsection*{Bad formula}
\begin{equation}
Ja = \frac{c_{pl} \left( T_w - T_{sat} \right)}{h_{fg}}
\end{equation}

\subsection*{Good formula}

\begin{equation}
\Jakob = \frac{c_{\tsub{pl}}( T_w - T_{\tsub{sat}} )}{h_{\tsub{fg}}}
\end{equation}

\end{document}

You can compare. Note that \left and \right only add unwanted space.

output

Using \tsub for those subscripts is important, because you might be told (or decide yourself) that such subscripts should be upright and changing the definition would be enough. With

\newcommand{\tsub}[1]{\mathrm{#1}}

the output would become

upright

Kerning

If you really want to push the “a” nearer to the “J”, use \mspace and not \kern.

With \mspace:

\documentclass[twocolumn]{article}
\usepackage{amsmath}

\newcommand{\Jakob}{\mathit{J\mspace{-4mu}a}}
\newcommand{\tsub}[1]{\mathit{#1}}% for textual subscripts

\begin{document}

\section*{Jakob Number $\Jakob$}

\begin{equation}
\Jakob = \frac{c_{\tsub{pl}}( T_w - T_{\tsub{sat}} )}{h_{\tsub{fg}}}
\end{equation}

\end{document}

mspace

With \kern:

\documentclass[twocolumn]{article}
\usepackage{amsmath}

\newcommand{\Jakob}{\mathit{J\kern-2pt a}}
\newcommand{\tsub}[1]{\mathit{#1}}% for textual subscripts

\begin{document}

\section*{Jakob Number $\Jakob$}

\begin{equation}
\Jakob = \frac{c_{\tsub{pl}}( T_w - T_{\tsub{sat}} )}{h_{\tsub{fg}}}
\end{equation}

\end{document}

with kern

You can easily see that the kerning in the section title is wrong.

Font choice

The picture seems to use Cambria and here an additional kerning doesn't seem necessary.

\documentclass[twocolumn]{article}
\usepackage{amsmath}
\usepackage{unicode-math}

\setmainfont{Cambria}
\setmathfont{Cambria Math}

\newcommand{\Jakob}{\mathit{Ja}}
\newcommand{\tsub}[1]{\mathit{#1}}% for textual subscripts

\begin{document}

\subsection*{Bad formula}
\begin{equation}
Ja = \frac{c_{pl} \left( T_w - T_{sat} \right)}{h_{fg}}
\end{equation}

\subsection*{Good formula}

\begin{equation}
\Jakob = \frac{c_{\tsub{pl}}( T_w - T_{\tsub{sat}} )}{h_{\tsub{fg}}}
\end{equation}

\end{document}

Compile with LuaLaTeX

Cambria

2
  • A brilliant answer, thank you! Will definitely make use of \tsub! However, the \newcommand{\Ja}{\mathit{J\kern-2pt a}} solution by Mico ended up solving my problem, as even with the solutions proposed I was still not satisfied with the spacing, hence why that is the accepted solution. Commented Aug 10 at 16:10
  • 1
    @simply_a_student In my opinion Mico's answer is wrong. The negative kern should be in terms of mu, not of pt. See the edited answer.
    – egreg
    Commented Aug 10 at 16:32
6

If not given any additional information, TeX typesets $Ja$ as the product of two distinct variables named J and a.

If that's not your intention -- say, because Ja is supposed to be a variable name in its own right (short for "Jakob number", I gather) -- and assuming that you're ok with using italic lettering to denote variable names, I suggest you write $\mathit{Ja}$, so as to achieve a slightly tighter spacing, or kerning, between the letters J and a.

A further thought: If you're not quite satisfied with the slightly-tighter kerning delivered by $\mathit{Ja}$, I suggest you create your own macro to impose your preferred kerning amount. E.g., you could define

\newcommand{\Ja}{\mathit{J\mkern-3.5mu a}}

in the preamble and then write $\Ja$ in the body of the document. (I suppose that any kerning amount between -3mu and -4mu will look ok.)

enter image description here

\documentclass{article}
\newcommand{\Ja}{\mathit{J\kern-3.5mu a}} % use in math mode only

\begin{document}
$Ja$ vs.\ $\mathit{Ja}$ vs.\ $\Ja$
\end{document}
5
  • 1
    @simply_a_student - If you're not satisfied with the kerning employed by $\mathit{Ja}$, I suggest you create your own macro to impose your desired kerning. E.g., you could define \newcommand{\Ja}{\mathit{J\kern-2pt a}} in the preamble and then write $\Ja$ in the body of the document. Give it a try.
    – Mico
    Commented Aug 10 at 15:33
  • That works perfectly, exactly what I needed, thank you! Commented Aug 10 at 15:38
  • No, -2pt is definitely wrong.
    – egreg
    Commented Aug 10 at 16:21
  • 1
    @Mico See my answer
    – egreg
    Commented Aug 10 at 17:20
  • 1
    @Mico To be more precise, if you use em units, they'd refer to the text font that's current outside the formula and not on the italic font. So in a section title you'd get the em from boldface.
    – egreg
    Commented Aug 10 at 17:48

You must log in to answer this question.

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