Skip to content

HooksAndVariables

lvjr edited this page Feb 18, 2023 · 11 revisions

The public hooks and variables described here (except for eight of them) are experimental: they may be modified or removed in the future if necessary!

Public tabularray hooks

The latest tabularray package provides some hooks with hook library, for tagpdf, tex4ht, lwarp and other packages.

Hook names How to use them
tabularray/trial/before
tabularray/trial/after
you can disable/enable some commands in trial typesetting
tabularray/table/before
tabularray/table/after
you can insert <table> and </table> tags respectively
tabularray/row/before
tabularray/row/after
you can insert <tr> and </tr> tags respectively
tabularray/cell/before
tabularray/cell/after
you can insert <td> and </td> tags respectively

You need to write \UseTblrLibrary{hook} to use these hooks.

Public tabularray variables

These variable are stable and always available throughout the whole typesetting process of tables:

  • rowcount counter: total number of rows
  • colcount counter: total number of columns

These variables are stable and updated by default before building every cell:

  • rownum counter: the row index number of current cell
  • colnum counter: the column index number of current cell
  • \leftsep dimension: left separation space of current cell
  • \rightsep dimension: right separation space of current cell
  • \abovesep dimension: above separation space of current cell
  • \belowsep dimension: below separation space of current cell

This variable is always available throughout the whole typesetting process of tables:

  • \lTblrMeasuringBool: if tabularray is doing trial typesetting.

These variables are updated by default before building every cell:

  • \lTblrCellRowSpanTl: how many rows are spanned by current cell.
  • \lTblrCellColSpanTl: how many columns are spanned by current cell.
  • \lTblrCellOmittedBool: if current cell is spanned by another cell.
  • \lTblrCellBackgroundTl: background color of current cell.

These variables are updated by html library before building every cell (you need to write \UseTblrLibrary{html} first):

  • \lTblrCellAboveBorderStyleTl
  • \lTblrCellAboveBorderWidthTl
  • \lTblrCellAboveBorderColorTl
  • \lTblrCellBelowBorderStyleTl
  • \lTblrCellBelowBorderWidthTl
  • \lTblrCellBelowBorderColorTl
  • \lTblrCellLeftBorderStyleTl
  • \lTblrCellLeftBorderWidthTl
  • \lTblrCellLeftBorderColorTl
  • \lTblrCellRightBorderStyleTl
  • \lTblrCellRightBorderWidthTl
  • \lTblrCellRihgtBorderColorTl

In the above variables, BorderStyle, BorderWidth, BorderColor are similar to border-style, border-width, border-color in HTML/CSS, respectively. BorderStyle and BorderColor are empty by default.

Clone this wiki locally