将行距调整为带有下划线符号的原始格式

将行距调整为带有下划线符号的原始格式

我已将 Latex 文档的行距设置为 1.5。在文本的某些部分,我使用带有“下划线”的数学符号。与原始定义的格式相比,这增加了行距。有没有办法重新缩放和规范符号以具有相似的间距?

带下划线:

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

无下划线:

The system of equations delivers linear ...

PDF 中的结果: 在此处输入图片描述

答案1

我会将您的输入更改为如下所示:

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

\smash为了让参数的高度为零,这样 LaTeX 在计算行距时就不会考虑它(它永远不会允许文本重叠!)。 是\mathclap为了让每个系数周围没有由于下标宽度而产生的过多空白。这或多或少类似于\smash,但在水平方向上。最后,我会\mathrm在下标中使用直立字体:不要对多字母单词使用斜体数学字体!

为了方便起见,将所有这些放在一个命令中:

在此处输入图片描述

xparse(对于\NewDocumentCommand)和mathtools(对于\mathclap)是必需的。

\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}

相关内容