4

I'd like to get something like this:

MWE:

\documentclass{article}

\begin{document}
 \begin{enumerate}
  \item $Y^2 - 1 = 0$ \quad (text)
  \item $Y^2 + 1 = 0$ \quad (text) 
 \end{enumerate}
\end{document}

2 Answers 2

6

How about a simple \raisebox, wrapped in a macro taking into account \itemsep and \parsep values (thanks to circumscribe, I have change to \glueexpr, since all involved lengths are glues, not ordinary lengths!)

enter image description here

\documentclass{article}

\usepackage{enumitem}

\newcommand{\raisecontent}[1]{%
  \raisebox{\glueexpr\baselineskip/2+\parsep/2+\itemsep/2+\lineskip/2}[\ht\strutbox][\ht\strutbox]{#1}%
}

\begin{document}
 \begin{enumerate}
  \item $Y^2 - 1 = 0$ 
  \item $Y^2 + 1 = 0$ \raisecontent{\quad (text)}
 \end{enumerate}

 \begin{enumerate}[itemsep=40pt]
  \item $Y^2 - 1 = 0$ 
  \item $Y^2 + 1 = 0$ \raisecontent{\quad (text)}
 \end{enumerate}

\end{document}
5
  • Working in progress...
    – user31729
    Commented Feb 9, 2019 at 12:00
  • @Circumscribe: Thanks, I totally forgot about \glueexpr....
    – user31729
    Commented Feb 9, 2019 at 12:21
  • @Circumscribe: I changed and apparently the slight vertical shift is removed. Thanks again
    – user31729
    Commented Feb 9, 2019 at 12:30
  • Let us continue this discussion in chat. Commented Feb 9, 2019 at 12:58
  • @Circumscribe: Oh, I thought \itemsep etc. would be normal length 'registers' and skip's'
    – user31729
    Commented Feb 9, 2019 at 14:52
4

Another solution, based on tabularx and listliketab, which emulates list environments within tables:

\documentclass{article}
\usepackage{tabularx, listliketab, multirow}

\begin{document}

\storestyleof{enumerate}
\begin{listliketab}
\newcounter{tabenum}\setcounter{tabenum}{0}
\newcommand{\tabitem}{\addtocounter{tabenum}{1}\thetabenum.}
 \noindent\begin{tabularx}{\linewidth}{@{}L l@{\quad}X@{}}
  \tabitem & $Y^2 - 1 = 0$ & \multirow{2}{=}{(Text)}\\
  \tabitem & $Y^2 + 1 = 0$
 \end{tabularx}
 \end{listliketab}

\end{document} 

enter image description here

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.