-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
textWrapOptions
broken?
#355
Comments
Text wrapping and oneSentencePerLine are orthogonal processes.... If you want sentences wrapped, how about https://latexindentpl.readthedocs.io/en/latest/sec-the-m-switch.html#lst-sentence-wrap1-yaml |
Thanks for you response. I don't think of them as orthogonal. Consider the following formatting rule:
I don't think this can be done anymore? When I add |
OK, understood. I don't have access to a computer for a few days. I'll test this when I can. |
When I start with your file This is a very long sentence that I would like to be cut at the set line width which is however currently not done.
Sentences are put on different lines. and the modifyLineBreaks:
condenseMultipleBlankLinesInto: 1
oneSentencePerLine:
manipulateSentences: 1
removeSentenceLineBreaks: 1
textWrapSentences: 1
textWrapOptions:
columns: 100 and run
then I receive your desired output This is a very long sentence that I would like to be cut at the set line width which is however
currently not done.
Sentences are put on different lines. |
Like I tried to describe before, Consider This is a very long sentence that I would like to be cut at the set line width which is however currently not done.
Sentences are put on different lines.
This is a very long sentence that is formatted like it should and it
should therefore not be touched by the formatter. I want it to be This is a very long sentence that I would like to be cut at the set line width which is however
currently not done.
Sentences are put on different lines.
This is a very long sentence that is formatted like it should and it
should therefore not be touched by the formatter. but it formats to This is a very long sentence that I would like to be cut at the set line width which is however
currently not done.
Sentences are put on different lines.
This is a very long sentence that is formatted like it should and it should therefore not be
touched by the formatter. notice the last sentence. I want this because:
|
So you want to text wrap some sentences but not others? Once you detail textWrapSentences: 1 you are saying 'employ the text wrapping routine on all sentences'. If you don't want that to happen, then the |
Or, are you saying that you'd like removeSentenceLineBreaks: 0 to be employed by the sentence text wrapping routine as well? This is not currently the behaviour, but I could explore it.... For my reference, I think it would be the following line in latexindent.pl/LatexIndent/Wrap.pm Line 228 in 2198e4a
and it would need a check to see if the object is a sentence and if removeSentenceLineBreaks is 1.
|
I'm not entirely sure, but I suppose. In pseudo-algorithm what I want is:
|
Yes, this already happens :) But, the text wrap routine removes line breaks regardless of the value of removeSentenceLineBreaks. If I've understood this, I need to change this so that removeSentenceLineBreaks is respected by text wrap. |
As of 25bbaf1, I think that this is progressed. Here's a demo. Starting with your text: This is a very long sentence that I would like to be cut at the set line width which is however currently not done.
Sentences are put on different lines.
This is a very long sentence that is formatted like it should and it
should therefore not be touched by the formatter. and using modifyLineBreaks:
oneSentencePerLine:
manipulateSentences: 1
removeSentenceLineBreaks: 0 # <!----- KEY BIT, now respected by sentence text wrap
textWrapSentences: 1
textWrapOptions:
columns: 100 gives This is a very long sentence that I would like to be cut at the set line width which is however
currently not done.
Sentences are put on different lines.
This is a very long sentence that is formatted like it should and it
should therefore not be touched by the formatter. Using modifyLineBreaks:
oneSentencePerLine:
manipulateSentences: 1
removeSentenceLineBreaks: 1 # <!============ different
textWrapSentences: 1
textWrapOptions:
columns: 100 gives This is a very long sentence that I would like to be cut at the set line width which is however
currently not done.
Sentences are put on different lines.
This is a very long sentence that is formatted like it should and it should therefore not be
touched by the formatter. What do you think? |
This seems perfect!! Thanks a lot for this. Also, the option names now seem to make a lot of sense to me |
Fantastic, many thanks for confirming!
I'll get this released soon.
…On Mon, 4 Apr 2022, 10:18 Tom de Geus, ***@***.***> wrote:
This seems perfect!! Thanks a lot for this.
Also, the option names now seem to make a lot of sense to me
—
Reply to this email directly, view it on GitHub
<#355 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQ7CYAGNLTORLH5NYC3ICDVDKXXNANCNFSM5RYX34ZQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
🙏 |
Implemented and released as of https://github.com/cmhughes/latexindent.pl/releases/tag/V3.17.1. Upload to ctan imminent :) |
Please provide the following when posting an issue:
original .tex code
yaml settings
actual/given output
desired or expected output
Note that this is working with
latexindent.pl=3.15
but not withlatexindent.pl=3.16
neitherlatexindent.pl=3.17
The text was updated successfully, but these errors were encountered: