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

Resolve some 'Overfull \hbox' warnings. #1068

Merged
merged 1 commit into from Nov 18, 2016
Merged

Conversation

jensmaurer
Copy link
Member

Partially addresses #693.

@@ -6338,7 +6338,7 @@
\pnum
\requires
\tcode{is_assignable_v<mapped_type\&, M\&\&>} shall be \tcode{true}.
\tcode{value_type} shall be \tcode{EmplaceConstructible} into \tcode{map}
\tcode{value_type} shall be \tcode{Emplace\-Constructible} into \tcode{map}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you try adding EmplaceConstructible to the global hyphenation hints (in std.tex) and see if that works? If the issue is just that it's an unknown word, then that's a more sustainable approach.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have just tried using this and get no changes (according to diffpdf):

\hyphenation{tem-plate ex-am-ple name-space name-spaces emplace-constructible copy-constructible less-than-comparable in-put-it-er-a-tor out-put-it-er-a-tor for-ward-iter-a-tor rand-om-acc-ess-iter-a-tor}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am unable to get LaTeX to hyphenate EmplaceConstructible using \hyphenation. Maybe because the word has a capital letter in the middle.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it may be because the text is inside a \tcode. We could probably also change that somehow. The hyphenat package does something similar.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, what's the next step here? Adding the manual hyphenation fixes the non-hyphenation of the term in the four places where it's an "overfull \hbox" problem.

Copy link
Contributor

@tkoeppe tkoeppe Nov 18, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, keep it manual for now. It's what we've been doing and it's an OK solution. We can research better solutions offline. (The only problem with manual fixes is that they are very brittle when the text changes and may need to become stale or need refixing. But that's what we're here for.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I just tried, and we probably really don't want to monkey with global tcode, because then we'd end up hyphenating things like 1.2e-34. :-)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

regarding "very brittle": We have lots of paragraphs, and only if this particular paragraph changes again in the future do we need to reconsider the manual hyphenation.

``implicit int'' rule of C is no longer supported.}
\begin{note}
A \grammarterm{nodeclspec-function-declaration} can only be used in a
\grammarterm{template-declaration}~(Clause~\ref{temp}),
\grammarterm{explicit-instantiation}~(\ref{temp.explicit}), or
\grammarterm{explicit-instan\-tiation}~(\ref{temp.explicit}), or
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My more natural reaction would be to remove the non-breaking space first. I always thought that those were tenuous at best; there's very little reason to prevent a break before the reference. Either the reference fits on the same line and all is well, or it doesn't, and then that's still by far the best place to break compared to anywhere else.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, although I notice that we do usually attach cross-references to the preceding term.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, but as I said that's rather strange if it requires hyphenation in the previous term. I think the non-breaking space is only an approximation, and what we really want is a "discouraging" space that says "please try not to break here if possible".

But surely it's much better to break at a real space than introduce awkward hyphenation. What do you think? In real-world publishing you would probably try to rephrase the text to achieve the desired presentation, but given the constant changes we are making, I would strongly prefer the simple and maintainable solution that doesn't require manual intervention.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine with me. As I said above, the newest update has the "make it breaking whitespace" change.

@jwakely
Copy link
Member

jwakely commented Nov 18, 2016

The results look very, very good to me.

@@ -1941,7 +1941,8 @@
template <size_t I, class... Types>
constexpr tuple_element_t<I, tuple<Types...>>&& get(tuple<Types...>&& t) noexcept; // Note A
template <size_t I, class... Types>
constexpr tuple_element_t<I, tuple<Types...>> const& get(const tuple<Types...>& t) noexcept; // Note B
constexpr tuple_element_t<I, tuple<Types...>> const&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for visual harmony, would it be possible to break all three declarations in the same way?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is obviously an improvement, but done anyway.

@@ -13769,7 +13779,7 @@
\requires \tcode{F} shall be \tcode{CopyConstructible}.

\pnum
\remarks This constructor shall not participate in overload resolution unless
\remarks This constructor template shall not participate in overload resolution unless
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice :-)

@@ -457,7 +457,7 @@
{
\begin{LongTable}
{#1}{#2}
{x{.35\hsize}x{.28\hsize}x{.30\hsize}}
{x{.35\hsize}x{.28\hsize}x{.29\hsize}}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. I wonder were those original values came from. I suppose they were too big because they didn't account for cell padding?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's my guess, or disregard of inter-cell spacing.

@tkoeppe
Copy link
Contributor

tkoeppe commented Nov 18, 2016

I agree, a very nice change. I wonder if we get to merge it before the motions; will check with @zygoloid.

@tkoeppe tkoeppe merged commit 0cff15b into cplusplus:master Nov 18, 2016
tkoeppe pushed a commit that referenced this pull request Nov 18, 2016
@jensmaurer jensmaurer deleted the b16 branch November 19, 2016 19:32
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