lvjr / tabularray Goto Github PK
View Code? Open in Web Editor NEWTypeset tabulars and arrays with LaTeX3
Home Page: https://ctan.org/pkg/tabularray
Typeset tabulars and arrays with LaTeX3
Home Page: https://ctan.org/pkg/tabularray
Package: Typeset tabulars and arrays with LaTeX3 Copyright: 2021-2024 (c) Jianrui Lyu <[email protected]> CTAN: https://ctan.org/pkg/tabularray Repository: https://github.com/lvjr/tabularray Repository: https://bitbucket.org/lvjr/tabularray License: The LaTeX Project Public License 1.3c
At this moment, we can typeset long tables without heads or foots by setting long
option in tblr
environment. It's rather slow (see #7), and lacks many functions. Still need much more work.
For tblr and other tabular environments, adding square brackets to cells makes latex think you're passing an argument to line breaks \\
or to hline
. This can be avoided by adding \relax
, but doing this in tblr makes the first column cells appear merged together into one long cell for some reason. For example,
\begin{tblr}{c|cccc}
\times & [1] & [2] & [3] & [4]\\\relax
\hline\relax
[1] & [1] & [2] & [3] & [4]\\\relax
[2] & [2] & [4] & [1] & [3]\\\relax
[3] & [3] & [1] & [4] & [2]\\\relax
[4] & [4] & [3] & [2] & [1]
\end{tblr}
causes the first column to be bunched up like [1][2][3][4]
. Is there a better workaround for this situation for tabularrays?
For long tables, it would be great if I could make the width/thickness of the rules encompassing the first header different from those of the repeated headers. Also, the same is desired for the repeated footers and last footer.
Originally posted by zandivx July 13, 2021
When defining new tabularray environments with \NewTblrEnviron I often find myself copying and pasting existing definitions of other environments I've created earlier. I think it would be a great option to be able to refer to existing environments and inherit their options (something like \UseTblrTemplate but for environments).
Is there a way to set the font for any given row, column, or cell?
My use-case is that I want to set
\tableheaderfont\color{white}
for the first row.
Suppose that you have a table where column 3 should be made of images. So you set cmd=\includegraphids
for column{3}
, so that you only have to type in the file name. Now, obviously, the table header(the 1st row) should have regular text in column 3. However there seems to be no way to get rid of the default command defined before. For instance row{1}={cmd={}}
does not help.
A great job, thank you very much.
The tblr works for tabular/array very well. But it doesn't work for expl3 int loop or macro which is tablr contents.
The MWE:
\documentclass{ctexart}
\usepackage{expl3}
\usepackage{tabularray}
\newcommand\tabcontents{
20 & 30 & 40\\
50 & 60 & 70\\
}
\begin{document}
% Work Well!
\ExplSyntaxOn
\begin{tabular}{|c|c|c|}
\hline
\int_step_inline:nn {3}{
\int_step_inline:nn {3}{
a(#1,~##1)
\int_compare:nNnT {##1} < {3}{ & }
}
\int_compare:nNnT {#1} < {3}{\\ \hline}
}
\\ \hline
\end{tabular}
\ExplSyntaxOff
% Doesn't Work!
% \ExplSyntaxOn
% \begin{tblr}{|c|c|c|}
% \hline
% \int_step_inline:nn {3}{
% \int_step_inline:nn {3}{
% a(#1,~##1)
% \int_compare:nNnT {##1} < {3}{ & }
% }
% \int_compare:nNnT {#1} < {3}{\\ \hline}
% }
% \\ \hline
% \end{tblr}
% \ExplSyntaxOff
% Work Well!
\begin{tabular}{|c|c|c|}
\hline
\tabcontents
\hline
\end{tabular}
% Work Well!
\begin{tblr}{|c|c|c|}
\hline
20 & 30 & 40\\
50 & 60 & 70\\
\hline
\end{tblr}
% Doesn't Work!
% \begin{tblr}{|c|c|c|}
% \hline
% \tabcontents
% \hline
% \end{tblr}
\end{document}
When we specify entry=none
, no entry will be write to the List of Tables. And when we specify label=none
, the package will set caption-tag
template to empty
, not create hyper target, and not increase the table
counter.
Therefore entry=none
is the same as \caption[]{text}
in longtable
package, and entry=none,label=none
is the same as \caption*{text}
except for the counter.
Heading A, B ,C below as well as "-" in the second row should be centred as in the example with tabular
. Note: table-text-alignment
option doesn't seem to have any effect.
\documentclass{article}
\usepackage{tabularray}
\UseTblrLibrary{booktabs}
\UseTblrLibrary{siunitx}
\begin{document}
\section{Wrong alignment}
\begin{tblr}{
colspec={
S[table-format=2.2]
S[table-format=2.2, table-text-alignment=right]
S[table-format=2.2]
}
}
{{{A}}} & {{{B}}} & {{{C}}} \\
11 & 11 & 11 \\
2.1 & 2.2 & {{{-}}} \\
33.11 & 33.22 & 33.33 \\
\end{tblr}
\section{Correct alignment}
\begin{tabular}{
S[table-format=2.2]
S[table-format=2.2, table-text-alignment=right]
S[table-format=2.2]
}
{A} & {B} & {C} \\
11 & 11 & 11 \\
2.1 & 2.2 & {-} \\
33.11 & {{{-}}} & 33.33 \\
\end{tabular}
\end{document}
In the following MCE, the first tabular is said to have a too small width: "need 16.45273pt more!" and, indeed, the second one is OK.
\documentclass{article}
\usepackage{tabularray}
\begin{document}
\noindent%
\begin{tblr}{colspec={p{\linewidth-2\rulewidth-2\tabcolsep}},vlines,colsep=5mm}
Foobar
\end{tblr}
\noindent%
\begin{tblr}{colspec={p{\linewidth-2\rulewidth-2\tabcolsep-16.45273pt}},vlines,colsep=5mm}
Foobar
\end{tblr}
\end{document}
But I cannot understand where this 16.45273pt
is coming from and the following attempt to retrieve the colsep
dimension fails (in the second tabular, leftsep
and rightsep
are claimed to be 14.22636pt
and @vline-width
is claimed to be 0.4pt
).
\documentclass{article}
\usepackage{tabularray}
\begin{document}
\noindent%
\ExplSyntaxOn
\dim_new:N \l_leftsep_dim
\dim_new:N \l_rightsep_dim
\dim_new:N \l_vline_width_dim
\begin{tblr}{rowspec={Q[c,m]},colspec={p{\linewidth-2\rulewidth-2\tabcolsep}},vlines,hlines}
\dim_set:Nn \l_leftsep_dim {
\__tblr_prop_item:ne {column} { [\l__tblr_j_tl] / leftsep}
}
\dim_show:N \l_leftsep_dim
\dim_set:Nn \l_rightsep_dim {
\__tblr_prop_item:ne {column} { [\l__tblr_j_tl] / rightsep}
}
\dim_show:N \l_rightsep_dim
\dim_set:Nn \l_vline_width_dim {
\__tblr_prop_item:ne {vline} { [\l__tblr_j_tl] / @vline-width }
}
\dim_show:N \l_vline_width_dim
Foobar
\end{tblr}
\par
\noindent%
\begin{tblr}{rowspec={Q[c,m]},colspec={p{\linewidth-2\rulewidth-2\tabcolsep-16.45273pt}},vlines,hlines,colsep=5mm}
\dim_set:Nn \l_leftsep_dim {
\__tblr_prop_item:ne {column} { [\l__tblr_j_tl] / leftsep}
}
\dim_show:N \l_leftsep_dim
\dim_set:Nn \l_rightsep_dim {
\__tblr_prop_item:ne {column} { [\l__tblr_j_tl] / rightsep}
}
\dim_show:N \l_rightsep_dim
\dim_set:Nn \l_vline_width_dim {
\__tblr_prop_item:ne {vline} { [\l__tblr_j_tl] / @vline-width }
}
\dim_show:N \l_vline_width_dim
Foobar
\end{tblr}
\ExplSyntaxOff
\end{document}
Is it possible, when colsep
(or either leftsep
or rightsep
) is set, to get the dimension which has to be subtracted to the tabular width in order to get the same width as when colsep
is not used?
As far as I can see the environment:
\begin{tblr*}
does not yet work, any plans for this?
At this time we only use \pagetotal
in splitting long tables. Should we need to use \pageshrink
too? Need decision.
%!TeX encoding = UTF-8
%!TEX program = xelatex
\documentclass[]{article}
\usepackage{geometry}
\geometry{a4paper,left=1.9cm,right=1.9cm,bottom=2.5cm,top=3cm}
\usepackage{xeCJK}
\usepackage{tabularray}
\usepackage[table]{xcolor}
\begin{document}
\begin{flushleft}
\begin{longtblr}{colspec={Q[c,m,3.4cm]Q[m,13cm]},
column{1}={orange},
hlines,vlines,rowhead=1}
title1&title2\\
\SetCell[r=4]{c} title3 & As a matter of fact, the symbolic meaning the picture conveys is deep and profound. Naturally and necessarily, there are two major ways coping with this problem. \\
& The first way to tackle it is to appeal to authorities to take measures. Once achieving the success of solving the problem, the whole society also thrives/makes progress. \\
& Solving the problem can accelerate better individuals’development. The other way that is worth adopting is to work out new laws. \\
& Where there are better laws, there are more hopes, vitality and development. These advisable laws eventually brings economic prosperity and social harmony. Finally, I can safely come to the conclusion that it is high time we enhanced the awareness of people that is every vital to us. Only by these means can we succeed in solving the problem in the near future.(1 Therefore, measures should be taken to terminate the ridiculous affair. First and foremost, governments should establish some regulations to prohibit enterprises and people from making such misdeeds. What’s more, people should get ready to pass criticism upon such misdeeds anytime and anywhere. After all, it is necessary to develop our society by performing hard work instead of talking nonsense. \\
\SetCell[r=4]{c} title3 & As a matter of fact, the symbolic meaning the picture conveys is deep and profound. Naturally and necessarily, there are two major ways coping with this problem. \\
& The first way to tackle it is to appeal to authorities to take measures. Once achieving the success of solving the problem, the whole society also thrives/makes progress. \\
& Solving the problem can accelerate better individuals’development. The other way that is worth adopting is to work out new laws. \\
& Where there are better laws, there are more hopes, vitality and development. These advisable laws eventually brings economic prosperity and social harmony. Finally, I can safely come to the conclusion that it is high time we enhanced the awareness of people that is every vital to us. Only by these means can we succeed in solving the problem in the near future.(1 Therefore, measures should be taken to terminate the ridiculous affair. First and foremost, governments should establish some regulations to prohibit enterprises and people from making such misdeeds. What’s more, people should get ready to pass criticism upon such misdeeds anytime and anywhere. After all, it is necessary to develop our society by performing hard work instead of talking nonsense. \\
\SetCell[r=4]{c} title3 & As a matter of fact, the symbolic meaning the picture conveys is deep and profound. Naturally and necessarily, there are two major ways coping with this problem. \\
& The first way to tackle it is to appeal to authorities to take measures. Once achieving the success of solving the problem, the whole society also thrives/makes progress. \\
& Solving the problem can accelerate better individuals’development. The other way that is worth adopting is to work out new laws. \\
& Where there are better laws, there are more hopes, vitality and development. These advisable laws eventually brings economic prosperity and social harmony. Finally, I can safely come to the conclusion that it is high time we enhanced the awareness of people that is every vital to us. Only by these means can we succeed in solving the problem in the near future.(1 Therefore, measures should be taken to terminate the ridiculous affair. First and foremost, governments should establish some regulations to prohibit enterprises and people from making such misdeeds. What’s more, people should get ready to pass criticism upon such misdeeds anytime and anywhere. After all, it is necessary to develop our society by performing hard work instead of talking nonsense. \\
\end{longtblr}
\end{flushleft}
\end{document}
Originally posted by cdacl August 3, 2021
According to the documentation of tabularray package, we can use hlines={}{}{} in mandatory argument to type more hlines/vlines. But I can't change the index order, for example:
\begin{tblr}{
hlines = {2}{-}{red5},
hlines = {1}{-}{blue5},
}
Alpha & Beta & Gamma & Delta \\
Epsilon & Zeta & Eta & Theta \\
Iota & Kappa & Lambda & Mu \\
\end{tblr}
The red line was missed.
In issue #8 I read:
At this moment, we can typeset long tables without heads or foots by setting long option in tblr environment.
are there any plans to support commands like \endhead
, \endfoot
, \endfirsthead
, \endlastfoot
?
I would like to be able to define a new command to generate table row content according to a defined scheme. In the old days I would do something like this in my class file:
\newcommand{\tabentry}[4]{
\printdate{#1} & #2 & (#3) & #4 \\
}
And in my documents:
\begin{tabu} % or whatever table package you were using
\tabentry{2021-05-12}{Alpha}{Beta}{Gamma Delta}
\tabentry{2021-06-01}{Epsilon}{Rho}{Phi Nu Mu}
\end{tabu}
But with tblr
I get a "misplaced alignment tab character &" error.
I tried my luck with \NewTableCommand
, but it seems that whatever I define is inserted at the beginning, or at the end of a row only. It seems \NewTableCommand
is for hline
-type use cases only?
When I escape the alignment tab as \&
or \string&
I get literal ampersands in the rendered output.
Also, the way of specifying the arguments to \NewTableCommand
seems to be quite specific to how it is used in tabularray
itself.
So I guess my ideal solution would be a way of using the standard \NewDocumentCommand
(or \NewExpandableDocumentCommand
if need be), and enjoy the power of xparse
, to define a function producing table row content.
I would not mind whether the \\
is inserted by the newly defined command (as shown i the example above), or in the table, btw.
At this moment tabularray
will keep row heights even if all cells in them are spanned, but it's not true for column widths. See the following example based on a question in tex.se:
\documentclass[11pt]{article}
\usepackage{tabularray}
\begin{document}
\noindent
\begin{tblr}{width=\textwidth,colsep=2pt,colspec={|*{16}{X[c]|}}}
\hline
\multicolumn{4}{|r|}{4}
& \multicolumn{4}{r|}{8}
& \multicolumn{4}{r|}{12}
& \multicolumn{4}{r|}{16}\\
\hline
\multicolumn{1}{|c|}{B/R}
& \multicolumn{5}{c|}{Msg-Type}
& \multicolumn{5}{c|}{Src-Addr}
& \multicolumn{5}{c|}{Dest-Addr}\\
\hline
\multicolumn{16}{|c|}{Fletcher-16 Checksum}\\
\hline
\multicolumn{8}{|c|}{Payload-Length in Bits}
& \multicolumn{8}{c|}{Payload max. 28 Byte}\\
\hline
\end{tblr}
\end{document}
This bug should be fixed before the next release.
Tabularray
package tried its best to support legacy \multicolumn
and \multirow
commands by doing some dirty hack. But from a question in tex.sx, it turns out that it's impossible to provide full support for these two commands, since these two commands conflict with the design of tabularray
package.
Therefore I have decided to mark \multicolumn
and \multirow
as obsolete, and will remove them in version 2022. To make multicolumn or multirow cells, it's better to use \SetCell
command in old interfaces, or cell{i}{j}
in new interfaces.
Also, for backwards compatibility, I will include the last 2021 version of tabularray
as tabularray-2021.sty
in future releases for many years. Users could still use it for their old documents by \usepackage{tabularray-2021}
.
At present, tabularray
package redefines table commands such as \hline
inside the tblr
environment. But it causes potential problems if there is a nesting tabular
or array
environment inside it. For example:
\documentclass{article}
\usepackage{tabularray}
\begin{document}
\begin{tblr}{c}
\hline
Cell Text \\
\hline
$\begin{array}{c}
\hline
a+b \\
\hline
\end{array}$ \\
\hline
\end{tblr}
\end{document}
Maybe it is better to restore the definitions of table commands before building cell text.
We are working on a project to enhance LaTeX so that it can produce tagged pdf.
https://www.latex-project.org/news/2020/11/30/tagged-pdf-FS-study/
For a tabular this means that one need to add commands quite similar to html-table commands to cells and rows.
So to successfully tag a tabular, one needs at least
The code for the cells and rows should at best have access to data like the current row/column number.
It would be nice if tabularray would add suitable hooks for this.
May be not related to tabulararry
but when the table is ending at the bottom of a page, \newpage
add a not desired blank page (see example below).
\documentclass{article}
\usepackage{tabularray}
%\UseTblrLibrary{booktabs}
\usepackage{blindtext}
\begin{document}
\par\vspace{4cm}
\begin{longtblr}[
caption = {Table caption},
note{*} = {To be noted},
]{
colspec = {lcX},
}
%\toprule
%
\multicolumn{3}{l}{Row heading 1}\\
& Row subheading 1.1 &
\begin{minipage}[t]{\linewidth}
\blinditemize[20]
\end{minipage} \\
& Row subheading 1.2 &
\begin{minipage}[t]{\linewidth}
\blinditemize[20]
\end{minipage} \\
%
\multicolumn{3}{l}{Row heading 2}\\
& Row subheading 2.1 &
\begin{minipage}[t]{\linewidth}
\blinditemize[15]
\end{minipage} \\
& Row subheading 2.2 &
\begin{minipage}[t]{\linewidth}
\blinditemize[11]
\end{minipage} \\
\end{longtblr}
\newpage
Line after \verb+\newpage+.
\end{document}
It would be nice if we could use row{1-Y}={gray}
in inner specifications.
Now we have long
option for long tables similar to those in threeparttablex
package. We need another option tall
for short tables similar to those in threeparttable
package.
The compilation of the following file highlights several expl3
problems in the tabularray
's code (inconsistent local/global assignments and variables not declared).
\RequirePackage[check-declarations,enable-debug]{expl3}
\documentclass{article}
\usepackage{tabularray}
\begin{document}
\end{document}
The documentation mentions creating multiline cells using the following syntax: {text \\ in \\ multiple \\ lines}
.
Doing so works perfectly fine, but how can I change the font series/shape to bold, italics or small caps in such a multiline cell? The following MWE, that was tested using version 2021J and 2021K shows some attempts and their outcomes:
\documentclass{article}
\usepackage{tabularray}
\begin{document}
Use of \verb|\\| inside of \verb|\textit| leads to overly wide column:
\begin{tblr}{|l|l|}
text & {\textit{text \\ in \\ multiple \\ lines}} \\
\end{tblr}
Without \verb|\textit| the column width is calculated correctly:
\begin{tblr}{|l|l|}
text & {text \\ in \\ multiple \\ lines} \\
\end{tblr}
Using \verb|\itshape| instead of \verb|\textit| seems to solve the issue:
\begin{tblr}{|l|l|}
text & {\itshape text \\ in \\ multiple \\ lines} \\
\end{tblr}
Using \verb|\bfseries| or \verb|\scshape| results in overfull box warnings and wrong widths:
\begin{tblr}{|l|l|}
text & {\scshape text \\ in \\ multiple \\ lines} \\
\end{tblr}
\quad
\begin{tblr}{|l|l|}
text & {\bfseries text \\ in \\ multiple \\ lines} \\
\end{tblr}
Using \verb|\textbf|\ on each line individually does result in the expected output, but is somewhat inconvenient:
\begin{tblr}{|l|l|}
text & {\textbf{text} \\ \textbf{in} \\ \textbf{multiple} \\ \textbf{lines}} \\
\end{tblr}
\end{document}
Hi,
I am trying to get the minimal program from the homepage to run under texlive-2020:
\documentclass{article}
\usepackage{tabularray}
\begin{document}
\begin{tblr}{|lc|r|}
\hline
One & Two & Three \\
Four & Five & Six \\
\hline
Seven & Eight & Nine \\
\hline
\end{tblr}
\end{document}
Running this results in the following error on loading tabularray:
ERROR: Undefined control sequence.
--- TeX said ---
l.191 \NewDocumentCommand
\NewChildSelector { m O{0} o m }
--- HELP ---
TeX encountered an unknown command name. You probably misspelled the
name. If this message occurs when a LaTeX command is being processed,
the command is probably in the wrong place---for example, the error
can be produced by an \item command that's not inside a list-making
environment. The error can also be caused by a missing \documentclass
command.
nicematrix
use of names of the cells to play with TikZ for (even if this fine-tunings is used in some rare situations).
This could be a feature proposed only when using \UseTblrLibrary{tikz}
.
如题:功能已经能实现跨页了么?包括双栏情况下的跨页
Although I haven't done enough tests, I think floats will interfere with longtblr
in some situations. Also floats in the middle of a long tables look weird.
Maybe it is a good choice to clear all floats (but not create a new page) before building long tables? Or could we disable floats temporarily in the building process of long tables? Need decision.
See this question
https://tex.stackexchange.com/questions/608976/tabularray-math-columns-empty-cell-error
It seems it is better to provide $ option for Q column just as tabu
package.
\documentclass{standalone}
\usepackage{tabularray}
\NewColumnType{L}{>{$}l<{$}}
\begin{document}
\begin{tblr}{Ll}
a_i & b \\
& text \\
x_i & text \\
\end{tblr}
\end{document}
At this moment, you can use \diagbox
command of diagbox
package. But when rowsep
is larger than zero, the diagonal lines are in wrong positions. Furthermore we can not use \diagbox
command in math mode.
At this moment, tabularray
is able to recognize a \\*
command, but doesn't forbid a page break there. And It doesn't support \nopagebreak
and \pagebreak
commands. We need to implement these. But the optional arguments of \nopagebreak
and \pagebreak
commands seem useless in tabularray
, since we manually break long tables.
To get nice and clean table overlays in beamer
documents, we'd better also separate overlays code from table contents.
My current idea is to define a beamer
library for tabularray
, which modifes tblr
environment and adds an overlay
argument:
\begin{tblr}[outer]{inner}<overlay>
BODY
\end{tblr}
And then we can write pause=rows
or pause=columns
in the overlay
argument.
And furthermore we can write
onsilde{2-}={row{1}=gray8,cell{2}{3}=omit,hline{4}=omit}
.
We already have an undocumented omit
option with cells and hlines/vlines for multispan cells, and we can reuse it.
Not easy to implement this. Maybe in the future.
tabularray
seems to avoid overflowing contents of tall \multirow
cells by enlarging the height of the last row that the \multirow
cell spans. Is there already a way to instead evenly distribute the extra row height over all rows that the \multirow
cell spans or is such a feature planned?
Here is a MWE comparing the current output using tabularray
as well as two mock-up versions showing such an evenly distributed additional row height:
\documentclass{article}
\usepackage{tabularray}
\usepackage{multirow}
\begin{document}
\begin{tblr}{hlines,vlines, colspec={lp{3.25cm}}}
Column1 & Column2 \\
Row1 & \multirow{3}{=}{Long text that needs multiple lines. Long text that needs multiple lines. Long text that needs multiple lines.} \\
Row2 & \\
Row3 & \\
Row4 & short text \\
\end{tblr}
\bigskip
\begin{tabular}{|l|p{3.25cm}|}
\hline
Column1 & Column2 \\
\hline
Row1 & \multirow{6}{=}{Long text that needs multiple lines. Long text that needs multiple lines. Long text that needs multiple lines.} \\
&\\
\cline{1-1}
Row2 & \\
&\\
\cline{1-1}
Row3 & \\
&\\
\hline
Row4 & short text \\
\hline
\end{tabular}
\quad
\begin{tabular}{|l|p{3.25cm}|}
\hline
Column1 & Column2 \\
\hline
\multirow{2}{*}{Row1} & \multirow{6}{=}{Long text that needs multiple lines. Long text that needs multiple lines. Long text that needs multiple lines.} \\
&\\
\cline{1-1}
\multirow{2}{*}{Row2} & \\
&\\
\cline{1-1}
\multirow{2}{*}{Row3} & \\
&\\
\hline
Row4 & short text \\
\hline
\end{tabular}
\end{document}
Some related questions/comments:
https://tex.stackexchange.com/q/581298
https://tex.stackexchange.com/q/359003
https://tex.stackexchange.com/questions/343779/multirow-cell-content-overflows#comment843635_343779
To implement trim option for \cmidrule
of booktabs
library (see #41) and the functionality of hhline
package, we need to design new options leftpos
and rightpos
for hlines, abovepos
and belowpos
for vlines.
Each of the four new options will have three possible values (take hlines as an example):
-1: the hline doesn't touch any vlines;
0: the hline only touches the first vline;
1: the hline touches all the vlines.
As far as I can see the following is not yet possible
\begin{tblr}{*{3}{|X[-1]}|}
\caption{Complex table}
...
with the tabu package this was possible like:
\begin{longtabu}spread 0pt [c]{*{3}{|X[-1]}|}
\caption{Complex table}
...
Trim option for \cmidrule
is crucial to prevent the connection of the rule below column headings as for the rule below column headings "I" and "II" below:
From here.
In tabularray
version 2021H, intermal data is stored in several prop
lists. It's slow to read from and write to prop
lists when the table is large.
To make tabularray
run faster, we need to replace prop
lists with intarray
s in the future.
At present, we can try the faster intarray
s by the following code:
\ExplSyntaxOn
\bool_set_true:N \g__tblr_use_intarray_bool
\ExplSyntaxOff
Still need much more work.
My long table has only 2 rules. One at the top and one at the bottom. On page breaks, the top rule is repeated on every pages which is great. however the bottom is not. It would be great if the bottom rule could be repeated on every pages as for the top rule. Is there a way to achieve that (like a end row with only a rule)?
When I run the following example, parts "row subheading 2.1" and "row subheading 3.1" are missing and I got a blank page instead.
\documentclass{article}
\usepackage{tabularray}
\usepackage{blindtext}
\begin{document}
\par\vspace{4cm}
\begin{longtblr}[
caption = {Table caption},
note{*} = {To be noted},
]{
colspec = {lcX},
}
%
\multicolumn{3}{l}{Row heading 1}\\
& Row subheading 1.1 &
\begin{minipage}[t]{\linewidth}
\blinditemize[20]
\end{minipage} \\
& Row subheading 1.2 &
\begin{minipage}[t]{\linewidth}
\blinditemize[20]
\end{minipage} \\
%
\multicolumn{3}{l}{Row heading 2}\\
& Row subheading 2.1 &
\begin{minipage}[t]{\linewidth}
\blinditemize[20]
\end{minipage} \\
& Row subheading 2.2 &
\begin{minipage}[t]{\linewidth}
\blinditemize[20]
\end{minipage} \\
%
\multicolumn{3}{l}{Row heading 3}\\
& Row subheading 3.1 &
\begin{minipage}[t]{\linewidth}
\blinditemize[20]
\end{minipage} \\
& Row subheading 3.2 &
\begin{minipage}[t]{\linewidth}
\blinditemize[20]
\end{minipage} \\
\end{longtblr}
\end{document}
I want to include some graphics in tblr. I'd like to put a figure and the text in 2 rows and let them align at center vertically. My English is poor, so here is the mwe:
\documentclass{article}
\usepackage{tabularray}
\usepackage{graphicx}
\begin{document}
\begin{tblr}{
vline{2},
hlines,
row{1} = {c, m},
cell{1}{2} = {h},
cell{2}{2} = {m}
}
text & \includegraphics[width = 2cm]{example-image-a}\\
text & \includegraphics[width = 2cm]{example-image-b}\\
\end{tblr}
\end{document}
I want something like the image-a, but image-a's top and bottom's sep seems not same. How can I do this?
May be related with issue #39.
\documentclass{article}
\usepackage{tabularray}
%\UseTblrLibrary{booktabs}
\usepackage{blindtext}
\begin{document}
Blabla
% Whitespace in order to get section title on the top of the next page
% Issue: table is moved to page 3, leaving blank most of page 2
\par\vspace{18cm}
\section{Section 1}
\begin{longtblr}[
caption = {Table caption},
note{*} = {To be noted},
]{
colspec = {lcX},
}
%\toprule
%
\multicolumn{3}{l}{Row heading 1}\\
& Row subheading 1.1 &
\begin{minipage}[t]{\linewidth}
\blinditemize[20]
\end{minipage} \\
& Row subheading 1.2 &
\begin{minipage}[t]{\linewidth}
\blinditemize[20]
\end{minipage} \\
%
\multicolumn{3}{l}{Row heading 2}\\
& Row subheading 2.1 &
\begin{minipage}[t]{\linewidth}
\blinditemize[15]
\end{minipage} \\
& Row subheading 2.2 &
\begin{minipage}[t]{\linewidth}
\blinditemize[11]
\end{minipage} \\
\end{longtblr}
\end{document}
In fixing issue #15, I found another issue:
\documentclass[11pt]{article}
\usepackage{tabularray}
\begin{document}
\begin{tblr}{ll}
\hline
Src-Addr & Dest-Addr \\
\hline
\end{tblr}
\end{document}
The result is correct if we change font size to 10pt
or 12pt
.
The doc package (also also the fancyvrb package) allows to define |
as a short hand for the \verb
command.
This is used quite a lot e.g. in the LaTeX documentation.
If the array package is used this doesn't disturb uses of |
in tabular preambles, but tblr errors:
\documentclass{article}
\usepackage{doc,array}
\usepackage{tabularray}
\begin{document}
\MakeShortVerb| %from doc package
|\section|
\begin{tabular}{|l} %works
abc\\
\end{tabular}
\begin{tblr}{|l} %errors
abc \\
\end{tblr}
\end{document}
Here is my demand:
I use code below to make it:
\documentclass{article}
\begin{document}
\begin{tabular}{l}\hline
(1) a \\
\phantom{(1) }b\\\hline
\end{tabular}
\end{document}
I want to use tabularray
's multiline cell, so I type
\documentclass{article}
\usepackage{tabularray}
\begin{document}
\begin{tblr}{l}\hline
{(1) a \\ \phantom{(1)} b} \\\hline
\end{tblr}
\end{document}
It raised an error:
! Missing number, treated as zero.
<to be read again>
\protect
l.8 \end
{tblr}
?
After much try, I found that adding a space after b
can give an output without error. However there is extra space below b
:
\documentclass{article}
\usepackage{tabularray}
\begin{document}
\begin{tblr}{l}\hline
{(1) a \\ \phantom{(1)} b } \\\hline
\end{tblr}
\end{document}
Morevoer, an \hspace(*)
also leads to this error or space.
\documentclass{article}
\usepackage{tabularray}
\begin{document}
\begin{tblr}{l}\hline
{(1) a \\ b} \\\hline
{(1) a \\ \phantom{(1)} b } \\\hline
{(1) a \\ \hspace*{1em} b } \\\hline
{(1) a \\ \hspace{1em} b } \\\hline
\end{tblr}
\end{document}
Here is the listfiles
:
*File List*
article.cls 2021/02/12 v1.4n Standard LaTeX document class
size10.clo 2021/02/12 v1.4n Standard LaTeX file (size option)
tabularray.sty 2021-06-05 v2021K Typeset tabulars and arrays with LaTeX3
expl3.sty 2021-07-12 L3 programming layer (loader)
l3backend-pdftex.def 2021-07-12 L3 backend support: PDF output (pdfTeX)
xparse.sty 2021-06-18 L3 Experimental document command parser
***********
We use \hbox
to measure the widths of cells before building the whole table. But it seems enumerate inside a cell would cause an error. Need to find out if there are any solutions for it.
Hi-, I've notices a problem with hlines in a tabular with more than 10 columns... the hline fills only the 1st column.
With brackets in the hline param it's ok 👍
\begin{tblr}{hlines={0.45pt},vlines={0.45pt},hline{1-3}={1-{12}}{solid},columns={9mm,c}}
$s_i$ & $2$ & $3$ & $4$ & $5$ & $6$ & $7$ & $8$ & $9$ & $10$ & $11$ & $12$ \\
$p_i$ & $\frac{1}{36}$ & $\frac{2}{36}$ & $\frac{3}{36}$ & $\frac{4}{36}$ & $\frac{5}{36}$ & $\frac{6}{36}$ & $\frac{5}{36}$ & $\frac{4}{36}$ & $\frac{3}{36}$ & $\frac{2}{36}$ & $\frac{1}{36}$ \\
\end{tblr}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.