You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Separate textual and code placeholders; use slanted font for the latter #1060
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:
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.)
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.
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.
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.
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).
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.
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).
Editorial meeting consensus: Maybe use "I" as the placeholder, not "integral". Use slanted font for \tcode bool, where necessary. Ask LWG for feedback.
Activity
[atomics] Better use of \placeholders, cleanup.
jensmaurer commentedon Nov 17, 2016
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 commentedon 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 commentedon 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.
tkoeppe commentedon Nov 17, 2016
The other option that I hinted at is that we can use
\placeholderfor 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 commentedon 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 commentedon Feb 22, 2019
See #2245.