
發生了什麼事?
我建構了一個tabularx
環境來簡化方程式下面的圖例的使用。這是一個非常常見的表,有兩列。
最小工作範例(MWE):
\documentclass{scrartcl}
\usepackage{amsmath}
\usepackage[english, ngerman]{babel}
\usepackage{tabularx}
\newenvironment{legend*}{
\begingroup
\tabularx{\columnwidth}{>{$}l<{$} @{${}\hspace{1.5em}{}$} >{\raggedright\arraybackslash}X}}
{\endtabularx\par\vspace{\belowdisplayskip}
\par
\endgroup
}
\begin{document}
\begin{legend*}
P_{ges} & Power [unit] \\
A_{ges} & Area [unit] \\
V_{ges} & Volume [unit]
\end{legend*}
\end{document}
結果截圖:
問題:
在文字本身中,我只需透過呼叫此環境\begin{environment}
並將輸入輸入到表中即可。但是,我想在右側添加一個附加列,以將單位與前面的描述分開。我怎樣才能得到它?
它應該看起來像這樣:
\begin{legend*}
P_{ges} & Power & [unit] \\
A_{ges} & Area & [unit] \\
V_{ges} & Volume & [unit]
\end{legend*}
非常感謝您的幫忙!
答案1
謝謝@大衛卡萊爾!
\tabularx{\columnwidth}{>{$}l<{$} @{${}\hspace{1.5em}{}$} >{\raggedright\arraybackslash}X l }
……帶來了解決方案!