diff options
Diffstat (limited to 'macros/luatex/generic/lutabulartools/lutabulartools.tex')
-rw-r--r-- | macros/luatex/generic/lutabulartools/lutabulartools.tex | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/macros/luatex/generic/lutabulartools/lutabulartools.tex b/macros/luatex/generic/lutabulartools/lutabulartools.tex index ecc35df511..97802fce07 100644 --- a/macros/luatex/generic/lutabulartools/lutabulartools.tex +++ b/macros/luatex/generic/lutabulartools/lutabulartools.tex @@ -1,5 +1,5 @@ % Kale Ewasiuk (kalekje@gmail.com) -% 2022-10-15 +% 2022-10-22 % Copyright (C) 2021-2022 Kale Ewasiuk % % Permission is hereby granted, free of charge, to any person obtaining a copy @@ -62,9 +62,12 @@ \newcommand{\tMC}{\cmd{\\MC}} +\usepackage{caption} + +\usepackage{ltxtable} \usepackage{longtable} -\usepackage[pl,extrasnoglobals]{penlight} +\usepackage[pl,extras]{penlight} \RequirePackage{lutabulartools} @@ -78,6 +81,7 @@ \usepackage{hyperref} + \begin{document} % todo: can improve naming... set col spec to a table instead of a string @@ -85,10 +89,9 @@ \maketitle -lutabulartools is a package that contains a few useful macros to help with tables. -Most functions require LuaLaTeX. +lutabulartools is a package that contains a few useful Lua\LaTeX-based macros to help with tables. This package redefines the {\ttfamily tabular} and {\ttfamily tabular*} environments. -The following packages are loaded: +The following packages are loaded if not already, so if you have specific settings for these packages, load this package after: \texttt{ {booktabs}, {multirow}, @@ -186,7 +189,6 @@ To add a column that should be surrounded by brackets for \cmd{siunitx} purposes S is included by default. -\newpage \subsection{Examples} @@ -350,11 +352,14 @@ Concering \cmd{longtable}s: If \cmd{reset} is set to \cmd{true}, resets the row counter to \cmd{resetnum}, to ensure you have the same X number of rows after the header of each page of a \cmd{longtable}.\\ The starred version of first reverts the settings to default, then loads your inputted settings, which the non-starred version only overwrites the settings specified. \cmd{\setmidruleX*{}} will restore to default. +Use optional parameter \cmd{\setmidruleX*[o|n|f]{}} +to control expansion of the key-val settings (\cmd{[n]} for not expanded is default). Before you want counting to begin, you should apply \cmd{\resetmidruleX} to avoid header rows being counted. Use \cmd{\noalign{\resetmiduleX}} if you need place a rule on the same line the reset takes place, or in a cell before \cmd{\\}. Note that \cmd{\resetmidruleX} resets the row counter to 0, and is in effect, a short-cut for \cmd{\setmidruleX{}} or \cmd{\setmidruleX{cntr=0}} + % %\begin{tabular}{l@{\luadirect{tex.print('\\midrule')}}} % Hello \\ @@ -395,7 +400,7 @@ Num & . & . & . \\ Here's an example with long table. Notice the gray rules reliably appear 3 rows after each header. \begin{verbatim} -\setmidruleX{reset=true,resetnum=0} +\setmidruleX{reset=true,resetnum=0,rule="\gcmidrules{1r,2-}"} \def\tblhead{\toprule No & Name & Place & other\\\midrule} \def\tblcontinued{\MC[+l]{Continued...}\\} \def\tblcontinues\MC[+r]{...Continues}\\} @@ -421,13 +426,13 @@ Here's an example with long table. Notice the gray rules reliably appear 3 rows 14 & & & \\ 15 & & & \\\newpage 16 & & & \\ -17 & & & \\\resetmidruleX -18 & & & \\ +17 & & & \\ +18 & & & \\\resetmidruleX 19 & & & \\ \end{longtable} \end{verbatim} -\setmidruleX{reset=true,resetnum=0} +\setmidruleX{reset=true,resetnum=0,rule="\gcmidrules{1r,2-}"} \def\tblhead{\toprule No & Name & Place & other\\\midrule} \def\tblcontinued{\MC[+l]{Continued...}\\} \def\tblcontinues{\MC[+r]{...Continues}\\} @@ -459,4 +464,7 @@ Here's an example with long table. Notice the gray rules reliably appear 3 rows \end{longtable} +\LTXtable{\linewidth}{ltxexample} + + \end{document} |