我的代码看起来太糟糕了
When monochromatic light is shone through a solution of iron, Beer's law states that
$$ A = \varepsilon l c $$
\begin{tabular}{l}
Where $A$ is amount of light absorbed \\
\quad \quad \quad $\varepsilon$ is the molar absorbance coefficient, which varies with wavelength,\\
\quad \quad \quad but not with concentration\\
\quad \quad \quad $l$ is the thickness of the sample
\end{tabular}
可以改善吗?
答案1
请查看为什么 \[ ... \] 比 $$ ... $$ 更可取?,变量的描述可以用description
或在列表中进行itemize
。
从个人角度来看,我宁愿使用\ell
而不是l
作为方程标识符。
\documentclass{article}
\usepackage{mathtools}
\begin{document}
When monochromatic light is shone through a solution of iron, Beer's law states that
\[ A = \varepsilon l c \]
\noindent where
\begin{description}
\item $A$ is amount of light absorbed
\item $\varepsilon$ is the molar absorbance coefficient, which varies with wavelength,\\
but not with concentration
\item $l$ is the thickness of the sample
\end{description}
\end{document}
另一个(更好的?)解决方案,可以对列表参数进行更精细的控制,具有更好的视觉吸引力,但这实际上是一个品味问题。
\documentclass{article}
\usepackage{enumitem}
\usepackage{mathtools}
\begin{document}
When monochromatic light is shone through a solution of iron, Beer's law states that
\[ A = \varepsilon \ell c \]
\noindent where
\begin{description}
\item $A$ is amount of light absorbed
\item $\varepsilon$ is the molar absorbance coefficient, which varies with wavelength,\\
but not with concentration
\item $\ell$ is the thickness of the sample
\end{description}
\noindent where
\begin{description}[labelindent=10pt,labelsep=10pt]
\item[$A$] is amount of light absorbed
\item[$\varepsilon$] is the molar absorbance coefficient, which varies with wavelength,\\
but not with concentration
\item[$\ell$] is the thickness of the sample
\end{description}
\end{document}
答案2
另一种选择是使用(d)cases
环境:
代码如下:
\documentclass{article}
\usepackage{mathtools}
\begin{document}
When monochromatic light is shone through a solution of iron, Beer's law states that
\[ A = \varepsilon l c ,\quad
\text{where }\quad
\begin{dcases*}
A& is amount of light absorbed \\
\varepsilon& is the molar absorbance coefficient, which varies \\
& with wavelength but not with concentration\\
l& is the thickness of the sample
\end{dcases*}
\]
\end{document}
当然,你也可以使用普通cases
环境,但我更喜欢dcases
更喜欢数学工具包裹。
答案3
两个棘手的例子(您的代码在开头):
\documentclass{article}
\begin{document}
When monochromatic light is shone through a solution of iron, Beer's law states that
$$ A = \varepsilon l c $$
\begin{tabular}{l}
Where $A$ is amount of light absorbed \\
\quad \quad \quad $\varepsilon$ is the molar absorbance coefficient, which varies with wavelength,\\
\quad \quad \quad but not with concentration\\
\quad \quad \quad $l$ is the thickness of the sample
\end{tabular}
\bigskip
When monochromatic light is shone through a solution of iron, Beer's law states that
\[
A = \varepsilon l c
\]
Where $A$ is amount of light absorbed
\noindent\hangindent3em\hangafter0
$\varepsilon$ is the molar absorbance coefficient, which varies with wavelength,\\
but not with concentration\\
$l$ is the thickness of the sample
When monochromatic light is shone through a solution of iron, Beer's law states that
\[
A = \varepsilon l c
\]
Where $A$ is amount of light absorbed \\
\hspace*{3em}%
\begin{tabular}{l}
$\varepsilon$ is the molar absorbance coefficient, which varies with wavelength,\\
but not with concentration\\
$l$ is the thickness of the sample
\end{tabular}
\end{document}
答案4
我不确定这是否有帮助,但我通常会这样做:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
When monochromatic light is shone through a solution of iron, Beer's law states that:
\begin{equation*} % The starred version avoid the automatic number.
A = \varepsilon l c
\end{equation*}
\noindent Where:\\
$A$ is amount of light absorbed, \\
$\varepsilon$ is the molar absorbance coefficient, which varies with wavelength, but not with concentration, and\\
$l$ is the thickness of the sample.
\end{document}
我使用amsmath
带星号的环境版本equation
,它产生的结果是相同的,equation
但方程式的数量不同。我不使用该tabular
环境,对齐非常简单。它对你有用吗?