context.starttyping() prints two hash marks iff first printed character is a hash mark
Hi all, I'm doing some stuff with verbatim text and LuaTex, and found the following problem: After context.starttyping(), a hash mark in the first position gets printed twice. A hash mark in any other position gets printed normally. This bug does not occur after tex.print("\\starttyping"), See the code below. Cheers, Sietse Brouwer \starttext \startluacode -- incorrectly prints two hash marks context.starttyping() tex.print("#") tex.print("\\stoptyping") -- correctly prints one hash mark context.starttyping() tex.print("asdf") tex.print("#") tex.print("\\stoptyping") -- correctly prints one hash mark tex.print("\\starttyping") tex.print("#") tex.print("\\stoptyping") \stopluacode \stoptext -- Sietse Brouwer -- sbbrouwer@gmail.com -- +31 6 13.456.848 Verlengde Wassenaarseweg 4a -- 2342 BG Oegstgeest -- the Netherlands MSN: sietse@gawab.com -- ICQ: 341232104
On 22-1-2012 22:41, Sietse Brouwer wrote:
After context.starttyping(), a hash mark in the first position gets printed twice. A hash mark in any other position gets printed normally. This bug does not occur after tex.print("\\starttyping"),
It's not so much a bug as a side effect of catcode regimes, tex interpreting hashes and either or not delayed flushing. You can use tex.print(tex.vrbcatcodes,"#") (or context.verbatim cum suis) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (2)
-
Hans Hagen
-
Sietse Brouwer