# Problem with tabular (\toprule etc.) and dinbrief

Phelype Oleinik phe.h.o1 at gmail.com
Tue Mar 9 23:16:34 CET 2021

On Tue, Mar 9, 2021 at 12:03 PM Karl via tex-live <tex-live at tug.org> wrote:
>
> The new rules in booktabs: \toprule, \midrule, \bottomrule no longer work properly with DINBRIEF, since reinstallation of miKteX. (I used this dinbrief documents with tables successfully since years)

Hi Karl,

It's not only booktabs: a lot of dinbrief is broken because it redefines
some LaTeX internals to add some of its own commands, but these
definitions are from 20 years ago, so any changes to these macros in the
LaTeX kernel were completely overwritten by dinbrief.  It just happened
that in a recent release these problems are showing more prominently.

Follows a series of patches to *try* to make dinbrief work with a recent
LaTeX.  booktabs works again, but there is no guarantee that more things
are broken.  Proceed with caution.

Best,
Phelype

---

\RemoveFromHook{file/after/dinbrief.cls}[firstaid]
\let\LTXdocument\document
\let\LTXenddocument\enddocument
\documentclass[10pt]{dinbrief}
\let\document\LTXdocument
\let\enddocument\LTXenddocument
\usepackage{etoolbox}
\makeatletter
\patchcmd\document
{\if at filesw}
{\if at filesw
\ifnum\c at labelgen>0
\immediate\openout\@mainlbl=\jobname at lbl
\immediate\write\@mainlbl{\string\relax}%
\immediate\write\@mainlbl{\string\startlabels\string\@startlabels}%
\fi}{}{\FAILED}
\patchcmd\enddocument
{\if at filesw}
{\if at filesw
\ifnum\c at labelgen>0
\immediate\closeout\@mainlbl
\makeatletter
\input \jobname at lbl\relax
\clearpage
\fi}{}{\FAILED}
\makeatother

\usepackage{booktabs}
\begin{document}
\begin{tabular}{c|c|p{0.48\textwidth}|r|r}
\toprule
a & a & a & a & a \\
\bottomrule
\end{tabular}
\end{document}