1

I'm using tasks (https://github.com/cgnieder/tasks) in enumerate.

If the line-height is encreased (eg by a formula) the baseline of the first task is not on the item-baseline:

\documentclass{article} 
\usepackage{geometry}
\usepackage{tasks}

\begin{document}

 \begin{enumerate}
    \item\mbox{}\vspace*{-\dimexpr\baselineskip + \topsep}
    \begin{tasks}(2)
        \task Baseline of task $= $ baseline of item
        \task $x$
    \end{tasks}
    \item\mbox{}\vspace*{-\dimexpr\baselineskip + \topsep}
    \begin{tasks}(2)
        \task Baseline of task $\neq $ baseline of item
        \task $\frac{\left(\frac{1}{2}\right)^{x}}{y}$
    \end{tasks}
\end{enumerate}

\end{document}

enter image description here How can I fix this?

1 Answer 1

1

When an object with sufficiently big height is inserted into a line TeX don't just use \baselineskip, but adds another space ensuring that consecutive lines aren't placed too close. Specifically, the distance between lines cannot be less than \lineskiplimit. You can set it to some negative value thus making TeX use \baselineskip only. For example:

\documentclass{article} 
\usepackage{geometry}
\usepackage{tasks}

\lineskiplimit=-\maxdimen

\begin{document}

\begin{enumerate}
  \item\mbox{}\vspace*{-\dimexpr\baselineskip + \topsep}
    \begin{tasks}(2)
        \task Baseline of task $= $ baseline of item
        \task $x$
    \end{tasks}
    \item\mbox{}\vspace*{-\dimexpr\baselineskip + \topsep}
    \begin{tasks}(2)
        \task Baseline of task $\neq $ baseline of item
        \task $\frac{\left(\frac{1}{2}\right)^{x}}{y}$
    \end{tasks}
\end{enumerate}
\end{document}

generates

enter image description here

In this case lines can overlap, by the way.

You must log in to answer this question.

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