summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/eplain/doc/eplain.html
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/eplain/doc/eplain.html')
-rw-r--r--Master/texmf-dist/doc/eplain/doc/eplain.html37
1 files changed, 33 insertions, 4 deletions
diff --git a/Master/texmf-dist/doc/eplain/doc/eplain.html b/Master/texmf-dist/doc/eplain/doc/eplain.html
index a7c7a04a014..2574c72a2ee 100644
--- a/Master/texmf-dist/doc/eplain/doc/eplain.html
+++ b/Master/texmf-dist/doc/eplain/doc/eplain.html
@@ -7,8 +7,8 @@
<link title="Top" rel="top" href="#Top">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
-This manual documents the Eplain macros, version 3.3,
-July 2009. Eplain provides functionality for plain TeX that
+This manual documents the Eplain macros, version 3.4,
+February 2010. Eplain provides functionality for plain TeX that
is intended to be useful regardless of how your document is actually
formatted.
@@ -238,8 +238,8 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
<h2 class="unnumbered">Eplain</h2>
-<p>This manual documents the Eplain macros, version 3.3,
-July 2009. Eplain provides functionality for plain TeX that
+<p>This manual documents the Eplain macros, version 3.4,
+February 2010. Eplain provides functionality for plain TeX that
is intended to be useful regardless of how your document is actually
formatted.
@@ -6074,6 +6074,35 @@ category code of <kbd>@</kbd> set to 11 (letter). Here is an example:
\fi
}
</pre>
+ <p>It's possible to define macros that appear to accept optional
+arguments intermixed with mandatory arguments in any imaginable way.
+For example:
+
+<pre class="example"> \makeatletter
+ % \mo{m}[o]
+ \def\mo#1{\def\mo@arg{#1}\@getoptionalarg\fin@mo}
+ \def\fin@mo{\vskip1pc
+ ARG: \mo@arg \par
+ OPTARG: \@optionalarg \par
+ }
+ % \mom{m}[o]{m}
+ \def\mom#1{\def\mom@arg{#1}\@getoptionalarg\fin@mom}
+ \def\fin@mom#1{\vskip1pc
+ ARG1: \mom@arg \par
+ OPTARG: \@optionalarg \par
+ ARG2: #1\par
+ }
+ % \omo[o]{m}[o]
+ \def\omo{\@getoptionalarg\fin@omo}
+ \def\fin@omo#1{\let\omo@optarg\@optionalarg
+ \def\omo@arg{#1}\@getoptionalarg\@fin@omo}
+ \def\@fin@omo{\vskip1pc
+ OPTARG1: \omo@optarg \par
+ ARG: \omo@arg \par
+ OPTARG2: \@optionalarg \par
+ }
+ \makeatother
+</pre>
<p>If an optional argument contains another optional argument, the inner
one will need to be enclosed in braces, so TeX does not mistake the
end of the first for the end of the second.