Verwenden von Makecell in Tabu: Inkompatibilität mit den Paketen Tcolorbox und Todonotes

Verwenden von Makecell in Tabu: Inkompatibilität mit den Paketen Tcolorbox und Todonotes

Ich habe ein Problem, wenn ich das Paket tabumit makecell und tcolorboxund verwende todonotes. Dies ist mein minimaler Beispielcode:

\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}

Wenn ich die Zeile mit ausschließe \makecell, funktioniert alles. Auch wenn ich die Pakete todound ausschließe tcolorbox(und natürlich die Zeile mit \tododem Befehl, aber die Zeile mit behalte \makecell), funktioniert alles.

Das Problem tritt auf, wenn ich mindestens eines der Pakete tcolorboxoder einschließe todonotes. Dann erhalte ich die folgende Fehlermeldung:

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

Auch die Lösung vontabu: Fehler seit Updatehat nicht geholfen.

Weiß jemand, wie man das behebt?

Hier ist die erste Zeile der Protokolldatei:

Dies ist pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (vorinstalliertes Format=pdflatex)

Antwort1

Das neue LaTeX3-Pakettabularrayist eine Alternative zum veralteten tabuPaket:

\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}

Bildbeschreibung hier eingeben

Antwort2

Folgendes können Sie mit {NiceTabular}of tun nicematrix(kompatibel mit tcolorboxund 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}

Sie benötigen mehrere Kompilierungen (da nicematrixim Hintergrund PGF/Tikz-Knoten verwendet werden).

Ausgabe des obigen Codes

verwandte Informationen