1

I have set the line spacing of my Latex document to 1.5. In some part of my text, I use mathematical symbols with "underset". This has increased the line spacing compared to the original defined format. Is there any way to rescale and normalize the symbol to have similar spacing?

Line with underset:

Where $h_{\underset{top}{Conv}}$ is the heat transfer ...

Line without underset:

The system of equations delivers linear ...

Results in the PDF: enter image description here

  • 3
    TeX does that to avoid text overlapping. If you don't want to increase line spacing you could try $h_{\smash{\underset{top}{Conv}}}$, but then text may overlap. It would be better a notation that doesn't require inline stacking like that... – LaTeXer Oct 15 '19 at 13:24
  • Thank you very much. It helped actually. The text did not overlap as well. Could you please write this as an answer that I could confirm it? @LaTeXer – Hamed Oct 15 '19 at 14:01
3

I would change your input to look something like:

Where $h_{\underset{\smash{\mathclap{\mathrm{top-grd}}}}{\mathrm{Rad}}}$ is the heat transfer ...

The \smash is there to make the argument have zero height, so that LaTeX does not take it into account when computing line spacing (it will never willingly allow text overlap!). The \mathclap is there to ensure that there is no excessive white space around each coefficient because of the width of the subscript. This is more or less like \smash, but on the horizontal direction. Finally, I'd use \mathrm to have upright font in the subscript: don't use italic math font for multi-letter words!

Putting all of that in a command, for convenience:

enter image description here

xparse (for \NewDocumentCommand) and mathtools (for \mathclap) are required.

\documentclass{article}
\usepackage[margin=3.3cm]{geometry}
\usepackage{amsmath}
\usepackage{setspace}
% The command:
\usepackage{xparse}
\usepackage{mathtools}
\NewDocumentCommand\hcoef{mmo}{%
    \ensuremath{%
      h_{\,\underset{%
          {\smash{\mathclap{\mathrm{#2\IfValueT{#3}{-#3}}}}}}%
          {\mathrm{#1}}%
        }%
    }%
  }
\begin{document}
\onehalfspacing
Where \hcoef{Conv}{top} is the heat transfer coefficient of the top of the stack (glass), \hcoef{Conv}{btm} is the
heat transfer coefficient of the bottom surface of the stack (Backsheet), \hcoef{Rad}{top}[sky] is the heat transfer
coefficient for radiation from the top surface toward the sky, \hcoef{Rad}{btm}[sky] is the heat transfer coefficient for
radiation from the bottom surface toward the sky, \hcoef{Rad}{top}[grd] is the heat transfer coefficient for radiation
from the top surface toward the ground and \hcoef{Rad}{btm}[grd] is the heat transfer coefficient for radiation from
the bottom surface toward the ground.

The system of equations delivers linear equations with a quantity depending on the desired quantity
of temperature nodes which can be solved with simple mathematical approaches and delivers
the temperature ay any nodes.
\end{document}
| improve this answer | |

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.