Debugging

From Wiki
Jump to navigation Jump to search

< Visual Debugging | Trackers >

This is an update of Visual Debugging page (focused on the old ConTeXt version Mark II) for the current Mark XL (aka LMTX) version.

Code

\enabletrackers, see also Trackers

\tracingall turns on all tracing. Put someplace near when you think the problem happens.

TeX

Lua

XML

Visuals

There are a lot of helpers which make things visible in the PDF. Mostly they have a form of \show... commands.

Layout

\showlayout : add four pages that show margins, layout sizes etc.

\showsetups : typeset a list of all defined sizes (variables) and their values

\showmakeup : show some otherwise invisible markup

\showframe : show frames of text area, layers, boxes etc.

Fonts

\replacemissingcharacters will replace characters missing in the font(s) with squares respecting font switches (\it, \bf). Underneath the squares are wanted characters, so though invisible, one can still search (in searchable PDF editors) or copy them to the text editor to see the missing characters.

\showbodyfont : actual bodyfont family with all variants

\showbodyfont[pagella,7pt]

\showbodyfontenvironment : draws a table that shows which point sizes match the relative sizes

\showbodyfontenvironment[pagella,7pt]

\showsymbolset[symbolset name] : shows all the symbols within a given symbol set

\showsymbolset[navigation 1]

\ShowCompleteFont from module fnt-10 : list of available chars of actual bodyfont encoding

\usemodule[fnt-10]
\setupcolors[state=start]
\starttext
\ShowCompleteFont{name:texgyrepagella}{8pt}{1}
\stoptext

\showmathcharacters from module math-characters : list of all the available math (non-alphabetical) characters available in math, now including all the AMS characters.

\usemodule[math-characters]
\setupcolors[state=start]
\setupbodyfont[pagella,7pt]
\starttext
\showmathfontcharacters
\stoptext

\showstruts : display struts (invisible placeholders for proper minimum line heights)

(Make a better, slightly more complex example.)

\setupbodyfont[pagella,7pt]
\framed[frame=off,align=normal]{\showstruts
This will display \strut struts.\crlf
A frame with strut \framed[strut=yes]{xxx} and frame without \framed[strut=no]{xxx}}

\showfontstrip : the current typeface combination, with roman, sans, math, and teletype families visualised, with x-heights and m widths.

\setupbodyfont[pagella,7pt]
\framed[frame=off]{\showfontstrip}

\tracedfontname{Font Name} : Chain of synonyms for the given font name

\setupbodyfont[pagella,7pt]
\framed[frame=off]{\tracedfontname{Bold}}


Coloring

Paragraph and page composition

\showmakeup shows how TeX composes text to paragraphs and paragraphs into pages. It inserts PDF layers in the output, which can be switched on/off. By default there are glue, hbox, kern, penalty and vbox layers. See \showmakeup to see other options.