LATEX-L Archives

Mailing list for the LaTeX3 project


Options: Use Forum View

Use Monospaced Font
Show HTML Part by Default
Condense Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Mailing list for the LaTeX3 project <[log in to unmask]>
Frank Mittelbach <[log in to unmask]>
Thu, 30 Sep 1999 11:26:17 +0200
Mailing list for the LaTeX3 project <[log in to unmask]>
text/plain (33 lines)
Richard Hensh writes:
 > What does (or will) xparse offer to the casual end user? How about someone
 > who is not afraid to write a few macros but is not interested in designing
 > classes?

well xparse offers the ability to produce macros that have the look
and feel of standard LaTeX without the need to resort to lowlevel
programming, e.g., if you want to write a macro which has two optional
argument (with default values) and one mandatory one you simply write

\DeclareDocumentCommand \foo { O{default1} O{default2} n }
  { < code for the macro where #1 is first optional #2 is second optional
      and #3 is mandatory argument > }

doing this in current LaTeX would require several macros using
\@ifnectchar ... calling each other

if you like this is a generalization of
\newcommand\foo[2][default]{...}  which allows you to define a new
command with a single optional argument and one mandatory one (or
several ones if you replace 2 by a higher number).

does this answer your question?


ps stuff like template.dtx on the other hand is effectively of
interest only for class file writers or more explicitly for anybody
who wants to change the layout of a class (once classes are written
using this mechanism) --- in other words the concept of instances is
relevant to everybody (hopefully) even though only a few people will
ever write templates for instances.