Home > Enterprise >  Inside an enumerate enviroment have 2 columns, one of equations and one for text in latex
Inside an enumerate enviroment have 2 columns, one of equations and one for text in latex

Time:10-06

I have this problem:

\begin{center}
\begin{minipage}{2in}
    \begin{enumerate}[{1)}]
    \item $p \lor \neg q$ Agregacion
    \item $q \ent p$ Equivalenica  
\end{enumerate}
\end{minipage}
\end{center}

I want that the text in every item (not the math part) aligned with the text from above .

Like a list, where I can said what rule I applied with text.

Like if every item have "2 columns" the left one for the equation and the right one for a kind of explanation.

CodePudding user response:

You could use \makebox to ensure that all your equations have the same width:

\documentclass{article}

\usepackage{mathtools}
\usepackage{enumerate}

\begin{document}

\begin{center}
\begin{minipage}{2in}
    \begin{enumerate}[{1)}]
    \item \makebox[2cm][l]{$p \lor \neg q$} Agregacion
    \item \makebox[2cm][l]{$q  p$} Equivalenica  
\end{enumerate}
\end{minipage}
\end{center}



\end{document}

enter image description here

CodePudding user response:

If I understood correctly, you would like to have an enumerate list with two columns: math expressions and texts.

Since you already have the list, I would customise it via enumitem and then enclose equations inside makebox to make sure equations span the same space (basically the same approach as enter image description here

\documentclass{article}
\usepackage{amsmath}
\usepackage{enumitem}

\newlength\firstcollen    % Controls first column length
\AtBeginDocument{\setlength\firstcollen{0.3\textwidth}}

\usepackage{kantlipsum}   % Just for dummy text


\newcommand\itemmath[1]{\item%
  \parbox[t]{\firstcollen}{\ensuremath{#1}}%
  \ignorespaces}


\begin{document}
\begin{enumerate}[
    label=\arabic{enumi}),
    labelwidth=2.5em,
    labelsep=0.5em,
    labelwidth=2em,
    leftmargin=\dimexpr \firstcollen 2.5em,
    itemindent=-\firstcollen,
    % listparindent=\parindent, parsep=0pt,   % Simulates paragraphs
    listparindent=0pt, parsep=3pt,          % No indentation, small separation
    align=left,
  ]
  \itemmath{y = f(x)}Short equation
  \itemmath{r^2 = \cos^2 x   \sin^2 x}          A trigonometric identity  
  \itemmath{\int_{a}^{b}\frac{1}{2}f(x)dx}      \kant*[1][1]
  \itemmath{y = f(x)}                           Short equation
  \itemmath{r^2 = \cos^2 x   \sin^2 x}          \kant[3][1]\kant[3][2]\kant[3][3]  
  \itemmath{b = \int_{c}^{d}\frac{3}{4}g(x)dx}  Short text
  \itemmath{\int_{a}^{b}\frac{1}{2}f(x)dx}      \kant[1][1-5]\kant[2]
\end{enumerate}
\end{document}
  • Related