-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Two small improvements for named indexes U-Z #385
Conversation
I think it will bring more and more troubles if a package starts to correct wrong user inputs: to me |
@muzimuzhi Could you help to confirm that l3build doesn't normalize end-of-line characters in |
It depends on how intelligent the language/package want to be. Named indexes U-Z are already part of that intelligence, and child selectors a family of another. For example >>> a = [1,2,3]
>>> a[-10:-1]
[1, 2]
>>> a[-10:10]
[1, 2, 3] Currently \documentclass{article}
\usepackage{tabularray}
\begin{document}
% `cell{-}{Y-Z}` works
\begin{tblr}{
hlines, vlines,
cell{-}{1-X}={preto=x}
}
& & & \\
\end{tblr}
% `cell{-}{U-Z}` explodes
\begin{tblr}{
hlines, vlines,
% U = -6, Z = -1, four-column table
cell{-}{U-X}={preto=x}
}
& & & \\
\end{tblr}
\end{document} throws low level error and the non-positive index is treated as zero. (In either way a fallback index is used.)
Thus I suggest to give a more helpful error message and (still) use 1 as fallback value. Update: Then this seems to introduce a new message named |
Just guessing, |
See |
It's OS specific. Windows uses CRLF while *-nix tends to use LF, see https://www.wikiwand.com/en/Newline#Representation. As I appended to #385 (comment),
and GitHub also provides a setting to hide whitespace when reviewing. I will try with git configs and perhaps push a commit to use CRLF. |
I always turn off this But l3build is missing this feature. Maybe someday I will add some code to |
you could open an issue at L3build |
I was wrong by using wrong patterns |
Seems it's not always like this, for example front-end tools EOL are special characters that are (almost) transparent to human and most modern programs that read in files, and perhaps only meaningful for softwares that compute file checksums or do file comparisons. So it's not too bad for git to touch EOLs. |
Currently,
cell{-}{U-Z}={preto=x}
, but only in to-part of child selectorsodd/even
. Thuscell{-}{even[2-Z]}={preto=x}
is supported butcell{-}{even[X-Z]}={preto=x}
is not.This PR adds support for from-part of
odd/even
selectors and ensures the converted indexes are at least 1.