| 1 |
% see lua-visual-debug.lua file for copyright information (MIT License) |
| 2 |
|
| 3 |
\ifx\ProvidesPackage\undefined |
| 4 |
\input ifluatex.sty\relax |
| 5 |
\else |
| 6 |
\NeedsTeXFormat{LaTeX2e} |
| 7 |
\ProvidesPackage{lua-visual-debug}[2026-04-24 v1.1 |
| 8 |
Visual debugging in LuaLaTeX (PGU)] |
| 9 |
\RequirePackage{ifluatex} |
| 10 |
\fi |
| 11 |
|
| 12 |
\ifx\ProvidesPackage\undefined |
| 13 |
\ifluatex |
| 14 |
\input atbegshi.sty\relax |
| 15 |
\directlua{ |
| 16 |
local resolved = kpse.find_file("luakeyval.lua") |
| 17 |
if resolved then |
| 18 |
require("lua-visual-debug-keys") |
| 19 |
end |
| 20 |
lvd = require("lua-visual-debug")} |
| 21 |
\AtBeginShipout {\directlua{lvd.show_page_elements(tex.box["AtBeginShipoutBox"])}}% |
| 22 |
\AtBeginShipoutInit |
| 23 |
\else |
| 24 |
\message{Warning: lua-visual-debug only works with LuaTeX (plain and LaTeX format)} |
| 25 |
\fi |
| 26 |
\else |
| 27 |
\ifluatex |
| 28 |
\directlua{ |
| 29 |
local resolved = kpse.find_file("luakeyval.lua") |
| 30 |
if resolved then |
| 31 |
require("lua-visual-debug-keys") |
| 32 |
end |
| 33 |
local lvd = require("lua-visual-debug").show_page_elements |
| 34 |
luatexbase.add_to_callback('pre_shipout_filter', lvd, 'lvd') |
| 35 |
} |
| 36 |
\else |
| 37 |
\PackageWarning{lua-visual-debug}{You are using this package without LuaTeX. This is not supported, so you don't get any visual debugging.} |
| 38 |
\fi |
| 39 |
\fi |
| 40 |
|