1

I am using the tabto package, suggested here. However, I seem to run into difficulties when I try to use \tabto in an itemize environment that is nested in an enumerate environment (via the enumitem package). Here is a MWE:

\documentclass{article}
\usepackage{enumitem}
\usepackage{tabto}

\begin{document}

\noindent Some text.
\begin{enumerate}[label=(\alph*)]
  \item{fruit}\tabto{3.0cm}sweet
    \begin{itemize}
      \item{apple}\tabto{3.0cm}crisp
      \item{banana}\tabto{3.0cm}soft
    \end{itemize}
  \item{vegetable}\tabto{3.0cm}savory
    \begin{itemize}
      \item{carrot}\tabto{3.0cm}crunchy
      \item{cucumber}\tabto{3.0cm}hard as a rock
    \end{itemize}
\end{enumerate}
More text.

mwe

I would like "crisp," "soft," "crunchy," etc to align with "fruit" and "vegetable."

I am thinking that the "misalignment" indicates that tabto is measuring relative to the indentation of the itemize environment. If I could somehow subtract the width of the indentation, I should be able to get the alignment I'm looking for. How should I do this, or should I be using a completely different approach?

(FYI, my thesis is not actually about fruits and vegetables!)

1 Answer 1

1

enter image description here

\documentclass{article}
\usepackage{enumitem}
\usepackage{tabto}
\usepackage{calc}

\begin{document}

\noindent Some text.
\begin{enumerate}[label=(\alph*)]
  \item{fruit} \tabto{3.0cm+\leftmargin-\labelwidth-\labelsep-\itemindent} sweet
    \begin{itemize}
      \item{apple} \tabto{3.0cm-\leftmargin} crisp
      \item{banana} \tabto{3.0cm-\leftmargin} soft
    \end{itemize}
  \item{vegetable} \tabto{3.0cm+\leftmargin-\labelwidth-\labelsep-\itemindent} savory
    \begin{itemize}
      \item{carrot} \tabto{3.0cm-\leftmargin} crunchy
      \item{cucumber}\tabto{3.0cm-\leftmargin} hard as a rock
    \end{itemize}
\end{enumerate}
More text.

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .