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

Do not italicize colons when defining grammar non-terminals or #1355

Closed
wants to merge 2 commits into from

Conversation

jensmaurer
Copy link
Member

@jensmaurer jensmaurer commented Jan 11, 2017

following the "[ Note" and "[ Example" introducers.

Fixes #1351.

In "Appearance" mode, diffpdf shows everything (including spacing differences caused by the upright colon). In "characters" mode, there are just six pages of differences where a word was hyphenated the other way.

Sample change:

page

An additional "Overfull hbox" appeared in exceptions.tex, which took a reformulation of a note to fix. (Hyphenation hints were ineffective, for unknown reasons.)

@tkoeppe
Copy link
Contributor

tkoeppe commented Jan 11, 2017

I think a change of this nature will require some careful fine tuning. For example, the colon after q-char currently clashes with the "r"; it might be good to think about a pragmatic solution that still looks good.

@jensmaurer
Copy link
Member Author

Well, there is a tiny amount of space between the "r" and the colon...

page

@@ -393,9 +393,9 @@

\newenvironment{bnfbase}
{
\newcommand{\nontermdef}[1]{\nonterminal{##1}\indexgrammar{\idxgram{##1}}:}
\newcommand{\nontermdef}[1]{\nonterminal{##1}\indexgrammar{\idxgram{##1}}\textnormal{:}}
Copy link
Contributor

@tkoeppe tkoeppe Jan 11, 2017

Choose a reason for hiding this comment

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

Try inserting an italic correction before the colon, see if that looks better (\itcorr[1]).

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I had the same idea. And adding / or \itcorr indeed fixes it. Screenshot forthcoming.

@@ -198,7 +198,7 @@
\newcommand{\leftshift}[1]{\ensuremath{\, \mathsf{lshift}_#1 \,}}

%% Notes and examples
\newcommand{\noteintro}[1]{[\,\textit{#1:}\space}
\newcommand{\noteintro}[1]{[\,\textit{#1}:\space}
Copy link
Contributor

Choose a reason for hiding this comment

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

I've also always wanted to reduce the excessive space after the [ and before the ]. Instead of \,, I figured something like a \kern0.25pt or so would suffice. But I'll need to convince @zygoloid of that first.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hm... We could make the spacing slightly smaller, but I think having some spacing is good. I'll consider this change out-of-scope for this pull request.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, some, but less. I can show you some variations at some point. But let's separate that from the bnf-colon issue.

@jensmaurer
Copy link
Member Author

Added italics correction:
page

@tkoeppe
Copy link
Contributor

tkoeppe commented Jan 12, 2017

Much better!

@tkoeppe
Copy link
Contributor

tkoeppe commented Jan 12, 2017

I committed just the \nontermdef part as ffb9408. Let's talk about the Notes/Examples business in person. Thanks!

@tkoeppe tkoeppe closed this Jan 12, 2017
@jensmaurer jensmaurer deleted the b5 branch January 12, 2017 08:43
@tkoeppe
Copy link
Contributor

tkoeppe commented Jan 12, 2017

I'm hijacking this PR to post some screenshots.

All changes straighten the colon, too.

Original (\,):
image

No space:
image

Small space (itcorr):
image

No space at the beginning, itcorr at end:
image

As above, but also with itcorr before the colon:
image

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.

Inconsistent italicization of \nontermdef's colon in bnf and bnfkeywordtab envs
2 participants