Giter Site home page Giter Site logo

Comments (9)

cmhughes avatar cmhughes commented on July 22, 2024

The actual/given output should be tex code, not a screen shot.

from latexindent.pl.

Mikachu2333 avatar Mikachu2333 commented on July 22, 2024

The actual/given output should be tex code, not a screen shot.

The MWE is also what latexindent output show.

from latexindent.pl.

cmhughes avatar cmhughes commented on July 22, 2024

from latexindent.pl.

Mikachu2333 avatar Mikachu2333 commented on July 22, 2024
[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.

cmhughes avatar cmhughes commented on July 22, 2024

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.

Mikachu2333 avatar Mikachu2333 commented on July 22, 2024

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.

cmhughes avatar cmhughes commented on July 22, 2024

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.

Mikachu2333 avatar Mikachu2333 commented on July 22, 2024

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.

Mikachu2333 avatar Mikachu2333 commented on July 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.