diff options
Diffstat (limited to 'Master/texmf-doc/doc/english/FAQ-en/html/FAQ-oarglikesect.html')
-rw-r--r-- | Master/texmf-doc/doc/english/FAQ-en/html/FAQ-oarglikesect.html | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Master/texmf-doc/doc/english/FAQ-en/html/FAQ-oarglikesect.html b/Master/texmf-doc/doc/english/FAQ-en/html/FAQ-oarglikesect.html new file mode 100644 index 00000000000..f9b20074004 --- /dev/null +++ b/Master/texmf-doc/doc/english/FAQ-en/html/FAQ-oarglikesect.html @@ -0,0 +1,16 @@ +<head> +<title>UK TeX FAQ -- question label oarglikesect</title> +</head><body> +<h3>Optional arguments like <code>\</code><code>section</code></h3> +<p>Optional arguments, in macros defined using <code>\</code><code>newcommand</code>, don't +quite work like the optional argument to <code>\</code><code>section</code>. The default +value of <code>\</code><code>section</code>'s optional argument is the value of the +mandatory argument, but <code>\</code><code>newcommand</code> requires that you 'know' the +value of the default beforehand. +<p>The requisite trick is to use a macro in the optional argument: +<pre> +\newcommand\thing[2][\DefaultOpt]{\def\DefaultOpt{#2} ...} +</pre> + +<p><p>This question on the Web: <a href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=oarglikesect">http://www.tex.ac.uk/cgi-bin/texfaq2html?label=oarglikesect</a> +</body> |