文字對齊就像數字對齊一樣

文字對齊就像數字對齊一樣

我正在嘗試調整

Some_Text  1. Other Text       
           2. Other Text

我用了

\begin{align*}
\text{Some_Text}&\text{Other Text}\\
&\text{Other Text}\\
\end{align*}

但這沒有用。

這是我的序言:

\documentclass{book}
\usepackage[paperwidth=500mm,paperheight=50]{geometry}

答案1

這是我的第一次嘗試,我不太擅長表格,但我想嘗試一下:

\documentclass{amsart}
\begin{document}
\begin{tabular}{lp{\linewidth}}
Some\_Text  & \vspace{-1em}
\begin{enumerate}
  \item Other text
  \item Other text
\end{enumerate}
\end{tabular}
More text.
\end{document}

姆韋

這是另一種可能性(克服插入否定的技巧\vspace。這個答案取自Marco的答案,這裡,使用enumitem包:

\documentclass{amsart}
\usepackage[inline]{enumitem}
\begin{document}
\begin{tabular}{lp{\linewidth}}
Some\_Text&
\begin{enumerate*}[itemjoin={\newline}]
\item foo
\item bar
\end{enumerate*}
\end{tabular}
More text.
\end{document}

感謝大衛在聊天室幫我解決了這個問題。

答案2

對於包含枚舉的固定寬度列,可能會出現以下情況:

在此輸入影像描述

\documentclass{article}
\newcommand{\myitem}{\par\refstepcounter{enumi}\theenumi.\ }
\begin{document}
\centering
\begin{tabular}{rp{0.5\linewidth}}
  Some\textunderscore text &
    \myitem Other text
    \myitem Other text
\end{tabular}
\end{document}

如果您希望有不同類型的枚舉顯示,請\myitem依照您的喜好進行調整。例如,

\newcommand{\myitem}{\par\refstepcounter{enumi}(\theenumi)\ }

在編號周圍提供括號。第二列的寬度仍然是一個問題(例如,它是否足夠或不好),但對於問題中可用的詳細資訊量,我們無能為力。

相關內容