texinfo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

@-commands with global effects in raw blocks


From: Patrice Dumas
Subject: @-commands with global effects in raw blocks
Date: Sun, 20 Jan 2013 12:56:17 +0100
User-agent: Mutt/1.5.20 (2009-12-10)

Hello,

Raw blocks are a bit special because @-commands are parsed in them, but
they may not be output, although they appear in general text.
Since the content of raw blocks is parsed but not output, using
@-commands with global scope (@kbdinpustyle, @anchor, maybe in some
cases @footnote for the numbering of footnotes) in raw blocks may lead
to error messages not being output or output which is not what the user
would have expected, if the information is gathered at parsing time.

For example, in html

 @tex
 @anchor{anchor in tex}
 @end tex

 @ref{anchor in tex}

Does not lead to an error message when generating html (the file name
for the anchor is considered to be the top node filename in that case).

Similarly

 @tex
 @kbdinputstyle code
 @end tex

 @kbd{in kbd}.

Will lead <code> to be used for kbd.


Those examples may be a bit far fetched, but the second one, especially
is really problematic in my opinion, and overall this leads to
situations where parsing information may be wrong and this limits the
usefulness of the tree.  (There is a similar issue for @titlepage,
@copying, although this may be mitigated by the fact that these
environments are specific, with specific treatements of @anchor and
index entries, if I recall well).

I don't think we should try to do something smart in the code.  But
should we say something in the documentation?

Like, in '@node Raw Formatter Commands', at the end of the node:


In all cases, in raw processing, @code{@@} retains the same meaning as
in the remainder of the document.

You should therefore use preferably @code{@@address@hidden conditionals 
for @@-commands that have impacts on the whole document instead of
raw formatter blocks.  For example, instead of:

@example
@@tex
@@kbdinputstyle code
Some address@hidden@} stuff...
@@end tex
@end example

You should use

@example
@@iftex
@@kbdinputstyle code
@@end iftex
@@tex
Some address@hidden@} stuff...
@@end tex
@end example


-- 
Pat



reply via email to

[Prev in Thread] Current Thread [Next in Thread]