What is rule in specifying bracket position:
\foo[]{} %or
\foo{}[]
Following syntaxes are clear, is there any other combinations?
\foo{}{}
\foo{}
...
|
What is rule in specifying bracket position:
Following syntaxes are clear, is there any other combinations?
|
||||
|
The
|
With xparse you can get away with multiple optionals and avoid some confusion using different delimiters, e.g. \NewDocumentCommand {\foo} { d<> d() d[] } – Scott H. Jul 11 '12 at 6:21 |
|||
|
@ScottH. You could but you shouldn't use delimiters just to distinguish arguments. LaTeX always uses [] for optional arguments except in special cases () for picture mode coordinates and <> for package-specific syntax such as beamer. If you ned a lot of options it is better to use a single [] argument and then a key=value syntax within that. – David Carlisle Jul 11 '12 at 8:58 |
\sqrt[3]{2}, and the[]represent an optional parameter. The third is the normal case of two parameters as in\frac{}{}. The second, having the optional parameter following the mandatory is possible using thexparsepackage but I would recommend not doing that. – Peter Grill Jul 11 '12 at 5:13