LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Classic View

Use Monospaced Font
Show HTML Part by Default
Show All Mail Headers

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

Print Reply
Paul Thompson <[log in to unmask]>
Thu, 6 Jan 2011 09:37:35 -0800
text/plain (2034 bytes) , text/html (2772 bytes)
The optional argument thing could be better handled by using named arguments.  
So, for \parbox, which has optional and mandatory arguments, we currently have 


\parbox[pos][height][inner-pos]{width}{text}

This is mindlessly confusing in many cases.  Why not have 

\parbox{pos=t,height=something,innerpos=t,width=something}{text}

 
The use of named arguments is vastly superior to positional arguments, 
especially when optional arguments can be specified.  

Don't even get me started on \newcommand.

Paul Thompson



________________________________
From: Frank Mittelbach <[log in to unmask]>
To: [log in to unmask]
Sent: Thu, January 6, 2011 11:15:17 AM
Subject: Re: variable opt arg delimiters [was: Defining a ...]

Uwe Lueck writes:
> I wrote:
> > A better proposal than using different category codes is 
> > programming macros with optional arguments obeying 
> > a convention that makes a choice of delimiters available to users.  
> > Any macro package replacing \@ifnextchar[ by some 
> > \ifx\let@token\opt@arg@delim could be run this way. 
> > 
> > If no LaTeXY will adopt this, I will call it LüTeX :-)
> 
> I had thought of posting such a "feature request" earlier, 
> refrained from it for not having found a good idea how 
> to implement it. If I now found it so simple, I must have 
> overlooked a problem ...
> 
>  [...]
> 
> Maybe this already is in xparse? Sorry, I cannot afford more right now ...

Uwe

xparse offer a fairly general snytax including variable delimiters and default
values per argument and more. Perhaps you should *indeed* have a look at it
one day :-) and it could be easily used on top of 2e if so desired

what is not offered right now is mandatory arguments with arbitrary delimiters
on the left or right, though one could achieve even those in an emergency
using "u" argument type twice (I guess)

frank


ATOM RSS1 RSS2