[luatex] \luaescapestring and # tokens

Taco Hoekwater taco at elvenkind.com
Mon Jun 2 09:52:58 CEST 2014


On 02 Jun 2014, at 09:46, Joseph Wright <joseph.wright at morningstar2.co.uk> wrote:

>> 
>> Is this deliberate, and if so is there a reliable way of emulating
>> \pdfstrcmp in it's entirety?

\luaescapestring does nothing except making sure that the argument
is valid lua string content. So yes, then lack of doubling is deliberate.

To get matching strings, you will need to detokenize both, as done below.

Best wishes,
Taco


> 
> Suggestion from Bruno Le Floch to the LaTeX team:
> 
>  \long\def\pdf at strcmp#1#2{%
>    \directlua{%
>      strcmp (
>        "\luaescapestring{\detokenize\expandafter{\expanded{#1}}}",
>        "\luaescapestring{\detokenize\expandafter{\expanded{#2}}}"
>      )
>    }%
>  }
> 
> which does certainly work. Thoughts?
> --
> Joseph Wright
> 
> 





More information about the luatex mailing list