[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
doctest and @example blocks without an actual cope and paste example
From: |
Carnë Draug |
Subject: |
doctest and @example blocks without an actual cope and paste example |
Date: |
Thu, 9 Jul 2015 14:33:19 +0100 |
doctest extracts code from @example blocks. However, @example is also used
to display definitions as in the following case from imbothat [1]:
A bottom hat transform corresponds to the difference between the closing
of @var{img} and @var{img} itself, i.e., it is equivalent to:
@example
imclose (img, se) - img;
@end example
which causes an extraction error.
In addition, @example blocks in Texinfo are meant to allow other macros
inside them, which makes special sense in cases such as this. In the above
example, it would be perfectly correct to have:
imclose (@var{img}, @var{se}) - @var{img};
Which even if it had a result, would fail as @var{} would be an Octave
syntax error.
Point is, despite the name, @example is not being used only for examples.
Am I using TexInfo incorrectly? What would be the best way to do this?
Carnë
[1] http://octave.sourceforge.net/image/function/imbothat.html