LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

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

Print Reply
Message-ID:
Sender:
Mailing list for the LaTeX3 project <[log in to unmask]>
Subject:
From:
Arno Trautmann <[log in to unmask]>
Date:
Fri, 24 Sep 2010 08:15:28 +0200
Content-Type:
multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigF928092DC9D07175EC80A0A0"
MIME-Version:
1.0
Reply-To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Parts/Attachments:
text/plain (501 bytes) , signature.asc (261 bytes)
Hi all,

again, a question about xparse, still hoping this is the right list for
that.
I want to do something like

\NewDocumentCommand\mycommand{O{#2}m}{#1 and #2.}

which should give the same result for \mycommand[a]{a} and
\mycommand{a}, i.e. “#1 is equal to #2 if #1 is not given“. Is there a
simple way to do this to avoid an if-construct:

\IfNoValue{#1}{\def\temp{#2}}{\def\temp{#1}}

and then use \temp instead of #1? If not, would this be possible (and
wanted) to be implemented?

cheers
Arno



ATOM RSS1 RSS2