\c \define{eur} \u20AC{EUR }
-Then you can just write
+Then you can just write ...
\c This is likely to cost \eur 2500 at least.
-\# FIXME: need a NOP to allow text to directly follow this. \.?
+... except that that's not terribly good, because you end up with a
+space between the Euro sign and the number. In this case, it's
+helpful to use the special \c{\\.} command, which is defined to do
+nothing at all! But it acts as a separator between your macro and
+the next character:
+
+\c This is likely to cost \eur\.2500 at least.
+
+This way, you will see no space between the Euro sign and the number
+(although, of course, there will be space between \q{EUR} and the
+number if the Euro sign is not available, because the macro
+definition specifically asked for it).
c__invalid, /* invalid command */
c__comment, /* comment command (\#) */
c__escaped, /* escaped character */
+ c__nop, /* no-op */
c__nbsp, /* nonbreaking space */
c_A, /* appendix heading */
c_B, /* bibliography entry */
static const struct { char const *name; int id; } keywords[] = {
{"#", c__comment}, /* comment command (\#) */
{"-", c__escaped}, /* nonbreaking hyphen */
+ {".", c__nop}, /* no-op */
{"A", c_A}, /* appendix heading */
{"B", c_B}, /* bibliography entry */
{"BR", c_BR}, /* bibliography rewrite */
} else if (c == '\\') { /* tok_cmd */
c = get(in, &cpos);
if (c == '-' || c == '\\' || c == '_' ||
- c == '#' || c == '{' || c == '}') {
+ c == '#' || c == '{' || c == '}' || c == '.') {
/* single-char command */
rdadd(&rs, c);
} else if (c == 'u') {
break;
}
+ if (t.type == tok_cmd && t.cmd == c__nop) {
+ dtor(t), t = get_token(in);
+ continue; /* do nothing! */
+ }
+
if (t.type == tok_cmd && t.cmd == c__escaped) {
t.type = tok_word; /* nice and simple */
t.aux = 0; /* even if `\-' - nonbreaking! */
\define{coopt} co\u00F6{-o}pt
-\versionid $Id: test.but,v 1.22 2004/03/25 19:16:28 simon Exp $
+\define{eur} \u20AC{EUR }
+
+\versionid $Id: test.but,v 1.23 2004/03/25 19:27:12 simon Exp $
\C{ch\\ap} First chapter title; for similar wrapping reasons this
chapter title will be ludicrously long. I wonder how much more
Use of macros: let's talk about \coopt. And about \coopt some more.
And a nested macro: \metacoopt.
+A slightly more difficult macro: \eur\.2500.
+
Oh, while I'm here: some special characters. The \\, \{ and \}
characters, to be precise. And their code equivalents, \c{\\},
\i\c{\{}, \c{\}}.