枚举并在右侧对齐解释列

枚举并在右侧对齐解释列
\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}

\renewcommand{\labelenumii}{\theenumii}
\renewcommand{\theenumii}{\theenumi.\arabic{enumii}.}

\begin{document}
\begin{enumerate}
    \item $p \vdash p \lor q $ explanation  
    \begin{enumerate}
        \item $p \Rightarrow q$ explanation
    \end{enumerate}
\item $p \Rightarrow p \lor q$ explanation
\end{enumerate}
\end{document}

我试图将这三个解释向右对齐,就像使用表格环境一样,但我选择不使用表格,因为我无法弄清楚如何让枚举与它一起工作,也无法在证明中看到第 1.1 行的漂亮缩进

答案1

在此处输入图片描述

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}

\renewcommand{\labelenumii}{\theenumii}
\renewcommand{\theenumii}{\theenumi.\arabic{enumii}.}

\newcommand\explanation[1]{%
  \ifhmode\unskip\fi\hspace*{1em plus 1fill}%
\parbox[t]{6cm}{#1}}

\begin{document}
\begin{enumerate}
    \item $p \vdash p \lor q $ \explanation{
 zz z z z z zzz  blah balah  
 zz z z z z zzz  blah balah  
 zz z z z z zzz  blah balah} 
    \begin{enumerate}
        \item $p \Rightarrow q$ \explanation{zzzz}
    \end{enumerate}
\item $p \Rightarrow p \lor q$ \explanation{yet more comments
yet more comments yet more comments yet more comments}
\end{enumerate}
\end{document}

相关内容