[texhax] Detection of start of source line

Philip Taylor P.Taylor at Rhul.Ac.Uk
Wed Oct 5 18:16:42 CEST 2016


Without trying it (I have a cat on my lap and am wearing the wrong glasses for using a computer), I would make ^^M active and define it along the lines of the following :

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

Philip Taylor
--------
Christian Neukirchen wrote:
> for an evil hack, I wondered if it is possible for a macro (think
> active char) to detect whether it was called "at the beginning of the
> source line".
>
> E.g. I could want to define * to expand to \item if its the first
> token of an input line, and to render an asterisk else.
>
> Any ideas how to do this within the means of TeX?



More information about the texhax mailing list