[texhax] Detection of start of source line

Philip Taylor P.Taylor at Rhul.Ac.Uk
Wed Oct 5 18:24:06 CEST 2016


But now that the cat has got off and I am wearing the right glasses, I can confirm that my suggestion does not work as-is; even when \futurelet has changed \nexttoken into the character '*', the \ifx fails, for reasons that temporarily escape me ...

> {changing \nextoken=the letter a}
>
> {into \nextoken=the character *}
>
> \treatasteriskspecially -> \ifx *\nexttoken \item \else \char `\* \fi
>
> {blank space }
>
> {\ifx: (level 1) entered on line 7}
>
> {false}
>
> {\else: \ifx (level 1) entered on line 7}
>
> {\char}
>
> {\fi:
>


Philip Taylor wrote:
>     \def \treatasteriskspecially { \ifx *\nexttoken \item \else \char `\* \fi}
>     \catcode `\^^M = \active \def ^^M{\futurelet \nextoken \treatasteriskspecially}

-- 

Philip Taylor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/texhax/attachments/20161005/0c2523b9/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Signature.jpg
Type: image/jpeg
Size: 12104 bytes
Desc: not available
URL: <http://tug.org/pipermail/texhax/attachments/20161005/0c2523b9/attachment-0001.jpg>


More information about the texhax mailing list