LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Forum View

Use Monospaced Font
Show HTML Part by Default
Condense Mail Headers

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

Print Reply
Sender:
Mailing list for the LaTeX3 project <[log in to unmask]>
Date:
Sun, 2 Jan 2011 07:27:46 -0800
Reply-To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Subject:
MIME-Version:
1.0
Message-ID:
In-Reply-To:
Content-Type:
multipart/alternative; boundary="0-174327478-1293982066=:54913"
From:
Paul Thompson <[log in to unmask]>
Parts/Attachments:
text/plain (1607 bytes) , text/html (2432 bytes)
There is really a somewhat deeper issue.  Like many who use LaTeX for more than 
superficial stuff (I wrote a class file newlfm and several sty files, most of 
which are not much used), I can read documentation and figger it out somewhat.  
However, knowing of the EXISTENCE of a tool is really the key, not how it is 
used.  How are people to learn that specific primitives exist?  It's not in the 
LaTeX Companion, which is my starting point.

 Paul Thompson



________________________________
From: Joseph Wright <[log in to unmask]>
To: [log in to unmask]
Sent: Sun, January 2, 2011 5:45:58 AM
Subject: Re: LaTeX3 and engines

On 01/01/2011 21:16, Arno Trautmann wrote:
> Paul Thompson wrote:
>> What sort of documentation is available for \pdfstrcmp?  I confess that I 
have
>> never heard of this toolset.
> 
> pdfTeX manual says:
> 
> \pdfstrcmp<general text>  <general text>  (expandable)
> This command compares two strings and expands to 0 if the strings are
> equal, to -1 if the first string ranks before the second, and to 1
> otherwise. The primitive was introduced in pdfTEX 1.30.0.
> 
> searching the internet may bring even more information.

Like many of the newer pdfTeX primitives, there is to some extend a need to 
'suck it and see' to find out what happens. For LaTeX3, all we do is use the 
'equal' test. The test does expansion, so to test two token lists as strings 
without any expansion, you do

\def\StringCompareTF#1#2{%
  \ifnum\pdfstrcmp{\unexpanded{#1}}{\unexpanded{#2}}=\z@
    \expandafter\@firstoftwo
  \else
    \expandafter\@secondoftwo
  \fi
}

or code to that effect.
--
Joseph Wright


ATOM RSS1 RSS2