RetroFed Forum
Your home away from modern life.
Having a tabular column of dates is painful because >{} is broken
Post Reply
AuthorMessage
evenwicht lemmy.sdf.org evenwicht@lemmy.sdf.org
Joined: 2024-07-01
Quote

The array package gives the capability to replicate a declaration before every cell in a specifed column column. So if you have a column for a price, you can use a format like: {ll>{\$}r} to put a dollar sign before every price.

Usually you want long dates in the text of a document (e.g. 5th August, 2021). Of course exceptionally you would usually want short dates in a table column. But this is broken:

\Begin{tabular}{l>{\DTMsetdatestyle{default}\DTMsetup{datesep=/}}rl}
col 1 && \DTMusedate{mydate} && col 3\\
\end{tabular}

The middle column still prints the long form of dates. It obviously clusterfucks the table to put the long-ass \DTMsetdatestyle{default}\DTMsetup{datesep=/} in every middle cell.

The only workaround I can think of is to nest the whole table inside braces ({}), and nest the date config with it:

{\DTMsetdatestyle{default}\DTMsetup{datesep=/}
\begin{tabular}{lrl}
col 1 && \DTMusedate{mydate} && col 3\\
\end{tabular}}

I’m calling it a bug because there is no good reason make code inside >{} happen in a separate scope as the cell that preceeds.

1   Original
Post Reply
Back to top