LATEX-L Archives

Mailing list for the LaTeX3 project


Options: Use Classic View

Use Proportional Font
Show HTML Part by Default
Condense Mail Headers

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

Print Reply
Sender: Mailing list for the LaTeX3 project <[log in to unmask]>
Date: Wed, 11 May 2011 21:39:33 +0200
Reply-To: Mailing list for the LaTeX3 project <[log in to unmask]>
MIME-Version: 1.0
Message-ID: <[log in to unmask]>
In-Reply-To: <[log in to unmask]>
Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigBA037B3C7A31836B8B6218C1"
From: Arno Trautmann <[log in to unmask]>
Parts/Attachments: text/plain (1768 bytes) , signature.asc (261 bytes)
Joseph Wright wrote:
> 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.

Yes, I tried that, too, but it didn't work … but thanks.

> 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.)

Your example fails, but the :no variant works in this case.
However, I seem not to get it working for comparing a command to the
jobname – what do I have to do to say


I tried to use \tl_to_str in the argument of a \str_if_eq:ooTF, but that
still results in false.