Closed jtl5770 closed 2 years ago
The distance between the border lines is controlled by rulesep
option. The positons of hlines with leftpos
/rightpos
set to 0
can be improved in the future. But I will not touch pos=0.5
case.
Just for reference: To achieve a double rule border, the "official way" is like I did it (minus the 0.5 thing, just forget about that)?
Is it really the hline that is positioned wrong, or could it also be the vline? I am just wondering how and why the inner border bottom left/right seem to be OK, while top left/right is clearly buggy.
I understood the rulesep
now. Can this be controlled for specific rules, or only globally for a table?
Is it really the hline that is positioned wrong, or could it also be the vline? I am just wondering how and why the inner border bottom left/right seem to be OK, while top left/right is clearly buggy.
Yes, it maybe vlines which cause the problem.
I understood the rulesep now. Can this be controlled for specific rules?
Sorry, but I don't want to make source code even more complicated by doing this.
Sorry, but I don't want to make source code even more complicated by doing this.
Yes, I can understand that. I assume that everything completely fancy can be done once we have some tikz
integration running.
I will fix the inconsistent positioning of abovepos
and belowpos
in issue #272.
I don't see the problem solved with the latest version (2023A) and the inner line of a double rule. I use the following, slightly reduced code (only two instead of three lines)
\documentclass{article}
\usepackage{tabularray}
\begin{document}
\begin{tblr}{
hline{1} = {1}{-}{rightpos=1, leftpos=1},
hline{1} = {2}{-}{rightpos=0, leftpos=0},
hline{4} = {1}{-}{rightpos=0, leftpos=0},
hline{4} = {2}{-}{rightpos=1, leftpos=1},
vline{1} = {1}{-}{abovepos=1, belowpos=1},
vline{1} = {2}{-}{abovepos=0, belowpos=0},
vline{4} = {1}{-}{abovepos=0, belowpos=0},
vline{4} = {2}{-}{abovepos=1, belowpos=1},
}
Alpha & Beta & Gamma \\
One & Two & Three \\
Tic & Tac & Toe \\
\end{tblr}
\end{document}
and, looking at the result in a high enough magnification one can still see the error at the joints of the inner line
Unfortunately I don't see how I can reopen the issue - I hope it is not lost completely now...
This works by design. You need to set the correct position values for either hlines or vlines: 0.4/(0.4*2+2)=0.14 from rulewidth=0.4pt and rulesep=2pt.
\documentclass{article}
\usepackage{tabularray}
\begin{document}
\begin{tblr}{
hline{1} = {1}{-}{rightpos=1, leftpos=1},
hline{1} = {2}{-}{rightpos=0.14, leftpos=0.14},
hline{4} = {1}{-}{rightpos=0.14, leftpos=0.14},
hline{4} = {2}{-}{rightpos=1, leftpos=1},
vline{1} = {1}{-}{abovepos=1, belowpos=1},
vline{1} = {2}{-}{abovepos=0, belowpos=0},
vline{4} = {1}{-}{abovepos=0, belowpos=0},
vline{4} = {2}{-}{abovepos=1, belowpos=1},
}
Alpha & Beta & Gamma \\
One & Two & Three \\
Tic & Tac & Toe \\
\end{tblr}
\end{document}
Oh... wow.
First of all - thanks for the hint. And nice that there is a way to make it work without pure guessing and trying of random values. But - and I mean this in the most polite way possible - this seems to be such a huge level of internal knowledge necessary for the "normal" user for achieving a simple double rule... Is there no way to provide an interface that is a bit more oriented towards the average user? Maybe the optimal way would be not having to use multiple hline and vline expressions per side in the first place, and express the double rules as a style to a single hline and vline...
Anyway - thanks for this great package
It seems to me the current semantics of xxxpos
options are not convenient enough when there are multiple rules in the other direction.
Current semantics: https://github.com/lvjr/tabularray/blob/e5f340b1f8a60b7b24acdf02991cf0a29811426a/tabularray.tex#L776-L780 Then
abovepos=1
the vline for the first row has length full cell height + 1st hline width + double sep + 2nd hline width
, the 2nd hline width
is counted,abovepos=0
the corresponding vline only has length full cell height
, 1st hline width
is not counted.A set of more powerful xxxpos
-like options are welcome, for example for vline{1}={1-1}{aboveNpos=<n>}
<n> ::= "-1" (* len = full cell height - row above sep *)
| "0" (* len = full cell height *)
| "0+" (* len = full cell height + 1st hline width *)
| "1" (* len = full cell height + 1st hline width + double sep *)
| "1+" (* len = full cell height + 1st hline width + double sep + 2nd hline width, if the 2nd hline exists *)
| "n" (* len = full cell height + sum(1st to nth hline width) + n * double sep *)
| "n+" (* len = full cell height + sum(1st to (n+1)th hline width) + n * double sep *)
;
```tex
\documentclass{article}
\usepackage{tabularray}
\usepackage{xcolor}
\begin{document}
\rulewidth=3pt
\verb|abovepos| with single rule\par
\begin{tblr}{
cells={bg=cyan!20},
vline{1}={abovepos=1},
vline{2}={abovepos=0},
vline{3}={abovepos=-1},
hline{1}={2}{2-Z}{fg=cyan!30!black!50, leftpos=-1, endpos},
}
Alpha & Beta & Gamma \\
\end{tblr}
\bigskip
\verb|abovepos| with multiple rules\par
\begin{tblr}{
cells={bg=cyan!20},
vline{1}={abovepos=1},
vline{2}={abovepos=0},
vline{3}={abovepos=-1},
hline{1}={1}{1-Z}{fg=cyan!30!black!50, leftpos=-1, endpos},
hline{1}={2}{2-Z}{fg=cyan!30!black!50, leftpos=-1, endpos},
}
Alpha & Beta & Gamma \\
\end{tblr}
\bigskip
suppose there's \verb|aboveNpos=
I am planning to drop support for multiple border lines and border text in future Lua rewriting (see #250). But old TeX code will stay unchanged.
my MWE to demonstrate the problem I see is
resulting in
First of all - is this the intended way to achieve the triple (or double) border? If no, all the rest of this post (and maybe the bug reported) may be invalid...
Possible bug: compare the upper left and upper right corner of the inner hline/vline - there seems to be missing a couple of pixels. All other corners, even the bottom left/right of the inner hline/vline seem to be correct. This seems to be a bug, or I may have missed or misused an option?
Additional question: Is there a way to selectively (or even globally) influence the distance between the border lines?