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
placeholders should be formatted with math fonts #326
If we are talking about code placeholders here, then I'm worried that the math font won't harmonize with the teletype font. They have different contrast and different cap height. This may work in certain situations, but it may come to bite us in the future.
I find italic teletype appropriate for the job. Just like "normal" body font italics are appropriate for mathematical variables in the context of body text, italic teletype seems appropriate for "code variables". (Though perhaps we should facilitate disabling the italic correction.)
Indeed. I think the need for italics in this context is by and large the same as for any code placeholder, so I'd be perfectly happy treating the two the same way.
(Note that for capital letters, the distinction between italic and slanted isn't very big, so either is fine here.)
Editorial meeting discussion: Variables of different kinds might be formatted differently. Possible kinds: type, variable, object, value, expression. It seems the convention is to use italics for all but the first and last; use code font for those. For meta-variables that expand to code, use code font. For other meta-variables, use math. For string interpolation, use \placeholder. Also for "op" in fold-expression. Update the wiki.
Idea: Introduce \tvar for type placeholders and make them italics. Not pursued.
@tkoeppe can we close this? We use \placeholder for all sorts of things like character-type at this point, and we probably don't want that to be in math font.
I think we could put what Jens said into the specification style guidelines; that seems to be the established convention at this point. Other than that, we're done with this issue, right?
Activity
tkoeppe commentedon Dec 10, 2015
If we are talking about code placeholders here, then I'm worried that the math font won't harmonize with the teletype font. They have different contrast and different cap height. This may work in certain situations, but it may come to bite us in the future.
I find italic teletype appropriate for the job. Just like "normal" body font italics are appropriate for mathematical variables in the context of body text, italic teletype seems appropriate for "code variables". (Though perhaps we should facilitate disabling the italic correction.)
jensmaurer commentedon Nov 17, 2016
See also #1060.
tkoeppe commentedon Nov 17, 2016
Indeed. I think the need for italics in this context is by and large the same as for any code placeholder, so I'd be perfectly happy treating the two the same way.
(Note that for capital letters, the distinction between italic and slanted isn't very big, so either is fine here.)
jensmaurer commentedon Dec 13, 2016
See #1139 for indexed (type) variables.
jensmaurer commentedon Dec 1, 2017
We should decide how to proceed and update the wiki accordingly.
jensmaurer commentedon Jun 7, 2018
Editorial meeting discussion: Variables of different kinds might be formatted differently. Possible kinds: type, variable, object, value, expression. It seems the convention is to use italics for all but the first and last; use code font for those. For meta-variables that expand to code, use code font. For other meta-variables, use math. For string interpolation, use \placeholder. Also for "op" in fold-expression. Update the wiki.
Idea: Introduce \tvar for type placeholders and make them italics. Not pursued.
eisenwave commentedon Jul 17, 2025
@tkoeppe can we close this? We use
\placeholderfor all sorts of things likecharacter-typeat this point, and we probably don't want that to be in math font.I think we could put what Jens said into the specification style guidelines; that seems to be the established convention at this point. Other than that, we're done with this issue, right?