diff options
Diffstat (limited to 'macros/latex/contrib/tabularray/tabularray.tex')
-rw-r--r-- | macros/latex/contrib/tabularray/tabularray.tex | 53 |
1 files changed, 43 insertions, 10 deletions
diff --git a/macros/latex/contrib/tabularray/tabularray.tex b/macros/latex/contrib/tabularray/tabularray.tex index 258015107c..db993f27d3 100644 --- a/macros/latex/contrib/tabularray/tabularray.tex +++ b/macros/latex/contrib/tabularray/tabularray.tex @@ -1,7 +1,7 @@ % -*- coding: utf-8 -*- % !TEX program = lualatex \documentclass[oneside]{book} -\newcommand*{\myversion}{2022C} +\newcommand*{\myversion}{2022D} \newcommand*{\mylpad}[1]{\ifnum#1<10 0\the#1\else\the#1\fi} \usepackage[a4paper,margin=2.5cm]{geometry} @@ -1362,7 +1362,7 @@ of \verb!tblr! environment, which include new interfaces described in Chapter \r of \verb!tblr! environment, most of which are used for long tables (see Chapter \ref{chap:long}). You can use \verb!\SetTblrInner! and \verb!\SetTblrOuter! commands -to set default inner and outer specifications of tables, respectively. +to set default inner and outer specifications of tables, respectively (see Section \ref{sec:default}). \section{Inner Specifications} @@ -1414,6 +1414,16 @@ The following example shows that we can replace \verb!\arraystretch! parameter w \end{tblr} \end{demohigh} +By replacing stretch with row heights, we can get perfect vertical centering for your numerical tables. + +\begin{demohigh} +\begin{tblr}{hlines, stretch=0, rows={ht=\baselineskip}} + 2021 & 2022 & 2023 \\ + 0.4 & 0.5 & 0.6 \\ + 1.1 & 2.2 & 3.3 \\ +\end{tblr} +\end{demohigh} + \subsection{Rowseps and Colseps for All} The following example uses \verb!rowsep! and \verb!colsep! keys to set padding for all rows and columns. @@ -1615,18 +1625,32 @@ The macro \underline{can not} be defined with \verb!\NewDocumentCommand! or \end{demohigh} \section{Default Specifications} +\label{sec:default} \verb!Tabularray! package provides \verb!\SetTblrInner! and \verb!\SetTblrOuter! commands for you to change the default inner and outer specifications of tables. -In the below example, the first line draws all hlines and vlines for all tables created afterwards, -while the second line makes all tables created afterwards vertically align at the last row. +In general different \verb!tabularray! environments (\verb!tblr!, \verb!talltblr!, +\verb!longtblr!, etc) could have different default specifications. +You can list the environments in the optional arguments of these two commands, +and they only apply to \verb!tblr! environment when the optional arguments are omitted. + +In the following example, the first line draws all hlines and vlines for all \verb!tblr! tables +created afterwards, while the second line makes all \verb!tblr! tables created afterwards +vertically align at the last row. \begin{codehigh} \SetTblrInner{hlines,vlines} \SetTblrOuter{baseline=B} \end{codehigh} +And the following example sets zero \verb!rowsep! for all \verb!tblr! and \verb!longtblr! tables +created afterwards. + +\begin{codehigh} +\SetTblrInner[tblr,longtblr]{rowsep=0pt} +\end{codehigh} + \section{New Tabularray Environments} You can define new \verb!tabularray! environments using \verb!\NewTblrEnviron! command: @@ -1642,10 +1666,6 @@ Text \begin{mytblr}{cccc} \end{mytblr} Text \end{demohigh} -If not giving the optional argument to \verb!\SetTblrInner! or \verb!\SetTblrOuter! command, -we set the default specifications for \verb!tblr! environment. -And different tabularray environments could have different default specifications. - \section{New General Environments} With \verb!+b! argument type of \verb!\NewDocumentEnvironment! command, @@ -2141,7 +2161,10 @@ You can select one of them with \verb!\SetTblrTemplate! command. \subsection{Continuation Templates} -Let us have a look at the code for defining templates of continuation text first: +Let us have a look at the code for defining templates of continuation text first:% +\footnote{To tell the truth, the default \texttt{conthead-text} and \texttt{contfoot-text} +are actually stored in commands \texttt{\string\tblrcontheadname} and \texttt{\string\tblrcontfootname} +respectively. And you may contribute your translations of them to \textbf{babel} package.} \begin{codehigh} \DefTblrTemplate{contfoot-text}{normal}{Continued on next page} @@ -2817,6 +2840,11 @@ We can also use color series of \verb!xcolor! package to color table rows: \end{tblr} \end{demohigh} +\section{Library \texttt{nameref}} + +From version 2022D, you can load \verb!nameref! library +to make \verb!\nameref! and \verb!longtblr! work together. + \section{Library \texttt{siunitx}} When writing \verb!\UseTblrLibrary{siunitx}! in the preamble of the document, @@ -2954,12 +2982,17 @@ Note that option \verb!stretch=-1! also removes struts from cells, therefore it in \verb!tabularray! environments with \verb!rowsep=0pt!, such as \verb!booktabs!/\verb!longtabs!/\verb!talltabs! environments from \verb!booktabs! library. +\section{Library \texttt{zref}} + +From version 2022D, you can load \verb!zref! library +to make \verb!\zref! and \verb!longtblr! work together. + \chapter{History and Future} \section{The Future} Starting from 2022, except for hotfix releases for critical bugs, -new releases will be published every three or six months. +every new release will be published on the first day of some month. You may watch the milestones page for the scheduled dates of upcoming releases and their changes:\newline \centerline{\url{https://github.com/lvjr/tabularray/milestones}} |