In new versions of xparse the manual states the following: (in 2. Backwards Compatibility)

One role of xparse is to describe existing LaTeX interfaces, including some that are rather unusual in LaTeX (as opposed to formats such as plain TeX) such as delimited arguments. As such, the package defines some argument specifiers that should largely be avoided nowadays as using them in packages leads to inconsistent user interfaces. The simplest syntax is often best, with argument specifications such as mmmm or ommmm (...)

What kind of problems like that 'inconsistent user interfaces' might exhibit using for example g-parameter or G-parameter?

I'm the author of a class that rely on macros based on these parameters and would be good knowing if authors of LaTeX3'xparse will drop the support of these parameters or what issues on which circumstances might exhibit...

Edit: As not everyone is familiar with the different parameter types the xparse package provides, here's the description for g and G from the documentation:

g: An optional argument given inside a pair of TeX group tokens (in standard LaTeX, {...}), which returns -NoValue- if not present.
G: As for g but returns <default> if no value is given: G{<default>}.

  • 2
    I think the main issue is that it is not the usual LaTeX style to have optional parameters before the mandatory parameters and that the optional parameters are to be specified with a[] and not a {}. Another issue is in deterring the last optional parameter which may confuse people if the omit the last optional parameter and put a trailing % after the use of the macro. – Peter Grill Dec 7 at 6:10
up vote 8 down vote accepted

The xparse package is primarily meant to allow definition of 'LaTeX2e-like' commands, though it also can standardise the description of a wider range of interfaces. The LaTeX2e kernel is very consistent in using {...} for mandatory arguments and [...] for optional ones ((...) is used for picture-mode arguments). As such, the g-type argument is an outlier: it's not really standard LaTeX2e usage at all. We include it as it does come up in e.g. beamer,

\begin{frame}{title}{sub-title}

Probably, written today one would normally use keyval systems for such cases

\begin{frame}[title = ..., subtitle = ...]

In general, I would avoid using g-type arguments for new commands.

  • Thanks, and also to @Peter. I'm using these parameters in a convenient way, the same way as they was conceived by LaTeX3 developers I guess. I understand the motivation behind hiding or advising against the use of these parameters, but the text quoted from the manual on 'backwards compatibility' should be understood as 'please don't use them anymore, they will be removed soon'? These 'inconsistent user interfaces' would refer to an inconsistency regarding the standard LaTeX parameter usage or instead it would refer to unpredictable results if we insist on using them? – Emilio Lazo Dec 8 at 6:28
  • @EmilioLazo Inconsistent with LaTeX conventions – Joseph Wright Dec 8 at 16:37
  • Yes, it is! Thank you. – Emilio Lazo Dec 8 at 18:35

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.