In this article the author discusses the use of \@ to put correct spacings after full stops that are not at the end of a sentence e.g. Mr. i.e. etc.
The macro suggested
\newcommand\etc{etc\@ifnextchar.{}{.\@}}
is not quite perfect since in the case (\etc more text)
it produces (etc.more text)
.
I have seen a lot of authors who have made their own versions of the \etc
macro, mostly variations on etc.\
.
What macros for \etc
, \ie
, \etal
, \eg
produce the nicest results in the most situations?
Is this something too personal in taste to be solved in general?
Like any self-respecting programming language, LaTeX lets you define your own macros. LaTeX has a \newcommand command that you can use to define personal macros.
id est and exempli gratia (i.e. and e.g.) To prevent LaTeX from adding space after the last period, the correct syntax is either " i.e.\ " or " e.g.\ ", or else " i.e., " and " e.g., " with a comma. The comma is interpreted by LaTeX as part of a sentence, since the period is not followed by any space.
Just use etc. \ in the middle of a sentence and etc. at its end. Or \&c.
Show activity on this post. For novices, a simple mnemonic rule is: \@ is an invisible (zero-width) lowercase letter. LaTeX considers a sequence <lowercase letter> <punctuation sign> <space> as end of a phrase and adds extra space for readability: in That's all. Thanks , LaTeX adds more space after all. .
Earlier I used macros for "et al.", etc., but nowadays I would discourage people from defining that kind of macros.
One problem is what you already observed: it's surprisingly tricky to get the definitions right so that they handle all special cases correctly (including the interactions with other packages – e.g., those that re-define the "\cite" command and tweak spacing before references).
But more importantly, even if you have a bunch of macros that suit your needs and you know how to use them, your co-authors are likely to be confused with exactly how to use your macros correctly in various special cases.
Hence I'd recommend that you avoid macros for trivial things such as "et al." and simply spell out everything by using standard Latex markup. After all, most cases don't need any special handling ("e.g." is often followed by a comma; "et al." is often followed by "~\cite", etc.), and whenever special handling is needed, all Latex users should know how to use commands such as "\ " and "\@".
In CVPR's style package, it is defined as:
\usepackage{xspace} % Add a period to the end of an abbreviation unless there's one % already, then \xspace. \makeatletter \DeclareRobustCommand\onedot{\futurelet\@let@token\@onedot} \def\@onedot{\ifx\@let@token.\else.\null\fi\xspace} \def\eg{\emph{e.g}\onedot} \def\Eg{\emph{E.g}\onedot} \def\ie{\emph{i.e}\onedot} \def\Ie{\emph{I.e}\onedot} \def\cf{\emph{c.f}\onedot} \def\Cf{\emph{C.f}\onedot} \def\etc{\emph{etc}\onedot} \def\vs{\emph{vs}\onedot} \def\wrt{w.r.t\onedot} \def\dof{d.o.f\onedot} \def\etal{\emph{et al}\onedot} \makeatother
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With