我的第一个堆栈溢出问题。我选择简单的方法,直接问下面的问题。如何在LaTeX中生成输出,如下图所示?

更全面的,什么是最好的方法来封装文本在一个amsmath例如。方程式,对齐,阻塞?
发布于 2015-08-19 04:48:24
可以使用\text{}命令在amsmath块中写入文本:

\documentclass[11pt]{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
ID_V &= \text{identifier of $V$} \\
P_C &= \text{password of user on $C$}
\end{align}
\begin{alignat}{2}
&ID_V &&= \text{identifier of $V$} \\
&P_C &&= \text{password of user on $C$}
\end{alignat}
\end{document}发布于 2015-08-23 23:47:13
您应该使用tabular环境。这段代码:
\documentclass{article}
\begin{document}
\begin{tabular}{ll}
$ID_V$ & = identifier of $V$\\
$P_C$ & = password of user on $C$\\
$AD_C$ & = network address of $C$\\
$K_V$ & = secret encryption key shared by $AS$ and $V$
\end{tabular}
\end{document}产生:

然后,您可以根据自己的喜好缩进或对齐表格。
关于你的问题的第二部分,只有一个提示。请记住,哪些环境(如tabular )将文本作为默认内容(因此数学必须包含在$...$中),哪些环境(如array、align、equation等)将数学作为默认内容(因此文本必须包含在框中或\text{...}中)。
https://stackoverflow.com/questions/32072022
复制相似问题