Changes

Jump to navigation Jump to search
→‎Making \command{arg1}{arg2} hook into Lua: expand notes concerning the escaping of strings
\def\surroundwd#1%
{\ctxlua{userdata.surroundwithdashes([==[#1]==])}}
</texcode>
% ''NB'': quoting with <code>[==[#1]==] is </code>([http://www.lua.org/manual/5.2/manual.html#3.1 long strings])works just like <code>"#1"</code> in most cases, but in addition % it is robust against <code>#1 </code> containing the quotation mark `<code>"`</code> which would terminate the Lua string prematurely.Inside <code>\protect .. \unprotect</code> the macros <code>\!!bs</code>and <code>\!!es</code> are at your disposition.They are equivalent to <code>[===[</code> and <code>]===]</texcodecode>and --being single tokens to TeX -- parsed faster.(See [http://repo.or.cz/w/context.git/blob/refs/heads/origin:/tex/context/base/luat-ini.mkiv#l174 <code>luat-ini.mkiv</code>].)
== Making \startenv...\stopenv hook into Lua ==
188

edits

Navigation menu