| 1 |
%% luakeys-debug.tex |
| 2 |
%% Copyright 2021-2025 Josef Friedrich |
| 3 |
% |
| 4 |
% This work may be distributed and/or modified under the |
| 5 |
% conditions of the LaTeX Project Public License, either version 1.3c |
| 6 |
% of this license or (at your option) any later version. |
| 7 |
% The latest version of this license is in |
| 8 |
% http://www.latex-project.org/lppl.txt |
| 9 |
% and version 1.3c or later is part of all distributions of LaTeX |
| 10 |
% version 2008/05/04 or later. |
| 11 |
% |
| 12 |
% This work has the LPPL maintenance status `maintained'. |
| 13 |
% |
| 14 |
% The Current Maintainer of this work is Josef Friedrich. |
| 15 |
% |
| 16 |
% This work consists of the files luakeys.lua, luakeys.sty, luakeys.tex |
| 17 |
% luakeys-debug.sty and luakeys-debug.tex. |
| 18 |
|
| 19 |
\directlua |
| 20 |
{ |
| 21 |
luakeys = require('luakeys')() |
| 22 |
if lparse == nil then |
| 23 |
lparse = require('lparse') |
| 24 |
end |
| 25 |
} |
| 26 |
|
| 27 |
% https://tug.org/TUGboat/tb32-1/tb100isambert.pdf |
| 28 |
% Not working in the LaTeX ltxdoc class! Why? |
| 29 |
\def\createcatcodes{\bgroup |
| 30 |
\catcode`\\=12 |
| 31 |
\catcode`\{=12 |
| 32 |
\catcode`\}=12 |
| 33 |
\catcode`\$=12 |
| 34 |
\catcode`\&=12 |
| 35 |
\catcode`\^^M=13 |
| 36 |
\catcode`\#=12 |
| 37 |
\catcode`\^=12 |
| 38 |
\catcode`\_=12 |
| 39 |
\catcode`\ =13 |
| 40 |
\catcode`\~=12 |
| 41 |
\catcode`\%=12 |
| 42 |
\savecatcodetable 31278 |
| 43 |
\egroup} |
| 44 |
\createcatcodes |
| 45 |
|
| 46 |
\def\Space{ } |
| 47 |
\bgroup |
| 48 |
\catcode`\^^M=13\gdef^^M{\quitvmode\par}% |
| 49 |
\catcode`\ = 13\gdef {\quitvmode\Space}% |
| 50 |
\egroup |
| 51 |
|
| 52 |
\def\luakeysdebug% |
| 53 |
{% |
| 54 |
\directlua% |
| 55 |
{ |
| 56 |
local oarg, marg = lparse.scan('o v') |
| 57 |
luakeys.print_debug(marg, oarg) |
| 58 |
}% |
| 59 |
} |