-
Notifications
You must be signed in to change notification settings - Fork 24
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
Text wrapping: Multiple overflowing lines leads to small remainers #62
Comments
Thanks for this! You might be interested in #6, which addressed a similar problem. Here are some of my thoughts on this. The line wrapping logic is currently implemented as follows.
Here, All this is to say, maybe try an example with the wrap length set to at least 50? This may partially help your issue, though of course it is not an exact fix. A more robust solution is likely to be quite difficult, as the line length depends on the indentation, which depends on the content of the line, which depends on where it is wrapped, etc. |
The problem is that the wrapping here is not reflowing the text. While this is technically wrapping it to the required line length, this is not what most would expect when specifying a wrapping parameter. To expand on the original example, going in the opposite direction (i.e., trying to increase the wrap) will do nothing.
wrapped to 40 will result in
instead of
|
@WGUNDERWOOD I did not realize about this minimum wrapping, that does indeed make it look less choppy. But like you said, this does not really fix the issue. Also as @brad-ellert correctly stated, one would expect that increasing the wrapping length later on would change the wrapping. I also do understand that this is MUCH harder to implement. I presume one has to detect the blocks of text and then wrap the block in its entirety. This comes with all the issues that Long story short, this is meant as an issue to sit around for a while where people drop a "+1" every now and then. Not sure if this is helpful. |
Hi everyone, the re-wrapping feature of other formatters is also something I'm very keen to see tex-fmt capable of doing. I've started some preliminary work in my fork of the project (https://github.com/cdesaintguilhem/tex-fmt/tree/cdsg-rewrap) to see what can be done. For now there is quite a lot to implement so I won't open even a draft PR, but I'm hoping to have some time to work on it some more. |
Thanks very much for this @cdesaintguilhem ; let me know if you need me to take a look at anything! |
Hey! First of all, great project! I can see how this will become the new standard in the future.
I feel like this issue must have come up before, but did not find it. I had a hard time coming up with a good descriptive title, I think it is best explained with an example. My issue is with this text:
Wrapping with a length of 30 (3
something
's) will result in:While I feel like it should format to:
This happens quite frequently to me, as I format my document on every save (as probably many do). Then I will add a word here, remove a word there... At the end I am stuck with way too many lines, where many of which only have a few words in it.
The text was updated successfully, but these errors were encountered: