Attendance Sheets in Org Mode
Jan 25, 2025 07:17

This is another one of those days when I realized that I have been doing things the hard way. For years, I have been generating attendance sign-in sheets with Org Mode wonderful table editor. I would split the names into two columns and add a signature column after each. To ensure there was enough room for the signature, I would then stretch the signature column by adding phantom text to one of the rows like this (the names are from 1000randomnames.com):

| Miley Malone | \phantom{xxxxxxxxxx} | Ruben Espinosa | \phantom{xxxxxxxxxx} |

Then, to make sure there was enough vertical space, I would add some extra blank rows between each row, having to adjust several times to make everything fit. It worked fine once completed, but it was certainly a pain in the neck. After seeing Matt Maguire’s post, Exporting Org Mode Tables to LaTeX, I realized there had to be a better way.

Using the LaTeX tabularray package, I can simply do this:

#+ATTR_LATEX: :environment tblr :align hline{3-Z}={solid},row{2-Z}={f,12mm},colspec={XXXX}
| *Name*         | *Signature* | *Name*         | *Signature* |
| Miley Malone   |             | Ruben Espinosa |             |
| Braylee Brandt |             | Naomi Warren   |             |
| Abel Bullock   |             | Winnie Weaver  |             |
| Tucker Sexton  |             | Ellen Hayden   |             |
| Leroy Skinner  |             | Damir Phillips |             |

to produce:

tblr-attendance.png

Here is what the values of align do:

Now, instead of inserting and deleting rows and setting horizontal lines manually, I can just adjust the row height as needed by changing one number. See the excellent tabularray documentation for other settings.

Tagged: Org Teaching