Quarto中XeLaTeX渲染PDF时数学公式间文本居中问题
解决Quarto公式中“and”文本居中问题
问题出在你使用的aligned环境默认是左对齐模式,要实现文本和公式的居中排版,有两种简单的解决方法:
方法1:改用gather环境
gather环境会自动将每行内容居中,适合不需要对齐特定符号的多行公式场景:
$$ \begin{gather} TEa = 0.25 \times \sqrt{CVw^2 + CVb^2} \\ \textrm{and} \\ \textrm{allowable imprecision} = 0.5 \times CVw \end{gather} $$ {#eq-bottom}
方法2:在aligned中设置全局居中对齐
如果坚持使用aligned,可以通过在每行开头添加&并结合\hfill来实现居中,不过这种方式不如gather简洁:
$$ \begin{aligned} &TEa = 0.25 \times \sqrt{CVw^2 + CVb^2} \\ &\hfill \textrm{and} \hfill \\ &\textrm{allowable imprecision} = 0.5 \times CVw \end{aligned} $$ {#eq-bottom}
另外注意:公式中的普通文本建议用\textrm{}包裹(或者\text{},Quarto默认会加载所需的amsmath包),避免文本变成斜体的变量样式。
内容的提问来源于stack exchange,提问作者Peter
相关产品推荐
相关产品推荐

