1

My eventual goal is to use latexindent to justify paragraph text but not touch any material beginning with a \begin{align} and ending with an \end{align}. I'm not able to figure out how to do both simultaneously.

For example text use

Occaecat magna summis
mandaremus illum id quis
te proident a veniam.
Commodo a enim in ita
possumus in cupidatat,
excepteur quorum et quibusdam
adipisicing, ex nisi ubi
irure, de sint ne quae
ab officia iis malis hic
arbitror non sunt
pariatur, quorum mentitum ullamco.

Malis sed senserit est cillum aut et malis iudicem, et e legam dolor dolore, irure proident qui cupidatat ubi \begin{align} quamquam sempiternum & et laborum, qui cupidatat \ o quamquam, velit & nam o dolore ingeniis, nisi deserunt voluptatibus. \ Senserit do & voluptate a possumus noster \end{align} multos vidisse noster. Fore commodo ne ipsum culpa.

From the manual and experimentation I find that I can get single sentences justified, with each starting on the same line with

modifyLineBreaks
    oneSentencePerLine
        manipulateSentences: 1
        textWrapSentences: 1
    textWrapOptions
        columns: 75

This is close enough for my purposes. It has the side-effect that all my align environment text is considered part of a sentence and wrapped with the sentence. I can keep my \begin{align} and \end{align} from flowing with the sentence by adding the options

modifyLineBreaks
    environments:
        BeginStartsOnOwnLine: 1
        BodyStartsOnOwnLine: 1
        EndStartsOnOwnLine: 1
        EndFinishesWithLineBreak: 1

This does not, however, address the environment contents, which continue to be wrapped.

And this is where I get stuck. I've tried adding the option

modifyLineBreaks
    textWrapOptions:
        environments:
            align: 0

This has no apparent effect: the body of the align environment continues to be wrapped.

Adding the option

verbatimEnvironments:
    align: 1

keeps the align environment body from being wrapped but negates the effects of the BeginStartsOwnLine, etc. options.

These last few options also lead to odd behavior of the text following the \end{align}: i.e., the text isn't wrapped, or is only partially wrapped.

At this point I'm stuck. To reiterate: my goal is to

  • justify paragraph text
  • leave \begin{align} and \end{align} environment delimiters on their own lines
  • leave the body of align environments alone

I'd be satisfied with justified individual sentences if I could get align environment things to work; however, I'm stuck on that.

epR8GaYuh
  • 2,432
lsfinn
  • 123
  • hello! thanks for this. I think you've asked this on the repository page https://github.com/cmhughes/latexindent.pl/issues/211 so I think we can close this question – cmhughes Jul 25 '20 at 17:53
  • 4
    I’m voting to close this question because it has been asked on the project repository, https://github.com/cmhughes/latexindent.pl/issues/211 – cmhughes Sep 12 '20 at 05:46
  • 4
    @cmhughes Can you maybe post a summary of the answer here as well? – TobiBS Sep 12 '20 at 08:46

0 Answers0