Open Mikachu2333 opened 3 months ago
The actual/given output
should be tex code, not a screen shot.
The
actual/given output
should be tex code, not a screen shot.
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 https://github.com/cmhughes/latexindent.pl/issues/543#issuecomment-2104474255, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQ7CYAOOPXGV57JBG6YVFDZBSYF5AVCNFSM6AAAAABHQOM2FOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBUGQ3TIMRVGU . You are receiving this because you commented.Message ID: @.***>
[13:08:15.182][Format][TeX] Start formatting with latexindent.
[13:08:15.182][Format][TeX] Checking latexindent: which latexindent
[13:08:15.187][Format][TeX] Checking latexindent is ok: /usr/local/texlive/2024/bin/x86_64-linux/latexindent
[13:08:15.188][Format][TeX] Formatting LaTeX. The command is latexindent:["--cruft=%WS1%/","%WS1%/__latexindent_temp_main.tex","--modifylinebreaks","--GCString","--yaml=defaultIndent: ' '"].
[13:08:15.311][Format][TeX] Formatted %WS1%/main.tex
Latex output after latexindent formatted.
\documentclass{ctexrep}%Chinese report
\usepackage{tabularray}%tabular
\begin{document}
\begin{tblr}
{
cells={c,m},
hlines,
vlines,
}
AAAAAAA & BBBBBBB \\
c & {f \\
g} \\
d & h \\
e & {i
\\j}
\end{tblr}
\end{document}
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
latexindent.pl myfile.tex
then I receive
\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}
which is what I would expect.
I apologize for not understanding what you said and answering irrelevantly.
\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}
latexindent main.tex --modifylinebreaks --GCString --yaml=defaultIndent: ' '
(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}
(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.
Still unresolved when the last line contains multirows although the command below has been used
lookForAlignDelims:tblr:alignFinalDoubleBackSlash: 1
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: " "
% !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}
log
[18:29:06.836][Format][TeX] Start formatting with latexindent.
[18:29:06.838][Format][TeX] Formatting LaTeX. The command is latexindent:["-c=%WS1%/","%WS1%/__latexindent_temp_main.tex","-m","--GCString"].
[18:29:06.942][Format][TeX] Formatted %WS1%/main.tex
args
All default except --GCString
arg
% !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![pkZrYy8.jpg](https://s21.ax1x.com/2024/05/10/pkZrYy8.jpg)
desired or expected output