Closed danrr closed 2 years ago
Thanks for this.
I'm afraid there's no way to set a hard limit of 80 characters.
Thank you for the quick reply.
That's good to know, I was thinking I was missing something obvious.
Would it be OK if I edit the original post to turn this into a feature request?
Feel free :)
BUT, you should know that I don't think this is possible. The text wrap routine happens before the indentation routine, so it doesn't know anything about leading space.
Text wrapping while accounting for leading space is not going to be easy. It may not be possible with latexindent.
You'll also see that there are a few issues ahead of this, and I'm quite behind for various reasons. If you feel like taking it on, pull requests to develop
are welcome :)
I've edited the example to remove some extraneous options. Even if it's not possible to implement, it will make it easier for anyone else who may find themselves looking for a similar option, I hope.
You'll also see that there are a few issues ahead of this, and I'm quite behind for various reasons.
Of course, no worries, I did not mean to imply any level of expectations :). Thank you!
I'm sorry, but with all of the text wrapping issues that are coming up, I don't have capacity to consider this. If anything, I'm getting increasingly close to removing text wrap rather than enhancing it. My apologies.
Good news :)
As of https://github.com/cmhughes/latexindent.pl/commit/a54b7be45606d07518dd86308212852111710991 the text wrap routine has been upgraded.
Using the settings
defaultIndent: ' '
modifyLineBreaks:
textWrapOptions:
columns: 100
when: after # <!---- NEW BIT
gives the output
\begin{document}
\begin{enumerate}[label=(\alph*)]
\item Lorem ipsum dolor sit amet, consectetur adipiscing elit, cras
imperdiet viv ris et molestie. Nulla molestie diam quam, ac molestie
velit rhoncus placerat.
\begin{enumerate}[label=(\roman*)]
\item Lorem ipsum dolor sit amet, consectetur adipiscing elit,
cras imperdiet viv ris et molestie. Nulla molestie diam
quam, ac molestie velit rhoncus placerat.
\end{enumerate}
\end{enumerate}
\end{document}
----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|
5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100 105 110
This will be part of the next release, hopefully in early 2023 :)
original .tex code
yaml settings
actual/given output
desired or expected output
-- It appears that there is no way to configure latexindent to have a hard character limit per line while also using the
oneSentencePerLine
option. Despite settingmodifyLineBreaks:textWrapOptions:perCodeBlockBasis: 0
, I'm still seeing lines that are processed as ifperCodeBlockBasis
was set to1
.Is there a way to get a hard limit of 80 characters, including indentation, while keeping the sentence wrapping options above?