TransWikia.com

How can I recognize a dot followed by a space and output dot?

TeX - LaTeX Asked on August 16, 2021

In the following code I cannot figure out what to use for SPACE and DOT such that peektoken is compared to a space( ) and a dot(.) is produced as output along with the result of the test T(rue) or F(alse).

catcode`.=active
defdotnext{ifxpeektokenSPACEDOT Telse DOT Ffi}
def.{futureletpeektokendotnext}
Lorem. Ipsum.  is. simply.  dummy text.
bye

One Answer

You want SPACE to be let to a space token for the ifx test, and DOT to be let to a catcode12 . or def to expand to a catcode 12 . (I do the latter here)

enter image description here

defDOT{.}
catcode`.=active
lowercase{letSPACE= } %

defdotnext{ifxpeektokenSPACEDOT Telse DOT Ffi}
def.{futureletpeektokendotnext}
Lorem. Ipsum.  is. simply.  dummy text.

a.b.c.

bye

Answered by David Carlisle on August 16, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP