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

[std] Allow linebreaks before \ref in select places #1688

Closed
wants to merge 1 commit into from

Conversation

jensmaurer
Copy link
Member

@jensmaurer jensmaurer commented Jul 28, 2017

Avoids 'Overfull \hbox' warnings.

Partially reverts commit bf363db.

Avoids 'Overfull \hbox' warnings.
@jensmaurer jensmaurer added this to the C++20 milestone Jul 28, 2017
@zygoloid
Copy link
Member

If we're going to convert the ~s to spaces whenever they cause overfull hboxes, why do we even bother with them at all? If we want to instruct TeX that line breaks should be inserted here as a last resort (as a kind of hyphenation rule), we should do so directly rather than manually maintaining some ~s and some spaces.

Perhaps we can define (\ref to expand to \nolinebreak[2] (\ref or similar to automate this? But defining space as a macro seems pretty scary to me.

@jensmaurer
Copy link
Member Author

First, we only want to allow a linebreak before (\ref if all else fails. Second, there's always the option to actually rephrase the source text so that the "overfull \hbox" vanishes because the \ref is in the middle of the line, not at the end. But that doesn't work for all / most cases we're discussing here.

Can we maybe redefine ~ to mean \nolinebreak[2] or something like that?

@zygoloid
Copy link
Member

I have a somewhat more drastic approach in mind: adding a \iref command for inline references, to be used as "frobs the grunkifier\iref{grunk.frob}", where \iref expands to (\ref{grunk.frob}).

To make that work, we need to change the \ref label for clauses and annexes to include the leading "Clause" or "Annex", but that seems to be a net improvement.

@zygoloid
Copy link
Member

OK, I have an approach that prevents linebreaks before a parenthesized reference unless doing so would result in a hyphenation or overfull hbox.

@zygoloid
Copy link
Member

See pull request #1690, which addresses this in a more holistic fashion. Unless there are objections, I intend to rebase and merge that after the LWG motions.

@tkoeppe
Copy link
Contributor

tkoeppe commented Jul 29, 2017

Regardless of whether we'll change the way we do references, I would suggest waiting with fixes like the present one until we publish the IS. The status quo should be the "persistent baseline", and changes like the present one should be "temporary finalization fixes" for publication.

@jensmaurer
Copy link
Member Author

@tkoeppe: You comment confuses me. I thought C++17 IS was branched and is essentially immutable except for ISO Central Secretariat and NB "must fix" comments? I thought we're only discussing C++20 changes here.

@tkoeppe
Copy link
Contributor

tkoeppe commented Jul 29, 2017

@jensmaurer: I'm talking about the C++20 IS!

@jensmaurer
Copy link
Member Author

@tkoeppe: Sorry, but "I would suggest waiting with fixes like the present one until we publish the IS" is still three years away if you mean publication of the C++20 IS. We can certainly fix \ref vs. \iref in that timeframe, I hope?

@jensmaurer
Copy link
Member Author

@tkoeppe: Ah, I understand now: You're saying my "Overfull \hbox removal" patch should not go in until we're near publication. (And we live with the Overfull \hboxes for three years!?) However, something like Richard's #1690 fixes the issue at its root, so is very well on-topic for short-term merge.

@tkoeppe
Copy link
Contributor

tkoeppe commented Jul 29, 2017

Correct, we shouldn't make ad-hoc adjustments that would become undesirable once the ambient text changes so as to make the adjustment unnecessary. A principled change like Richard's is fine, but any deviations that we make from the general rule should probably wait until the bulk of the text is stabilized. Otherwise it'd be very difficult to remember to undo the deviations.

I don't mind living with occasional overfull boxes in the working paper. If there's an obvious improvement that fixes them, of course we should do that, but in a case like this I could probably just wait.

@tkoeppe
Copy link
Contributor

tkoeppe commented Jul 31, 2017

I believe this PR is now obsolete; we don't have any overfull hboxes at head.

@tkoeppe tkoeppe closed this Jul 31, 2017
@jensmaurer jensmaurer deleted the b8 branch October 6, 2017 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants