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
Remove \xspace everywhere except for \opt #1761
Conversation
It explains the difference between an object and a | ||
name and how they relate to the value categories for expressions. | ||
It introduces the concepts of a | ||
declaration and a definition and presents \Cpp's | ||
declaration and a definition and presents \Cpp{}'s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just FYI: I don't think the braces are required here (unless you want to prevent kerning).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is to have a general rule that all \Cpp macros are followed by {}. Whether that's necessary in a particular situation should not matter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only downsides are the adverse impact on readability of the source and (potentially) kerning.
I doubt that kerning is much of a problem here. And giving up a little bit of readability to gain consistency (for those editors who are less familiar with TeX's parsing rules) sounds like a reasonable thing to do.
(We could also add a lint check to warn in suspicious uses of \Cpp
without the terminating {}
.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change does in fact not cause any visual diff.
@godbyk: Yes, sure, that sounds useful!
In general, if a macro is followed by a punctuation character (or anything other than a space you want to keep), you don't need to use terminating |
|
||
%% Library function descriptions | ||
\newcommand{\Fundescx}[1]{\textit{#1}\xspace} | ||
\newcommand{\Fundesc}[1]{\Fundescx{#1:}} | ||
\newcommand{\Fundescx}[1]{\textit{#1}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a separate issue, but is there any reason to keep \Fundescx
around?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't seem to be used, except for \Fundesc.
@@ -317,13 +318,13 @@ | |||
|
|||
%% Miscellaneous | |||
\newcommand{\uniquens}{\placeholdernc{unique}} | |||
\newcommand{\stage}[1]{\item{\textbf{Stage #1:}}\xspace} | |||
\newcommand{\doccite}[1]{\textit{#1}\xspace} | |||
\newcommand{\stage}[1]{\item{\textbf{Stage #1:}}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Separate issue: Should use square brackets: \item[Stage #1:]
and adjust formatting of items in description
environments. (Note that the description
environment is also used in preprocessor.tex
in a weird way, too.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thanks!
\renewcommand{\emph}[1]{\textit{#1}\xspace} | ||
\newcommand{\numconst}[1]{\textsl{#1}\xspace} | ||
\newcommand{\logop}[1]{{\footnotesize #1}\xspace} | ||
\renewcommand{\emph}[1]{\textit{#1}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Separate issue: If you just want \emph
to have the same effect as \textit
(i.e., the text is always italic regardless of the context), then you could just write \let\emph\textit
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't that the default definition of \emph
anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\emph
alternates between italics and roman type as its nested, while \textit
does not.
For example, \emph{Hello, \emph{world}!}
would be typeset as “Hello, world!” In contrast, \textit{Hello, \textit{world}!}
would be typeset as “Hello, world!”
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, of course. Luckily we aren't quite that nestedly empathetic in the standard. :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, it's shocking how little we \emphasize in the standard compared to the time we spend talking about it!
@@ -1879,9 +1879,9 @@ | |||
the behavior is undefined. | |||
|
|||
\newcommand{\replaceabledesc}[1]{% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Separate issue: Should this definition be moved to macros.tex
?
Rebased; should be ready for merge now. |
Other than positively influencing kerning, this removal has no effect.
…unning text This avoids colons in running text and some bad spacing.
Rebased again, fixed overfull hbox. |
As a first step towards
\xspace
removal (see #1433), these changes remove\xspace
everywhere except for\opt
.(The consensus for \opt was to change its use from
xxx\opt
to\opt{xxx}
.)