shorthand command \cq{foo}.
git-svn-id: svn://svn.tartarus.org/sgt/halibut@4327
cda61777-01e9-0310-a592-
d414129be87e
\IM{\\e} \c{\\e} command
\IM{\\c} \c{\\c} command
\IM{\\cw} \c{\\cw} command
\IM{\\e} \c{\\e} command
\IM{\\c} \c{\\c} command
\IM{\\cw} \c{\\cw} command
+\IM{\\cq} \c{\\cq} command
\IM{\\q} \c{\\q} command
\IM{\\_} \c{\\_} command
\IM{\\-} \c{\\-} command
\IM{\\q} \c{\\q} command
\IM{\\_} \c{\\_} command
\IM{\\-} \c{\\-} command
example, if the text is capitalised, that's usually good enough. If
I talk about the Pentium's \cw{EAX} and \cw{EDX} registers, for
example, you don't need quotes to notice that those are special; so
example, if the text is capitalised, that's usually good enough. If
I talk about the Pentium's \cw{EAX} and \cw{EDX} registers, for
example, you don't need quotes to notice that those are special; so
-I would write that in Halibut as \q{\c{the Pentium's \\cw\{EAX\} and
-\\cw\{EDX\} registers}}. But if I'm talking about the Unix command
+I would write that in Halibut as \cq{the Pentium's \\cw\{EAX\} and
+\\cw\{EDX\} registers}. But if I'm talking about the Unix command
\c{man}, which is an ordinary English word in its own right, a reader
might be slightly confused if it appeared in the middle of a
\c{man}, which is an ordinary English word in its own right, a reader
might be slightly confused if it appeared in the middle of a
-sentence undecorated; so I would write that as \q{\c{the Unix command
-\\c\{man\}}}.
+sentence undecorated; so I would write that as \cq{the Unix command
+\\c\{man\}}.
In really extreme cases, you might want Halibut to use \i{quotation
marks} even in output formats which can change font. In
\k{input-date}, for example, I mention the special formatting
In really extreme cases, you might want Halibut to use \i{quotation
marks} even in output formats which can change font. In
\k{input-date}, for example, I mention the special formatting
-command \q{\cw{\\.}}. If that appeared at the end of a sentence
+command \cq{\\.}. If that appeared at the end of a sentence
\e{without} the quotes, then the two adjacent full stops would look
\e{without} the quotes, then the two adjacent full stops would look
-pretty strange even if they were obviously in different fonts. So I
-used the \c{\\q} command to provide my own set of quotes, and then
-used \c{\\cw} rather than \c{\\c} to ensure that none of Halibut's
-output formats would add another set of quotes:
+pretty strange even if they were obviously in different fonts.
+
+For this, Halibut supports the \i\c{\\cq} command, which is exactly
+equivalent to using \c{\\q} to provide quotes and then using
+\c{\\cw} inside the quotes. So in the paragraph above, for example,
+I wrote
+
+\c the special formatting command \cq{\\.}.
+
+and I could equivalently have written
\c the special formatting command \q{\cw{\\.}}.
\c the special formatting command \q{\cw{\\.}}.
(such as writing \c{\\dateZ}) then Halibut will assume you are
trying to invoke the name of a macro command you have defined
yourself, and will complain if no such command exists. To get round
(such as writing \c{\\dateZ}) then Halibut will assume you are
trying to invoke the name of a macro command you have defined
yourself, and will complain if no such command exists. To get round
-this you can use the special \q{\cw{\\.}} do-nothing command. See
+this you can use the special \cq{\\.} do-nothing command. See
\k{input-macro} for more about general Halibut command syntax and
\k{input-macro} for more about general Halibut command syntax and
If you would prefer the date to be generated in a specific format,
you can follow the \c{\\date} command with a format specification in
If you would prefer the date to be generated in a specific format,
you can follow the \c{\\date} command with a format specification in
braces, and does \e{not} need to escape them in the way described in
\k{input-basics}. This is because code paragraphs formatted in this
way are a special case; the intention is that you can just copy and
braces, and does \e{not} need to escape them in the way described in
\k{input-basics}. This is because code paragraphs formatted in this
way are a special case; the intention is that you can just copy and
-paste a lump of code out of your program, put \q{\cw{\\c }} at the
+paste a lump of code out of your program, put \cq{\\c } at the
start of every line, and simply \e{not have to worry} about the
details - you don't have to go through the whole block looking for
characters to escape.
start of every line, and simply \e{not have to worry} about the
details - you don't have to go through the whole block looking for
characters to escape.
\c{\\i\{frogs\}}, so that you'd end up with two separate index
entries for what really ought to be the same concept.
\c{\\i\{frogs\}}, so that you'd end up with two separate index
entries for what really ought to be the same concept.
-\b You might well not want the word \q{\cw{grep}} to appear in the
+\b You might well not want the word \cq{grep} to appear in the
index without explanation; you might prefer it to say something more
\I{rewriting index terms}verbose such as \q{\cw{grep} command}, so
that a user encountering it in the index has some idea of what it is
index without explanation; you might prefer it to say something more
\I{rewriting index terms}verbose such as \q{\cw{grep} command}, so
that a user encountering it in the index has some idea of what it is
\c \IM{grep} \cw{grep} command
This will arrange that the set of places in the document where you
\c \IM{grep} \cw{grep} command
This will arrange that the set of places in the document where you
-asked Halibut to index \q{\cw{grep}} will be listed under
-\q{\cw{grep} command} rather than just under \q{\cw{grep}}.
+asked Halibut to index \cq{grep} will be listed under
+\q{\cw{grep} command} rather than just under \cq{grep}.
You can specify more than one index term in a \c{\\IM} command; so
to merge the index terms \q{frog} and \q{frogs} into a single term,
You can specify more than one index term in a \c{\\IM} command; so
to merge the index terms \q{frog} and \q{frogs} into a single term,
\dd This specifies the suffix text to be appended to the chapter
number, before displaying the chapter title. For example, if you set
\dd This specifies the suffix text to be appended to the chapter
number, before displaying the chapter title. For example, if you set
-this to \q{\cw{:\_}}, then the chapter title might look something
+this to \cq{:\_}, then the chapter title might look something
like \q{Chapter 2: Doing Things}.
\dt \I{\cw{\\cfg\{text-section-align\}}}\cw{\\cfg\{text-section-align\}\{}\e{level}\cw{\}\{}\e{alignment}\cw{\}}
like \q{Chapter 2: Doing Things}.
\dt \I{\cw{\\cfg\{text-section-align\}}}\cw{\\cfg\{text-section-align\}\{}\e{level}\cw{\}\{}\e{alignment}\cw{\}}
\i{horizontal rules} (generated by \i\c{\\rule}; see
\k{input-rule}). It can be one character, or more than one. The
string you specify will be repeated to reach the required width, so
\i{horizontal rules} (generated by \i\c{\\rule}; see
\k{input-rule}). It can be one character, or more than one. The
string you specify will be repeated to reach the required width, so
-you can specify something like \q{\cw{-=}} to get a rule that looks
+you can specify something like \cq{-=} to get a rule that looks
like \cw{-=-=-=}.
\lcont{
like \cw{-=-=-=}.
\lcont{
\dt \I{%N-upper}\c{%N}
\dd Expands to the visible title of the section, with white space
\dt \I{%N-upper}\c{%N}
\dd Expands to the visible title of the section, with white space
-removed. So in a chapter declared as \q{\cw{\\C\{fish\} Catching
-Fish}}, this formatting command would expand to
-\q{\cw{CatchingFish}}.
+removed. So in a chapter declared as \cq{\\C\{fish\} Catching
+Fish}, this formatting command would expand to
+\cq{CatchingFish}.
\dt \i\c{%n}
\dd Expands to the type and number of the section, without white
\dt \i\c{%n}
\dd Expands to the type and number of the section, without white
-space. So in chapter 1 this would expand to \q{\cw{Chapter1}}; in
-section A.4.3 it would expand to \q{\cw{SectionA.4.3}}, and so on.
+space. So in chapter 1 this would expand to \cq{Chapter1}; in
+section A.4.3 it would expand to \cq{SectionA.4.3}, and so on.
If the section has no number (an unnumbered chapter created using
\c{\\U}), this directive falls back to doing the same thing as
\c{%N}.
If the section has no number (an unnumbered chapter created using
\c{\\U}), this directive falls back to doing the same thing as
\c{%N}.
\dt \i\c{%b}
\dd Expands to the bare number of the section. So in chapter 1 this
\dt \i\c{%b}
\dd Expands to the bare number of the section. So in chapter 1 this
-would expand to \q{\cw{1}}; in section A.4.3 it would expand to
-\q{\cw{A.4.3}}, and so on. If the section has no number (an
+would expand to \cq{1}; in section A.4.3 it would expand to
+\cq{A.4.3}, and so on. If the section has no number (an
unnumbered chapter created using \c{\\U}), this directive falls back
to doing the same thing as \c{%N}.
\dt \i\c{%k}
\dd Expands to the internal keyword specified in the section title.
unnumbered chapter created using \c{\\U}), this directive falls back
to doing the same thing as \c{%N}.
\dt \i\c{%k}
\dd Expands to the internal keyword specified in the section title.
-So in a chapter declared as \q{\cw{\\C\{fish\} Catching Fish}}, this
-formatting command would expand to \q{\cw{fish}}. If the section has
+So in a chapter declared as \cq{\\C\{fish\} Catching Fish}, this
+formatting command would expand to \cq{fish}. If the section has
no keyword (an unnumbered chapter created using \c{\\U}), this
directive falls back to doing the same thing as \c{%N}.
no keyword (an unnumbered chapter created using \c{\\U}), this
directive falls back to doing the same thing as \c{%N}.
\dd This specifies the suffix text to be appended to the chapter
number, before displaying the chapter title. For example, if you set
\dd This specifies the suffix text to be appended to the chapter
number, before displaying the chapter title. For example, if you set
-this to \q{\cw{:\_}}, then the chapter title might look something
+this to \cq{:\_}, then the chapter title might look something
like \q{Chapter 2: Doing Things}.
\dt \I{\cw{\\cfg\{xhtml-section-numeric\}}}\cw{\\cfg\{xhtml-section-numeric\}\{}\e{level}\cw{\}\{}\e{boolean}\cw{\}}
like \q{Chapter 2: Doing Things}.
\dt \I{\cw{\\cfg\{xhtml-section-numeric\}}}\cw{\\cfg\{xhtml-section-numeric\}\{}\e{level}\cw{\}\{}\e{boolean}\cw{\}}
same syntax used in \cw{\\cfg\{xhtml-template-filename\}} (see
\k{output-html-file}), to be used for the anchor names (\i\cw{<A
NAME="...">}) used to allow URLs to refer to specific sections
same syntax used in \cw{\\cfg\{xhtml-template-filename\}} (see
\k{output-html-file}), to be used for the anchor names (\i\cw{<A
NAME="...">}) used to allow URLs to refer to specific sections
-within a particular HTML file. So if you set this to \q{\cw{%k}},
+within a particular HTML file. So if you set this to \cq{%k},
for example, then each individual section in your document will be
addressable by means of a URL ending in a \c{#} followed by your
internal section keyword.
for example, then each individual section in your document will be
addressable by means of a URL ending in a \c{#} followed by your
internal section keyword.
\dd Specifies the suffix text to be appended to each section number
before displaying the section title. For example, if you set this to
\dd Specifies the suffix text to be appended to each section number
before displaying the section title. For example, if you set this to
-\q{\cw{:\_}}, then a typical section title might look something like
+\cq{:\_}, then a typical section title might look something like
\q{Section 3.1: Something Like This}.
\dt \I{\cw{\\cfg\{info-underline\}}}\cw{\\cfg\{info-underline\}\{}\e{text}\cw{\}}[\cw{\{}\e{text}\cw{\}}...]
\q{Section 3.1: Something Like This}.
\dt \I{\cw{\\cfg\{info-underline\}}}\cw{\\cfg\{info-underline\}\{}\e{text}\cw{\}}[\cw{\{}\e{text}\cw{\}}...]
c_c, /* code */
c_cfg, /* configuration directive */
c_copyright, /* copyright statement */
c_c, /* code */
c_cfg, /* configuration directive */
c_copyright, /* copyright statement */
+ c_cq, /* quoted code (sugar for \q{\cw{x}}) */
c_cw, /* weak code */
c_date, /* document processing date */
c_dd, /* description list: description */
c_cw, /* weak code */
c_date, /* document processing date */
c_dd, /* description list: description */
{"c", c_c}, /* code */
{"cfg", c_cfg}, /* configuration directive */
{"copyright", c_copyright}, /* copyright statement */
{"c", c_c}, /* code */
{"cfg", c_cfg}, /* configuration directive */
{"copyright", c_copyright}, /* copyright statement */
+ {"cq", c_cq}, /* quoted code (sugar for \q{\cw{x}}) */
{"cw", c_cw}, /* weak code */
{"date", c_date}, /* document processing date */
{"dd", c_dd}, /* description list: description */
{"cw", c_cw}, /* weak code */
{"date", c_date}, /* document processing date */
{"dd", c_dd}, /* description list: description */
* Mid-paragraph commands:
*
* \K \k
* Mid-paragraph commands:
*
* \K \k
+ case c_cq:
+ type = t.cmd;
dtor(t), t = get_token(in);
if (t.type != tok_lbrace) {
error(err_explbr, &t.pos);
dtor(t), t = get_token(in);
if (t.type != tok_lbrace) {
error(err_explbr, &t.pos);
sitem = snew(struct stack_item);
sitem->fpos = t.pos;
sitem->type = stype;
sitem = snew(struct stack_item);
sitem->fpos = t.pos;
sitem->type = stype;
+ if (type == c_cq) {
+ if (style != word_Normal) {
+ error(err_nestedstyles, &t.pos);
+ } else {
+ style = word_WeakCode;
+ spcstyle = tospacestyle(style);
+ sitem->type |= stack_style;
+ }
+ }
stk_push(parsestk, sitem);
}
break;
stk_push(parsestk, sitem);
}
break;
\define{eur} \u20AC{EUR }
\define{eur} \u20AC{EUR }
-\versionid $Id: test.but,v 1.33 2004/06/20 13:44:30 simon Exp $
+\versionid $Id: test.but,v 1.34 2004/07/16 11:54:04 simon Exp $
\C{ch\\ap} First chapter title; for similar wrapping reasons this
chapter title will be ludicrously long. I wonder how much more
\C{ch\\ap} First chapter title; for similar wrapping reasons this
chapter title will be ludicrously long. I wonder how much more
spaces (ignored), and \e{emphasised text} as well as \c{code
fragments}.
spaces (ignored), and \e{emphasised text} as well as \c{code
fragments}.
-\cw{This} is weak code. And \k{head} contains some other stuff.
-\K{subhead} does too.
+\cw{This} is weak code; \cq{this} is quoted code. And \k{head}
+contains some other stuff. \K{subhead} does too.
To test the man page back end:
To test the man page back end: