Closed Eelis closed 4 years ago
Well, my goal was to make it possible to remove those breaks, but to actually make edits to remove the breaks would be a lot of work, and there are edge cases where the additional break improves line breaking, weirdly. (Though perhaps this has changed with @jensmaurer's improved widow/club code.)
I'd certainly entertain patches that do nothing but break removal and cause no visual diffs.
Just to clarify, the issue is the empty line for cases like the following:
In
(empty)
\begin{codeblock}
int j = 24;
[...]
Because from a LaTeX perspective, there is no difference with and without the empty line (a codeblock is a vertical environment, so the previous LaTeX paragraph ends anyway).
There might actually be an argument for source code readability to keep the empty line. @zygoloid , any opinion here?
As a long-term user of LaTeX, I find that it's precisely the readability aspect that makes me want to get rid of the double line breaks. Double line breaks read as "paragraph break", so they're very confusing.
(If you perceive a problem with readability, that might indicate that the paragraph is too long :-).)
It turns out that removing an empty line between text and a codeblock can change the layout of the text. For example, removing this empty line results in the following change:
(If you don't see it, look at the right side.)
Since empty lines like these are currently used erratically around codeblocks, this means the layout in the PDF is currently inconsistent. So fixing this issue will entail visual diffs (fixing the inconsistency).
Enough inappropriate paragraphs have been fixed to satisfy me. :) Closing.
For example, consider this sentence that spans multiple paragraphs: https://github.com/cplusplus/draft/blob/master/source/basic.tex#L631
The reason I care about this is that cxxdraft-htmlgen supports linking to individual sentences (which has proved to be a popular feature), but it can't do this properly for sentences that span multiple paragraphs.
So to get links like http://eel.is/c++draft/basic.scope.declarative#2.sentence-1 to correctly select the whole sentence, I currently use a sloppy incomplete patch that removes tons of these inappropriate paragraph breaks. I could clean that patch up, make it more complete, and submit it, if this issue is deemed worthy of fixing.
I vaguely recall that @tkoeppe was already planning something along these lines a while ago, but I can't find an existing ticket.