
Ich habe ein Problem, wenn ich das Paket tabu
mit makecell und tcolorbox
und 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 todo
und ausschließe tcolorbox
(und natürlich die Zeile mit \todo
dem Befehl, aber die Zeile mit behalte \makecell
), funktioniert alles.
Das Problem tritt auf, wenn ich mindestens eines der Pakete tcolorbox
oder 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-Pakettabularray
ist eine Alternative zum veralteten tabu
Paket:
\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}
Antwort2
Folgendes können Sie mit {NiceTabular}
of tun nicematrix
(kompatibel mit tcolorbox
und 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 nicematrix
im Hintergrund PGF/Tikz-Knoten verwendet werden).