Received: from mx0.gmx.net (mx0.gmx.net [213.165.64.100]) by h1439878.stratoserver.net (8.14.2/8.14.2/Debian-2build1) with SMTP id p4BJK6e4021981 for ; Wed, 11 May 2011 21:20:08 +0200 Received: (qmail 14067 invoked by alias); 11 May 2011 19:20:01 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: (qmail invoked by alias); 11 May 2011 19:20:01 -0000 Received: from relay.uni-heidelberg.de (EHLO relay.uni-heidelberg.de) [129.206.100.212] by mx0.gmx.net (mx004) with SMTP; 11 May 2011 21:20:01 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [129.206.100.94]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id p4BJHuc7023181 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 11 May 2011 21:17:56 +0200 Received: from listserv.uni-heidelberg.de (localhost.localdomain [127.0.0.1]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id p4BH6lY9003961; Wed, 11 May 2011 21:17:55 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 1254810 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Wed, 11 May 2011 21:17:55 +0200 Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id p4BJHtEf005011 for ; Wed, 11 May 2011 21:17:55 +0200 Received: from anchor-post-1.mail.demon.net (anchor-post-1.mail.demon.net [195.173.77.132]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id p4BJHj35023135 for ; Wed, 11 May 2011 21:17:49 +0200 Received: from cremornelane.demon.co.uk ([80.177.25.195] helo=palladium.local) by anchor-post-1.mail.demon.net with esmtp (Exim 4.69) id 1QKEun-0005jN-i0; Wed, 11 May 2011 19:17:45 +0000 User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-GB; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 References: <4DCADD93.6090009@gmx.de> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Message-ID: <4DCAE0D9.8@morningstar2.co.uk> Date: Wed, 11 May 2011 20:17:45 +0100 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Joseph Wright Subject: Re: compare string with \c_job_name_tl To: LATEX-L@listserv.uni-heidelberg.de In-Reply-To: <4DCADD93.6090009@gmx.de> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-GMX-Antispam: 0 (eXpurgate); Detail=5D7Q89H36p4yCuwxJv6KY6ambsbnOIeuYCUPd7Rm9N1vQV50+K+S51M5B9Fm0XQHYJfev XItyp29Sgq4UTzooyNTwwieOJOM7GUIOURvFA+qqaP6fXiN1uU+3QT9mD5bbYymHw4yddasy5IHb h1QJpa9d+UKimP9ihdA8gknxZFPpCtiX/po5gjxpsO7QdmgdJmEqtER+0BhhOEWRqqEwQ==V1; X-Resent-By: Forwarder X-Resent-For: rainer.schoepf@gmx.net X-Resent-To: rainer@rainer-schoepf.de Status: R X-Status: X-Keywords: X-UID: 6738 On 11/05/2011 20:03, Arno Trautmann wrote: > Hi all, > > sorry for this rather trivial question, but at the moment it's driving > me crazy … > I just want to execute some code depending on the jobname. I found a > solition by Donald Arsenau¹ that looks rather lengthy. So, I thought > with LaTeX3, everything is easier. Now I tried this: > > \documentclass{minimal} > \usepackage{expl3} > \begin{document} > \ExplSyntaxOn > \tl_set:Nn\myjob{a} > \tl_set:Nx\myjobii{\tl_to_str:N\myjob} > \tl_if_eq:NNTF\myjobii\jobname{true}{false} > \ExplSyntaxOff > \end{document} > > because, based on Donald's post, I assumed that I need to have an “a” > with catcode “other” for a successfull test. > > Now, calling > lualatex --jobname=a test.tex > always prints “false”. So – what is my mistake here and what would be > the easiest way for such a test using expl3? > > cheers > Arno The \jobname primitive is not a token list variable, so this test won't work: you want \c_job_name_tl. However, I'd use the \str_if_eq:xxTF test here, as you want a string comparison \documentclass{minimal} \usepackage{expl3} \begin{document} \ExplSyntaxOn \str_if_eq:nnTF{a}{\c_job_name_tl}{true}{false} \ExplSyntaxOff \end{document} (This will work with \jobname as well, but the 'official' interface to that in LaTeX3 is \c_job_name_tl.) -- Joseph Wright