Usually LaTeX macro takes parameters in the form: \somecommand[opt-param1][opt-param2]{param1}{param2}
But the \blindlistlist command in the blindtext package takes an optional parameter after an obligatory parameter: \blindlistlist[<level>]{<env>}[<x>]
What is the benefit of taking an optional parameter after an obligatory parameter? And how do I define such a command?
General ⇒ position of optional parameter in a LaTeX command.
NEW: TikZ book now 40% off at Amazon.com for a short time.

position of optional parameter in a LaTeX command.
One could add optional parameters without getting incompatible to its previous syntax, e.g. extend its syntax fromyoo wrote:What is the benefit of taking an optional parameter after an obligatory parameter?
\xxx[<o-arg 1>]{<m-arg>}
to
\xxx[<o-arg 1>]{<m-arg>}[<o-arg 2>]
LaTeX and their packages are Open Source, so just take a look at the code of \blindlistlist.And how do I define such a command?
Last edited by sommerfee on Sun Nov 08, 2009 10:13 pm, edited 1 time in total.
-
- Site Moderator
- Posts: 814
- Joined: Tue Jul 01, 2008 2:19 pm
position of optional parameter in a LaTeX command.
You could use the LaTeX3 xparse package to do this easily:
Joseph Wright