TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any difference between \startlua and \startluacode? The commands seem to have a similar purpose, but I have found some code does compile properly if the wrong one is chosen. When is one used? When is the other?

share|improve this question
Can you provide an example where startlua works and startluacode not. – Marco Daniel Apr 6 '12 at 15:57
up vote 11 down vote accepted

The difference are the catcodes. \startlua uses TeX catcodes, startluacode uses Lua catcodes. Two examples:


-- fails both
-- context("Foo %Bar")
-- %context("Foo \n Bar")

-- prints Foo
-- context("Foo %Bar")

-- prints Foo Bar
context("Foo \n Bar")


For more information you can have a look at the source file luat-ini.mkiv.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.