[latex3-commits] [l3svn] r6899 - Document suggestion in xparse for two successive optional arguments (see #327)

noreply at latex-project.org noreply at latex-project.org
Sun Feb 12 07:07:46 CET 2017


Author: bruno
Date: 2017-02-12 07:07:46 +0100 (Sun, 12 Feb 2017)
New Revision: 6899

Modified:
   trunk/l3packages/xparse/xparse.dtx
Log:
Document suggestion in xparse for two successive optional arguments (see #327)

I've put this at the end of the doc of \IfNoValue, for lack of a better place.
The text is not good, please improve.


Modified: trunk/l3packages/xparse/xparse.dtx
===================================================================
--- trunk/l3packages/xparse/xparse.dtx	2017-02-12 05:54:17 UTC (rev 6898)
+++ trunk/l3packages/xparse/xparse.dtx	2017-02-12 06:07:46 UTC (rev 6899)
@@ -493,6 +493,15 @@
 %     \IfNoValueTF{-NoValue-}
 %   \end{verbatim}
 %   will be logically \texttt{false}.
+%
+%   When two optional arguments follow each other (a syntax we typically
+%   discourage), it can make sense to allow users of the command to
+%   specify only the second argument by providing an empty first
+%   argument.  Rather than testing separately for emptyness and for
+%   |-NoValue-| it is then best to use the argument type~|O| with an
+%   empty default value, and simply test for emptyness using the
+%   \pkg{expl3} conditional \cs{tl_if_blank:nTF} or its \pkg{etoolbox}
+%   analogue \tn{ifblank}.
 % \end{function}
 %
 % \begin{function}[EXP]{\IfValueT, \IfValueF, \IfValueTF}



More information about the latex3-commits mailing list