Usando makecell en tabu: incompatibilidad con los paquetes tcolorbox y todonotes

Usando makecell en tabu: incompatibilidad con los paquetes tcolorbox y todonotes

Tengo un problema al usar el paquete tabucon makecell y tcolorboxy todonotes. Este es mi código de ejemplo mínimo:

\documentclass[a4paper]{scrreprt}
\usepackage{tcolorbox}
\usepackage{todonotes}
\usepackage{tabu,makecell}
\begin{document}
\noindent \begin{tabu} to \textwidth {@{}lXX}
normal line & A & B \\
line with makecell & \makecell[tl]{A\\C} & \makecell[tl]{B\\D\\E}
\end{tabu}
\todo{To Do: ...}
\end{document}

Cuando excluyo la línea con \makecell, todo funciona. Además, cuando excluyo los paquetes todoy tcolorbox(y, por supuesto, la línea con \todocomando, pero mantengo la línea con \makecell), todo funciona.

El problema ocurre cuando incluyo al menos uno de los paquetes tcolorboxo todonotes. Entonces recibí el siguiente error:

./test-tabu.tex:9: Improper \prevdepth.
\tabu@verticalspacing ...tempdimc \the \prevdepth 
                                              \@tempdima \dimexpr \ht 
\t...
l.9 \end{tabu}

También la solución detabú: Error desde la actualizaciónno ayudó.

¿Alguien sabe cómo arreglar esto?

Aquí está la primera línea del archivo de registro:

Este es pdfTeX, versión 3.14159265-2.6-1.40.19 (TeX Live 2018) (formato precargado = pdflatex)

Respuesta1

El nuevo paquete LaTeX3tabularrayes una alternativa al tabupaquete obsoleto:

\documentclass[a4paper]{scrreprt}

\usepackage{tcolorbox}
\usepackage{todonotes}
\usepackage{tabularray}

\begin{document}

\noindent
\begin{tblr}{
  width = \textwidth,
  colspec = {@{}lXX},
}
  normal line        & A                   & B \\
  line with makecell & \SetCell{t,l}{A\\C} & \SetCell{t,l}{B\\D\\E} \\
\end{tblr}
\todo{To Do: ...}

\end{document}

ingrese la descripción de la imagen aquí

Respuesta2

Esto es lo que puedes hacer con {NiceTabular}( nicematrixcompatible con tcolorboxy todonotes).

\documentclass[a4paper]{scrreprt}

\usepackage{tcolorbox}
\usepackage{todonotes}
\usepackage{nicematrix}

\begin{document}

\noindent
\begin{NiceTabular}{@{}lXX}
  normal line        & A                   & B \\
  line with makecell & \Block[t,l]{}{A\\C} & \Block[t,l]{}{B\\D\\E} \\
\end{NiceTabular}

\bigskip
\todo{To Do: ...}

\end{document}

Necesita varias compilaciones (porque nicematrixutiliza nodos PGF/Tikz bajo el capó).

Salida del código anterior

información relacionada