Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
216 views
in Technique[技术] by (71.8m points)

Correct way to define macros etc ie in latex

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


ewcommandetc{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?

question from:https://stackoverflow.com/questions/3282319/correct-way-to-define-macros-etc-ie-in-latex

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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 "@".


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...