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

Separate textual and code placeholders; use slanted font for the latter #1060

Closed
tkoeppe opened this issue Nov 17, 2016 · 6 comments
Closed
Labels
lwg Issue must be reviewed by LWG.
Milestone

Comments

@tkoeppe
Copy link
Contributor

tkoeppe commented Nov 17, 2016

We currently use the \placeholder macro (and its non-italic-correcting variant \placeholdernc) for both textual and code placeholders, and we typeset both in "italic".

This has two problems:

  1. Monospace italics don't always look that great. Slanted "faux-italics" would look better for meta-variables. (But true italics may still be nice for things like see below.)

  2. There is no bold italic monospace font, so a code placeholder in a heading, say, will fall back to bold slanted monospace.

My general idea here is that we should perhaps typeset all code placeholders in slanted, rather than true italics. Not only would that make placeholders look the same in headings and body text, but it is also generally nicer.

image

This raises a new problem: We use \placeholder both in text and in code. Obviously, in normal text placeholders should still be decorated as true italics. So we need to distinguish the two use cases, either by laboriously replacing text placeholders with \textit or some new macro, or by making \placeholder smart and recognizing its context.

tkoeppe added a commit that referenced this issue Nov 17, 2016
Also improves whitespace, italic correction and alignment. I also included a few drive-by fixes where placeholders should have been used but weren't.

See also #1060.
@jensmaurer
Copy link
Member

Let me object to introducing \textit for anything new. If we clearly mark all semantic things appropriately, we can easily fix the font later. Going \textit gets us back to where we've been all along: unable to add index entries for term definitions, for example.

In any case, I'd like to point out that we sometimes use the code placeholder and mention it in regular text to explain what it means. That's probably an argument against different fonts for these.

@tkoeppe
Copy link
Contributor Author

tkoeppe commented Nov 17, 2016

I think that's a red herring: code placeholders should always appear in code placeholder font (typewriter + decoration), whether that's in a code block or in body text. The things I want to distinguish are conceptual placeholders (like "a memory access A") and meta variables (like type).

@jensmaurer
Copy link
Member

jensmaurer commented Nov 17, 2016

Ok. Whatever the outcome, we should be clear what to use in "A is sequenced before B" vs. "offsetof(type, member-designator" vs. "atomic<integral>" (the latter doesn't even say "T"). If we can clearly differentiate these uses, let's introduce a \metavar for the first case NOW and discuss formatting later.

@jensmaurer jensmaurer added the decision-required A decision of the editorial group (or the Project Editor) is required. label Nov 17, 2016
@tkoeppe
Copy link
Contributor Author

tkoeppe commented Nov 17, 2016

The other option that I hinted at is that we can use \placeholder for both, and since the latter usage always appears in a code font setting, we could make the macro smarter to distinguish the two use cases and select the desired style accordingly. In some sense, both uses are kinds of placeholders (just with somewhat different usage).

@jensmaurer
Copy link
Member

jensmaurer commented Mar 2, 2017

Editorial meeting consensus: Maybe use "I" as the placeholder, not "integral". Use slanted font for \tcode bool, where necessary. Ask LWG for feedback.

@jensmaurer jensmaurer added lwg Issue must be reviewed by LWG. and removed decision-required A decision of the editorial group (or the Project Editor) is required. labels Mar 2, 2017
@jensmaurer jensmaurer added this to the C++20 milestone Mar 2, 2017
@jensmaurer
Copy link
Member

See #2245.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lwg Issue must be reviewed by LWG.
Projects
None yet
Development

No branches or pull requests

2 participants