-
Notifications
You must be signed in to change notification settings - Fork 85
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
the future of multirows in _tabularray_ package would let latexindent format the code incorrectly #543
Comments
The |
The MWE is also what latexindent output show. |
latexindent gives text output, not images
…On Fri, 10 May 2024, 12:51 Mikachu2333, ***@***.***> wrote:
The actual/given output should be tex code, not a screen shot.
The MWE is also what latexindent output show.
—
Reply to this email directly, view it on GitHub
<#543 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQ7CYAOOPXGV57JBG6YVFDZBSYF5AVCNFSM6AAAAABHQOM2FOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBUGQ3TIMRVGU>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Latex output after latexindent formatted.
|
When I start with \documentclass{ctexrep}%Chinese report
\usepackage{tabularray}%tabular
\begin{document}
\begin{tblr}{
cells={c,m},
hlines,
vlines,
}
AAAAAAA & BBBBBBB \\
c & {f \\g} \\ %multirows
d & h \\
e & {i \\j} %multirows
\end{tblr}
\end{document} and run
then I receive
which is what I would expect. |
I apologize for not understanding what you said and answering irrelevantly. What i input\documentclass{ctexrep}%Chinese report
\usepackage{tabularray}%tabular
\begin{document}
\begin{tblr}{
cells={c,m},
hlines,
vlines,
}
AAAAAAA & BBBBBBB \\
c & {g\\h} \\ %multirows (g&h)
d & i \\
{e\\f} & j %multirows (e&f)
\end{tblr}
\end{document} Command I uselatexindent main.tex --modifylinebreaks --GCString --yaml=defaultIndent: ' ' Latexindent output(Success without error or warning as yours) \documentclass{ctexrep}%Chinese report
\usepackage{tabularray}%tabular
\begin{document}
\begin{tblr}
{
cells={c,m},
hlines,
vlines,
}
AAAAAAA & BBBBBBB \\
c & {g \\h} \\
d & i \\
{e \\f} & j
\end{tblr}
\end{document} BUT What I want(Same as what i input, want latexindent understand the multirow style cell and normal cell) \documentclass{ctexrep}%Chinese report
\usepackage{tabularray}%tabular
\begin{document}
\begin{tblr}{
cells={c,m},
hlines,
vlines,
}
AAAAAAA & BBBBBBB \\
c & {g\\h} \\ %multirows (g&h)
d & i \\
{e\\f} & j %multirows (e&f)
\end{tblr}
\end{document} |
Thanks, that's clear. I think we need a new feature to specify the double back slash regex within each lookForAlignDelims field. Leave it with me, I hope to get to it soon, but time is pressured for me at the moment. |
Thanks for timely answer! Please prioritize your own tasks. This issue is just a improvement, not an extremely harmful crash or bug, there's no need to rush to finish it. |
RE-Update:Still unresolved when the last line contains multirows although the command below has been used Original/After formatted \begin{tblr}[
long
]{
vlines,
hlines,
}
{A & Z} & B \\ %multirow
C & {D \\E} %multirow
\end{tblr} What I want \begin{tblr}[
long
]{
vlines,
hlines,
}
{A & Z} & B \\ %multirow
C & {D \\E} %multirow
\end{tblr} YAML modifyLineBreaks:
condenseMultipleBlankLinesInto: 2
optionalArguments:
tblr:
OptArgBodyStartsOnOwnLine: 1 # -1,0,1,2,3,4
lookForAlignDelims:
tblr:
alignFinalDoubleBackSlash: 1
#dontMeasure: largest
multiColumnGrouping: 1
fineTuning:
keyEqualsValuesBracesBrackets:
name: |-
(?x)
[a-zA-Z@\*0-9_\/.:\#-]+
(?:
[a-zA-Z@\*0-9_\/.\h:\#-]
\{
[a-zA-Z@\*0-9_\/.\h:\#-,]+?
\}
)*?
defaultIndent: " " |
RE-Re-update: Add some examples.MWE (After formatted):% !TeX encoding = UTF-8
% !TEX TS-program = lualatex
\documentclass[a4paper,12pt]{ctexrep}
\usepackage{hyperref}
\usepackage{tabularray}
\begin{document}
\begin{table}
\centering
\begin{tblr}[
tall,
note{$\dag$} = {Comment for tblr.},
]{
hlines,vlines,
cells={c,m},
row{1,3} = {10ex},
row{7} = {7ex},
}
{%
\href{127.0.0.1}{row1 line1} \\
\href{127.0.0.1}{row1 line2} \\
\href{127.0.0.1}{row1 line3}%
} \\
{row2 line4}\TblrNote{$\dag$} \\
{%
\href{127.0.0.1}{row3 line5 (1)}、% This is because the line is too long to edit so i use "%" to break it.
\href{127.0.0.1}{row3 line5 (2)} \\
\href{127.0.0.1}{%This is becasue the content of the cell is too long to be indented.
row 3 line6 (1) longlong%
longlonglonglonglong%
}、%
\href{127.0.0.1}{row3 line6 (2)} \\
\href{127.0.0.1}{%
row3 line7}%
} \\
{row4 line8} \\
{%
{%
\href{127.0.0.1}{row5 line9}%
}
} \\
\end{tblr}
\end{table}
\end{document}
Latexindent output info and Args I use:log
args All default except What I want:% !TeX encoding = UTF-8
% !TEX TS-program = lualatex
\documentclass[a4paper,12pt]{ctexrep}
\usepackage{hyperref}
\usepackage{tabularray}
\begin{document}
\begin{table}
\centering
\begin{tblr}[
tall,
note{$\dag$} = {Comment for tblr.},
]{
hlines,vlines,
cells={c,m},
row{1,3} = {10ex},
row{7} = {7ex},
}
{%
\href{127.0.0.1}{row1 line1} \\
\href{127.0.0.1}{row1 line2} \\
\href{127.0.0.1}{row1 line3}%
} \\
{row2 line4}\TblrNote{$\dag$} \\
{%
\href{127.0.0.1}{row3 line5 (1)}、% This is because the line is too long to edit so i use "%" to break it.
\href{127.0.0.1}{row3 line5 (2)} \\
\href{127.0.0.1}{%This is becasue the content of the cell is too long to be indented.
row 3 line6 (1) longlong%
longlonglonglonglong%
}、%
\href{127.0.0.1}{row3 line6 (2)} \\
\href{127.0.0.1}{%
row3 line7}%
} \\
{row4 line8} \\
{%
{%
\href{127.0.0.1}{row5 line9}%
}
} \\
\end{tblr}
\end{table}
\end{document}
|
When using the tabularray package to merge cells (multiple rows), latexindent always incorrectly recognizes multiple rows cells.
MWE (After formatted)
yaml settings
No changes have been made except
defaultindent: 4spaces
. Others have no impact on the results.actual/given output
Success with no error
desired or expected output
The text was updated successfully, but these errors were encountered: