[texhax] detect characters in strings
Uwe Lueck
uwe.lueck at web.de
Wed Jul 7 20:31:49 CEST 2010
"Philip Taylor (Webmaster, Ret'd)" <P.Taylor at Rhul.Ac.Uk>, 07.07.2010 20:14:37
> Maybe try \edef ?
Somewhere earlier I wrote that the macros from substr.sty are not expandable. This really means that they break in an \edef as well as in a \typeout, sorry. And BTW, a pair of braces seems to be missing with the first \typeout ... and what are you doing with #1 in \SciToFP? Please tell what you expect \SciToFP to do ...
Cheers,
Uwe.
>--------
>Brandon Kuczenski wrote:
>
>> I'd like to use \BeforeSubString and \BehindSubString,
>> except I can't figure out how to use them:
>>
>> \BeforeSubString{substring}{string} "Returns" the part of that
>> is before -- how does it "return" anything? The following
>> doesn't work:
>>
>> \def\SciToFP#1#2{%
>> \typeout#2
>> \def\mantissa{\BeforeSubString{e}{#2}}
>> \typeout\mantissa
>> % ... do something with mantissa and FP
>> }
>>
>> it fails with the error:
>> ! Undefined control sequence.
>> \su at BeforeSubString #1#2->\def \su at rest
>> ##1#1##2\@nil {##1}\IfSubStringInStr...
>>
>> I tried with \let too and that didn't work:
>>
>> \let\mantissa=\BeforeSubString{e}{#2}
>>
>> gives me
>> ! Argument of \mantissa has an extra }.
>>
>> \par
More information about the texhax
mailing list