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