Difference between revisions of "Visual Debugging"
Line 106: | Line 106: | ||
{{cmd|showbodyfont}} : actual bodyfont family with all variants | {{cmd|showbodyfont}} : actual bodyfont family with all variants | ||
− | <context> | + | <context source="yes"> |
− | + | \showbodyfont[pagella,7pt] | |
− | \showbodyfont[pagella, | ||
</context> | </context> | ||
{{cmd|showbodyfontenvironment}} : draws a table that shows which point sizes match the relative sizes | {{cmd|showbodyfontenvironment}} : draws a table that shows which point sizes match the relative sizes | ||
− | <context> | + | <context source="yes"> |
− | \ | + | \showbodyfontenvironment[pagella,7pt] |
− | |||
</context> | </context> | ||
{{cmd|showsymbolset}}[''symbolset name''] : shows all the symbols within a given symbol set | {{cmd|showsymbolset}}[''symbolset name''] : shows all the symbols within a given symbol set | ||
− | + | <context source="yes"> | |
− | |||
− | |||
− | <context> | ||
− | |||
\showsymbolset[navigation 1] | \showsymbolset[navigation 1] | ||
</context> | </context> | ||
− | {{cmd| | + | {{cmd|ShowCompleteFont}} : list of available chars of actual bodyfont encoding ({{cmd|showcharacters}} for MkII) |
− | <context> | + | |
− | \ | + | <context source="yes"> |
− | + | \setupbodyfont[pagella,7pt] | |
− | \ | + | \ShowCompleteFont |
</context> | </context> | ||
+ | |||
{{cmd|showmathcharacters}} : list of all the available math (non-alphabetical) characters available in math, now including all the AMS characters. MkII only | {{cmd|showmathcharacters}} : list of all the available math (non-alphabetical) characters available in math, now including all the AMS characters. MkII only |
Revision as of 11:20, 18 May 2024
Page is focused on the old Mark II ConTeXt version, though \show... commands are still the same. Work-in-progress page on current LMTX version is Debugging.
There's a whole lot of commands that help you analyzing and debugging your ConTeXt documents. Most of them start with \show... or \trace.... While \showsomething is a command that immediately inserts something, \tracesomethingtrue or ...false is a switch that influences the behaviour of some other commands. You can check the setting with \iftrace.... In the following we leave out the boolean value (true or false).
Contents
Unordered
\tracefiles : ?
\tracepositions : ?
\traceposstring : ?
\traceotr : output routine?
\showboxes : show boxes
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.
\showlayoutcomponents : To allow Acrobat Reader users (among others?) to make layers visible/invisible at will, add this command at the start of your file.
Show attributes of visual elements
\usemodule [setups] \starttext % \setuphead [..,..=..,..] \showrootvalues [head] % \setuphead [chapter] [..,..=..,..] \showinstancevalues [head] [chapter] \stoptext
Grid, Layers and Column Sets
\tracelayers : show boxes of layers
\tracecolumnset : ?
\tracetextareas : ?
\showgrid : make line grid visible
Tables
\tracetables : ?
\traceTABLE : ?
\tracetabulate : ?
Math
\tracemathtrue : show the layout boxes for left, middle, or right-aligned formulas.
\tracemathsymbol{name of math symbol} : show the command (name of symbol) and the symbol itself
\tracemathcollectiontrue \tracemathsymbol{Re} \tracemathsymbol{Im}
Bookmarks and References
\tracebookmarks : ?
\tracelinenotes : ?
\tracereferences : ?
\tracelabels : ?
Fonts and Type
\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 : list of available chars of actual bodyfont encoding (\showcharacters for MkII)
\setupbodyfont[pagella,7pt] \ShowCompleteFont
\showmathcharacters : list of all the available math (non-alphabetical) characters available in math, now including all the AMS characters. MkII only
\showaccents : shows A-Z and a-z with all available accents, MkII only
\showstruts : display struts (invisible placeholders for proper minimum line heights)
(Make a better, slightly more complex example.)
\setupframed[framecolor=gray] \showstruts This will display \strut struts.\crlf Frame with struts: \framed{xxx}\crlf And frame without them: \framed[strut=no]{xxx}
\showfontstrip : the current typeface combination, with roman, sans, math, and teletype families visualised, with x-heights
\tracechinese : ?
\tracedfontname{Font Name} : Chain of synonyms for the given font name
\tracedfontname{Bold}
Colors and Graphics
Colors
\showcolor : see Color
\showcolorgroup : ?
\showpalet : ?
\tracedgreymode : ?
Figures
\tracesidefloats : ?
Interaction
\showfields : ?
\tracefields : ?
\traceJScode : trace JavaScript code
TODO: A lot of commands and switches are still unexplained. (See: To-Do List) |