为什么我会得到这样的输出?
如果我嵌入 lambda 和 eta 等特殊字符,为什么对齐会发生变化?
代码示例1:
\begin{gather}
\label{eq:Highest spatial frequency}
\frac{2 \text{ }\eta \text{ }\sin (\alpha )}{\lambda }\\
\shortintertext{where}
\begin{aligned}
&\lambda \text{is the wavelength of the monochromatic light used}\\
&\eta \text{refers to the refractive index of the immersion fluid}\\
&\alpha \text{acceptance angle of the objective}
\end{aligned}\notag
\end{gather}
输出:
和 ,
代码片段2:
\begin{gather}
\label{eq:Highest spatial frequency}
\frac{2 \text{ }\eta \text{ }\sin (\alpha )}{\lambda }\\
\shortintertext{where}
\begin{aligned}
&$\lambda$ \text{is the wavelength of the monochromatic light used}\\
&$\eta$ \text{refers to the refractive index of the immersion fluid}\\
&$\alpha$ \text{acceptance angle of the objective}
\end{aligned}\notag
\end{gather}
输出:
答案1
数学模式中的间距由 TeX 控制。如果你想在数学和文本之间留出间距,你应该留一个空格之内宏text{}
:
笔记:
你应该不是在数学模式下使用
\text{ }
来添加空格。TeX 在数学模式下产生空格是有原因的。例如,查看 产生的输出$-x-y$
,您会注意到一元“负数”和二元“减号”运算符之间的空格量不同。不确定你如何编译第二个示例,因为它对我来说无法编译。发布完全可编译的版本总是最好的原因之一平均能量损失包括
\documentclass
和适当的包。
代码:
\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{gather}
\label{eq:Highest spatial frequency}
\frac{2 \eta \sin (\alpha)}{\lambda }\\
\shortintertext{where}
\begin{aligned}
&\lambda \text{ is the wavelength of the monochromatic light used}\\
&\eta \text{ refers to the refractive index of the immersion fluid}\\
&\alpha \text{ acceptance angle of the objective}
\end{aligned}\notag
\end{gather}
\end{document}
答案2
谢谢,我刚刚发现的另一种方法可以做到这一点,如下所示(使用 ~ ):
\begin{gather}
\label{eq:Highest spatial frequency}
%f_c=\frac{2. \eta \text{ } .( \text{Sin($\alpha$)})}{\lambda }\\
\frac{2 \text{ }\eta \text{ }\sin (\alpha )}{\lambda }\\
\shortintertext{where}
\begin{aligned}
&\lambda ~\text{is the wavelength of the monochromatic light used}\\
&\eta ~\text{refers to the refractive index of the immersion fluid}\\
&\alpha ~\text{acceptance angle of the objective}
\end{aligned}\notag
\end{gather}