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

[macros] Add space into \range, reflow [alg.transform] #588

Merged
merged 2 commits into from Dec 18, 2015

Conversation

tkoeppe
Copy link
Contributor

@tkoeppe tkoeppe commented Dec 18, 2015

The usual typographic convention is to have a space after (but not before) a comma. This change inserts a comma into the \range macro to print ranges as [a, b) rather than the current [a,b).

This has about 90 pdfdiffs, all looking like improvements.

@@ -234,7 +234,7 @@
\newcommand{\mname}[1]{\tcode{\unun\ungap#1\ungap\unun}}

%% Ranges
\newcommand{\Range}[4]{\tcode{#1\brk{}#3,\brk{}#4\brk{}#2}\xspace}
\newcommand{\Range}[4]{\tcode{#1\brk{}#3, \brk{}#4\brk{}#2}\xspace}
Copy link
Member

Choose a reason for hiding this comment

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

Please use ~ not here; we don't want line breaks within these.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought \brk{} means "allow linebreak here"? Do you also want to remove those from the macro?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The change adds some line breaks inside ranges. Here's one example:

image

@zygoloid
Copy link
Member

OK, after some discussion: I think we should allow linebreaks here, but with the hyphenation penalty like we had before (we should prefer to break on a "real" space rather than after the comma). Something like \discretionary{}{}{ } might work.

@tkoeppe
Copy link
Contributor Author

tkoeppe commented Dec 18, 2015

Changed to just ,~\brk{} which is tighter than ,.

@tkoeppe
Copy link
Contributor Author

tkoeppe commented Dec 18, 2015

Note to self: investigate 25.3.4/2.

@tkoeppe
Copy link
Contributor Author

tkoeppe commented Dec 18, 2015

Added a change to [alg.transform] to look a bit more palatable:

image

@tkoeppe tkoeppe changed the title [macros] Add space into \range [macros] Add space into \range, reflow [alg.transform] Dec 18, 2015
{result + (last1 - first1)}.\footnote{The use of fully
\begin{itemize}
\item \crange{first1}{last1},
\item \tcode{[first2, first2 + (last1 - first1)]}, and
Copy link
Member

Choose a reason for hiding this comment

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

Why is this one not a \crange?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Left-over from experimenting; reverted to \crange.

zygoloid added a commit that referenced this pull request Dec 18, 2015
[macros] Add space into \Range, reflow [alg.transform]
@zygoloid zygoloid merged commit 006f586 into cplusplus:master Dec 18, 2015
@tkoeppe tkoeppe deleted the range branch December 18, 2015 23:21
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

2 participants