~sthagen/liitos#11: 
Encourage font size environment use for tables

Sometimes a local font size decrease is the fastest way for tables to separate columns nicely while also respecting text width.

The implementation could be bluntly documenting, that placing the table in markdown between \begin{footnotesize} and \end{footnotesize} works nicely with panic and the liitos toolchain already.

Proposal: Add example to documentation (usage).

Status
RESOLVED IMPLEMENTED
Submitter
~sthagen
Assigned to
Submitted
1 year, 10 months ago
Updated
1 year, 7 months ago
Labels
Feature

~sthagen 1 year, 10 months ago*

Unfortunately pandoc will maintain the markdown table untranslated when within environment.

One possible simplistic interface with a reasonably well-defined implementation could be one that translates this:

#### A2 level four

Tables maybe:

| Left | Middle | Right |
|:-----|:------:|------:|
| L1   |   M2   |    R3 |
| L4   |   M5   |    R6 |
| L7   |   M8   |    R9 |
| L10  |  M11   |   R12 |
| L13  |  M14   |   R15 |

Table: A caption for a table \label{table:left-middle-right}

And some small font with the same table maybe:

\footnotesize

| Lößt | Müddle | Räght |
|:-----|:------:|------:|
| L1   |   M2   |    R3 |
| L4   |   M5   |    R6 |
| L7   |   M8   |    R9 |
| L10  |  M11   |   R12 |
| L13  |  M14   |   R15 |

Table: A caption for a table with smaller font size (footnotesize) \label{table:left-middle-right-footnotesize}

That's it with tables for now.

per:

\hypertarget{a2-level-four}{%
\paragraph{A2 level four}\label{a2-level-four}}

Tables maybe:

\begin{longtable}[]{@{}lcr@{}}
\caption{A caption for a table
\label{table:left-middle-right}}\tabularnewline
\toprule()
Left & Middle & Right \\
\midrule()
\endfirsthead
\toprule()
Left & Middle & Right \\
\midrule()
\endhead
L1 & M2 & R3 \\
L4 & M5 & R6 \\
L7 & M8 & R9 \\
L10 & M11 & R12 \\
L13 & M14 & R15 \\
\bottomrule()
\end{longtable}

And some small font with the same table maybe:

\footnotesize

\begin{longtable}[]{@{}lcr@{}}
\caption{A caption for a table with smaller font size (footnotesize)
\label{table:left-middle-right-footnotesize}}\tabularnewline
\toprule()
Lößt & Müddle & Räght \\
\midrule()
\endfirsthead
\toprule()
Lößt & Müddle & Räght \\
\midrule()
\endhead
L1 & M2 & R3 \\
L4 & M5 & R6 \\
L7 & M8 & R9 \\
L10 & M11 & R12 \\
L13 & M14 & R15 \\
\bottomrule()
\end{longtable}

That's it with tables for now.

to:

\hypertarget{a2-level-four}{%
\paragraph{A2 level four}\label{a2-level-four}}

Tables maybe:

\begin{longtable}[]{@{}lcr@{}}
\toprule()
Left & Middle & Right \\
\midrule()
\endfirsthead
\toprule()
Left & Middle & Right \\
\midrule()
\endhead
L1 & M2 & R3 \\
L4 & M5 & R6 \\
L7 & M8 & R9 \\
L10 & M11 & R12 \\
L13 & M14 & R15 \\
\bottomrule()
\rowcolor{white}
\caption{A caption for a table
\label{table:left-middle-right}}\tabularnewline
\end{longtable}

And some small font with the same table maybe:

\begin{footnotesize}
\begin{longtable}[]{@{}lcr@{}}
\toprule()
Lößt & Müddle & Räght \\
\midrule()
\endfirsthead
\toprule()
Lößt & Müddle & Räght \\
\midrule()
\endhead
L1 & M2 & R3 \\
L4 & M5 & R6 \\
L7 & M8 & R9 \\
L10 & M11 & R12 \\
L13 & M14 & R15 \\
\bottomrule()
\rowcolor{white}
\caption{\normalsize A caption for a table with smaller font size (footnotesize)
\label{table:left-middle-right-footnotesize}}\tabularnewline
\end{longtable}
\end{footnotesize}

That's it with tables for now.

Note:

  • The normalize reset within the caption is only one step as the vertical space between the caption and the table is too close (proportional to the footnotesize)
  • Tables already receive filtering (captions from above to below the table) and may be future targets for additional and more complete rewrites (partition of column widths and vertical lines etc) which can lead to surprising results if not enough tests ensure the side-effect free behavior of this simplistic table font size filter

~sthagen 1 year, 7 months ago*

An initial implementation is available starting with release 2023.5.9. That still does also resize the caption, sorry.

The command to inject inside the markdown before the table to be resized (per fantasize):

\tablefontsize=tiny

Instead of tiny any known fantasize in latex is accepted.

~sthagen 1 year, 7 months ago

Captions pinned for normalize with version 2023.5.10 and later.

~sthagen REPORTED IMPLEMENTED 1 year, 7 months ago

Register here or Log in to comment, or comment via email.