File: lua-visual-debug.sty

package info (click to toggle)
texlive-base 2016.20170123-5
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 627,176 kB
  • ctags: 24,420
  • sloc: perl: 43,364; sh: 6,299; makefile: 4,230; ruby: 2,557; xml: 2,480; ansic: 2,277; cpp: 695; tcl: 670; awk: 606; lisp: 366; python: 344; php: 65; java: 32; sed: 8
file content (37 lines) | stat: -rw-r--r-- 1,050 bytes parent folder | download
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
% see lua file for copyright information (MIT License)

\def\lvdebugpkgdate{2016/05/30}
\def\lvdebugpkgversion{0.5}

\expandafter\ifx\csname ProvidesPackage\endcsname\relax
  \input ifluatex.sty\relax
\else
  \NeedsTeXFormat{LaTeX2e}
  \ProvidesPackage{lua-visual-debug}[\lvdebugpkgdate\space v\lvdebugpkgversion\space Visual debugging in LuaLaTeX (PGU)]
  \RequirePackage{ifluatex}
\fi

\def\luavisualdebug@dothings{%
  \directlua{ lvd = require("lua-visual-debug")}%
  \AtBeginShipout {\directlua{lvd.show_page_elements(tex.box["AtBeginShipoutBox"])}}%
}

\expandafter\ifx\csname ProvidesPackage\endcsname\relax
  \ifluatex
   \input atbegshi.sty\relax
   \luavisualdebug@dothings
   \AtBeginShipoutInit
  \else
    \message{Warning: lua-visual-debug only works with LuaTeX (plain and LaTeX format)}
  \fi
\else
  \ifluatex
    \RequirePackage{atbegshi}
    \luavisualdebug@dothings
  \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