Skip to content
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

[everywhere] Remove paragraph breaks in the middle of sentences #1899

Closed
Eelis opened this issue Jan 13, 2018 · 5 comments
Closed

[everywhere] Remove paragraph breaks in the middle of sentences #1899

Eelis opened this issue Jan 13, 2018 · 5 comments
Labels
big An issue causing a large set of changes, scattered across most of the text.

Comments

@Eelis
Copy link
Contributor

Eelis commented Jan 13, 2018

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.

@tkoeppe
Copy link
Contributor

tkoeppe commented Jan 13, 2018

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.

@jensmaurer
Copy link
Member

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?

@tkoeppe
Copy link
Contributor

tkoeppe commented Jan 13, 2018

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 :-).)

@Eelis
Copy link
Contributor Author

Eelis commented Jan 25, 2018

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:

diff

(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).

@jensmaurer jensmaurer added the big An issue causing a large set of changes, scattered across most of the text. label Mar 23, 2018
@Eelis
Copy link
Contributor Author

Eelis commented May 25, 2020

Enough inappropriate paragraphs have been fixed to satisfy me. :) Closing.

@Eelis Eelis closed this as completed May 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
big An issue causing a large set of changes, scattered across most of the text.
Projects
None yet
Development

No branches or pull requests

3 participants