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

[alg.min.max] Make lfloor/rfloor delimiters stretchable. #1455

Merged
merged 1 commit into from Feb 16, 2017

Conversation

Eelis
Copy link
Contributor

@Eelis Eelis commented Feb 9, 2017

Effect:
diff
Unfortunately, while this stretches the \lfloor/\rfloor nicely, it also seems to introduce some extra space before the comma. Anybody know a trick to avoid that?

@Eelis
Copy link
Contributor Author

Eelis commented Feb 9, 2017

Ah, found the trick: \mathclose. No more extra space now.

diff2

@jensmaurer
Copy link
Member

Looks like an improvement to me.

@@ -5190,7 +5190,7 @@
\pnum
\complexity
At most
$\max(\lfloor{\frac{3}{2}} (N-1)\rfloor, 0)$
$\max(\left\lfloor{\frac{3}{2}} (N-1)\right\rfloor\mathclose{}, 0)$
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need \mathclose{}?

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 best explanation I could find is at https://tex.stackexchange.com/a/2610

Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if you just use \bigl, \bigr? The advantage of those is that they are guaranteed to fit into the line, whereas the stretchable versions may end up taller than a line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah nice, using \bigl and \bigr produces the same result without needing the \mathclose, thanks!

Patch amended.

Copy link
Contributor

Choose a reason for hiding this comment

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

If you like you can also make the outer round parens big to match. See which one looks better.

Copy link
Contributor Author

@Eelis Eelis Feb 15, 2017

Choose a reason for hiding this comment

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

Hmm, personally, I like it with the outer parens as-is. Less intimidating. :)

@jensmaurer jensmaurer removed the request for review from jwakely February 15, 2017 18:49
@tkoeppe tkoeppe merged commit d2fe52e into cplusplus:master Feb 16, 2017
@Eelis Eelis deleted the mathdelims branch February 17, 2017 07:16
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