diff options
Diffstat (limited to 'exercisesheets.sty')
| -rw-r--r-- | exercisesheets.sty | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/exercisesheets.sty b/exercisesheets.sty index 9492cb9..29c2728 100644 --- a/exercisesheets.sty +++ b/exercisesheets.sty @@ -1209,6 +1209,8 @@ \ifluatex \usepackage{luacode} + +%change only some catcodes to \begingroup \catcode`!=0 \catcode`\@=11 @@ -1219,13 +1221,14 @@ \catcode`>=2 \catcode`\~=11 \catcode`\\=11 -%% Exoanded, when \catcode`\^^M=12 holds -!global!long!def!@start@Lexercise@Helper#1\end{Lexercise}< % +%% Expanded, when \catcode`\^^M=12 holds +!global!long!def!exsh@start@Lexercise@#1\end{Lexercise}< % !directlua<exsh_cur_exercise=exercise ({#1})> % - !endgroup!end<Lexercise>!par % + !endgroup!end<Lexercise>% > !endgroup -\def\startLexercise{ + +\def\exsh@lua@catcodesBG{ \begingroup \catcode`!=12 \catcode`\$=12 @@ -1240,13 +1243,16 @@ \catcode`\@=11 \catcode`\%=12 \catcode`\^^I=12 -\catcode`\^^J=12\catcode`\^^M=12\catcode`\\=11\endlinechar-1\@start@Lexercise@Helper} +\catcode`\^^J=12\catcode`\^^M=12\catcode`\\=11\endlinechar-1} + +\def\exsh@start@Lexercise{% + \exsh@lua@catcodesBG\exsh@start@Lexercise@} \newenvironment{Lexercise}{% - \startLexercise% + \exsh@start@Lexercise% }{% \directlua{tex.print(exsh_cur_exercise)} } -\directlua{dofile("lexercise.lua")} +\directlua{dofile("exsh_lexercise.lua")} \fi |
