
Tengo un problema al usar el paquete tabu
con makecell y tcolorbox
y 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 todo
y tcolorbox
(y, por supuesto, la línea con \todo
comando, pero mantengo la línea con \makecell
), todo funciona.
El problema ocurre cuando incluyo al menos uno de los paquetes tcolorbox
o 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 LaTeX3tabularray
es una alternativa al tabu
paquete 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}
Respuesta2
Esto es lo que puedes hacer con {NiceTabular}
( nicematrix
compatible con tcolorbox
y 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 nicematrix
utiliza nodos PGF/Tikz bajo el capó).