View Issue Details

IDProjectCategoryView StatusLast Update
0000341luatexfeature requestpublic2010-03-12 15:46
Reporterpatrick Assigned ToTaco  
PrioritynormalSeverityfeatureReproducibilityhave not tried
Status closedResolutionfixed 
Fixed in Version0.51.0 
Summary0000341: tex.sprint() with different catcodes
DescriptionSometimes I would like to feed this into tex.sprint():

\begingroup\font\myfont <userinput with all kinds of characters including "\" > \endgroup

That means I must make at least one character active, in this case the backslash.

I would like to have a feature that assigns catcodetables (the corresponding numbers) to input. For example:

(pseudo code)
tex.sprint( 1 -> "\begingroup\font\myfont" ,
                     2 -> <userinput>,
                     1 -> "\endgroup")

where 1 would be a standard catcode table and 2 would be a "all characters are non-special" catcode table.

That way I don't have to check the user input.
TagsNo tags attached.

Activities

Taco

2010-03-04 16:59

administrator   ~0000457

Hans and I think this is better with a different function name, as sprint
is overloaded already. The idea is this:

tex.tprint({ctxcatcodes, "aa", "..."}, {xmlcatcodes, "..."}, ...)

eol behaviour would be similar to tex.sprint (a.o.t. tex.print)

patrick

2010-03-05 07:54

reporter   ~0000458

The name does not matter for me. tprint is perfectly fine.

Would it then make sense to have a predefined catcode table that has no active characters? Is it possible to define a catcode table (in TeX or on the lua side) that has no active character?

patrick

2010-03-05 08:58

reporter   ~0000459

Last edited: 2010-03-05 08:59

"active" was misleading, of course. I would like to have something like:

\begingroup
\catcode`\^= 12
\catcode`\$= 12
\catcode`\_= 12
\catcode`\{=12
\catcode`\}=12
\catcode`\%=12
\catcode`\&=12
\catcode`\~=12
\catcode`\#=12
\catcode`\\=12
\savecatcodetable 1
\endgroup

Which doesn't work (I'd guess) because of the "other \" in \endgroup.

Taco

2010-03-08 14:01

administrator   ~0000461

You can use -2 for a catcode table matching '\the' (everything is 12 or 10).

I've added this information to the manual, where it was still missing.

Taco

2010-03-08 14:38

administrator   ~0000462

#3458 implements tex.tprint()

Issue History

Date Modified Username Field Change
2010-03-04 16:14 patrick New Issue
2010-03-04 16:59 Taco Note Added: 0000457
2010-03-04 16:59 Taco Assigned To => Taco
2010-03-04 16:59 Taco Status new => assigned
2010-03-05 07:54 patrick Note Added: 0000458
2010-03-05 08:58 patrick Note Added: 0000459
2010-03-05 08:59 patrick Note Edited: 0000459
2010-03-08 14:01 Taco Note Added: 0000461
2010-03-08 14:38 Taco Note Added: 0000462
2010-03-08 14:38 Taco Status assigned => resolved
2010-03-08 14:38 Taco Resolution open => fixed
2010-03-12 15:46 Taco Fixed in Version => 0.51.0
2010-03-12 15:46 Taco Status resolved => closed