Comments (9)
The actual/given output
should be tex code, not a screen shot.
from latexindent.pl.
The
actual/given output
should be tex code, not a screen shot.
The MWE is also what latexindent output show.
from latexindent.pl.
from latexindent.pl.
[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}
from latexindent.pl.
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.
from latexindent.pl.
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 use
latexindent 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}
from latexindent.pl.
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.
from latexindent.pl.
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.
from latexindent.pl.
RE-Update:
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: " "
from latexindent.pl.
Related Issues (20)
- Could latexindent.pl provide appropriate spaces and text wraps before or after math operators? (sounds like many formatters doing for Python or C language) HOT 3
- Indentation in tabular* HOT 3
- Contextual `sentencesBeginWith`, semicolons, lowercase and `\paragraph` HOT 2
- Unknown error "���" HOT 21
- [Feature] More friendly support for CJK words (characters) HOT 18
- [latexindent.exe] -GCString switch cannot run normally HOT 2
- Exclude `table` and `tabular` from indentation HOT 3
- Feature Request: Support spreadtab block HOT 4
- can't run it, neither after `tlmgr` nor as a Perl script HOT 4
- Error "Can't open file" when using `-g` key with nontrivial path HOT 3
- [windows] conda installation fail due to perl version HOT 6
- Format tabular for fullwidth fonts HOT 2
- [Bug] Incorrect indentation amount when have a long config with tabualrray package HOT 7
- Can't find string terminator '"' error - bug? HOT 7
- Indenting of tikz arrow specification HOT 4
- Incorrect encoding (possiblely due to #505) HOT 3
- Error when specifiying `lookForAlignDelims` in command line HOT 3
- text wrapping comment text to 3 HOT 6
- Additional indentation in text after displaymath when textWrapOptions when is set to after
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from latexindent.pl.