Difference between revisions of "Visual Debugging"

From Wiki
Jump to navigation Jump to search
m (todo tag)
m (category Old Content)
 
(14 intermediate revisions by 6 users not shown)
Line 1: Line 1:
< [[Inside ConTeXt]] | [[Visuals]] >
+
Page is focused on the old [[Mark_II|Mark II]] ConTeXt version, though <tt>\show...</tt> 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 <cmd>show...</cmd> or <cmd>trace...</cmd>. While <cmd>showsomething</cmd> is a command that immediately inserts something, <cmd>tracesomethingtrue</cmd> or ...<tt>false</tt> is a switch that influences the behaviour of some other commands. You can check the setting with <cmd>iftrace...</cmd>. In the following we leave out the boolean value (true or false).
+
 
 +
 
 +
There's a whole lot of commands that help you analyzing and debugging your ConTeXt documents. Most of them start with {{cmd|show...}} or {{cmd|trace...}}. While {{cmd|showsomething}} is a command that immediately inserts something, {{cmd|tracesomethingtrue}} or ...<tt>false</tt> is a switch that influences the behaviour of some other commands. You can check the setting with {{cmd|iftrace...}}. In the following we leave out the boolean value (true or false).
  
 
==Unordered==
 
==Unordered==
  
<cmd>tracefiles</cmd> : ?
+
{{cmd|tracefiles}} : ?
 +
 
 +
{{cmd|tracepositions}} : ?
  
<cmd>tracepositions</cmd> : ?
+
{{cmd|traceposstring}} : ?
  
<cmd>traceposstring</cmd> : ?
+
{{cmd|traceboxplacement}} : ?
  
<cmd>traceboxplacement</cmd> : ?
+
{{cmd|traceotr}} : output routine?
  
<cmd>traceotr</cmd> : output routine?
+
{{cmd|showboxes}} : show boxes
  
  
 
==[[Layout]]==
 
==[[Layout]]==
  
<cmd>showlayout</cmd> : add four pages that show margins, layout sizes etc.
+
{{cmd|showlayout}} : add four pages that show margins, layout sizes etc.
 +
 
 +
{{cmd|showsetups}} : typeset a list of all defined sizes (variables) and their values
 +
 
 +
{{cmd|showmakeup}} : show some otherwise invisible markup
 +
 
 +
{{cmd|showframe}} : show frames of text area, layers, boxes etc.
 +
 
 +
{{cmd|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===
 +
 
 +
<texcode>
 +
\usemodule [setups]
  
<cmd>showsetups</cmd> : type a list of all defined sizes (variables) and their values
+
\starttext
  
<cmd>showmakeup</cmd> : ?
+
% \setuphead [..,..=..,..]
 +
\showrootvalues [head]
  
<cmd>showframe</cmd> : ?
+
% \setuphead [chapter] [..,..=..,..]
 +
\showinstancevalues [head] [chapter]
 +
 
 +
\stoptext
 +
</texcode>
  
 
===Grid, Layers and Column Sets===
 
===Grid, Layers and Column Sets===
  
<cmd>tracelayers</cmd> : show boxes of layers
+
{{cmd|tracelayers}} : show boxes of layers
  
<cmd>tracecolumnset</cmd> : ?
+
{{cmd|tracecolumnset}} : ?
  
<cmd>tracetextareas</cmd> : ?
+
{{cmd|tracetextareas}} : ?
  
<cmd>showgrid</cmd> : make line grid visible
+
{{cmd|showgrid}} : make line grid visible
  
<cmd>tracegridsnapping</cmd> : ?
+
{{cmd|tracegridsnapping}} : ?
  
 
===[[Tables Overview|Tables]]===
 
===[[Tables Overview|Tables]]===
  
<cmd>tracetables</cmd> : ?
+
{{cmd|tracetables}} : ?
  
<cmd>traceTABLE</cmd> : ?
+
{{cmd|traceTABLE}} : ?
  
<cmd>tracetabulate</cmd> : ?
+
{{cmd|tracetabulate}} : ?
  
 
==[[Math]]==
 
==[[Math]]==
  
<cmd>tracemathtrue</cmd> : show the layout boxes for left, middle, or right-aligned formulas.
+
{{cmd|tracemathtrue}} : show the layout boxes for left, middle, or right-aligned formulas.
  
<cmd>tracemathcommand</cmd> : ?
+
{{cmd|tracemathcommand}} : ?
  
<cmd>tracemathcollection</cmd> : ?
+
{{cmd|tracemathcollection}} : ?
  
<cmd>tracemathsymbol</cmd>''{name of math symbol}'' : show the command (name of symbol) and the symbol itself
+
{{cmd|tracemathsymbol}}''{name of math symbol}'' : show the command (name of symbol) and the symbol itself
  
 
<texcode>
 
<texcode>
Line 67: Line 89:
 
</context>
 
</context>
  
<cmd>tracemathcharacter</cmd> : ?
+
{{cmd|tracemathcharacter}} : ?
  
 
==[[Bookmarks]] and [[References]]==
 
==[[Bookmarks]] and [[References]]==
  
<cmd>tracebookmarks</cmd> : ?
+
{{cmd|tracebookmarks}} : ?
  
<cmd>tracelinenotes</cmd> : ?
+
{{cmd|tracelinenotes}} : ?
  
<cmd>tracereferences</cmd> : ?
+
{{cmd|tracereferences}} : ?
  
<cmd>tracelabels</cmd> : ?
+
{{cmd|tracelabels}} : ?
  
  
==[[Fonts]] and Type==
+
== Fonts and Type==
  
<cmd>showbodyfont</cmd> : actual bodyfont family with all variants
+
{{cmd|showbodyfont}} : actual bodyfont family with all variants
  
 
<context>
 
<context>
Line 89: Line 111:
 
</context>
 
</context>
  
<cmd>showbodyfontenvironment</cmd> : 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>
 
\setuplayout[scale=.7]
 
\setuplayout[scale=.7]
Line 95: Line 118:
 
</context>
 
</context>
  
<cmd>showsymbolset</cmd>[''symbolset name''] :  shows all the symbols within a given symbol set
+
{{cmd|showsymbolset}}[''symbolset name''] :  shows all the symbols within a given symbol set
  
 
<texcode>
 
<texcode>
Line 105: Line 128:
 
</context>
 
</context>
  
<cmd>showcharacters</cmd> : list of available chars of actual bodyfont encoding (approx. 4 pages)
+
{{cmd|showcharacters}} : list of available chars of actual bodyfont encoding (approx. 4 pages, MkII only)
  
 
<context>
 
<context>
Line 113: Line 136:
 
</context>
 
</context>
  
<cmd>showmathcharacters</cmd> : list of all the available math (non-alphabetical) characters available in math, now including all the AMS characters
+
{{cmd|showmathcharacters}} : list of all the available math (non-alphabetical) characters available in math, now including all the AMS characters. MkII only
  
 
<context>
 
<context>
Line 121: Line 144:
 
</context>
 
</context>
  
<cmd>showaccents</cmd> : shows A-Z and a-z with all available accents
+
{{cmd|showaccents}} : shows A-Z and a-z with all available accents, MkII only
  
 
<context>
 
<context>
Line 129: Line 152:
 
</context>
 
</context>
  
<cmd>showstruts</cmd> : display struts (invisible placeholders for proper minimum line heights)
+
{{cmd|showstruts}} : display struts (invisible placeholders for proper minimum line heights)
  
 
''(Make a better, slightly more complex example.)''
 
''(Make a better, slightly more complex example.)''
Line 151: Line 174:
  
  
<cmd>showfontstrip</cmd> : the current typeface combination, with roman, sans, math, and teletype families visualised, with x-heights
+
{{cmd|showfontstrip}} : the current typeface combination, with roman, sans, math, and teletype families visualised, with x-heights
  
 
<context>
 
<context>
Line 158: Line 181:
 
</context>
 
</context>
  
<cmd>tracefonthandling</cmd> :  
+
{{cmd|tracefonthandling}} :  
  
<cmd>tracechinese</cmd> : ?
+
{{cmd|tracechinese}} : ?
  
<cmd>tracedfontname</cmd>''{Font Name}'' : Chain of synonyms for the given font name
+
{{cmd|tracedfontname}}''{Font Name}'' : Chain of synonyms for the given font name
  
 
<texcode>
 
<texcode>
Line 173: Line 196:
 
</context>
 
</context>
  
<cmd>tracedfontencoding</cmd> : ?
+
{{cmd|tracedfontencoding}} : ?
  
==[[Colors]] and Graphics==
+
== Colors and Graphics ==
  
 
===Colors===
 
===Colors===
  
<cmd>showcolor</cmd> : see [[Colors]]
+
{{cmd|showcolor}} : see [[Color]]
  
<cmd>showcolorgroup</cmd> : ?
+
{{cmd|showcolorgroup}} : ?
  
<cmd>showpalet</cmd> : ?
+
{{cmd|showpalet}} : ?
  
<cmd>tracedgreymode</cmd> : ?
+
{{cmd|tracedgreymode}} : ?
  
<cmd>tracedgreycolormode</cmd> : ?
+
{{cmd|tracedgreycolormode}} : ?
  
<cmd>tracedrgbcolormode</cmd> : ?
+
{{cmd|tracedrgbcolormode}} : ?
  
<cmd>tracedcmykcolormode</cmd> : ?
+
{{cmd|tracedcmykcolormode}} : ?
  
<cmd>tracedspotcolormode</cmd> : ?
+
{{cmd|tracedspotcolormode}} : ?
  
 
===Figures===
 
===Figures===
  
<cmd>showexternalfigures</cmd> : ?
+
{{cmd|showexternalfigures}} : ?
  
<cmd>traceexternalfigures</cmd> : ?
+
{{cmd|traceexternalfigures}} : ?
  
<cmd>tracesidefloats</cmd> : ?
+
{{cmd|tracesidefloats}} : ?
  
  
 
===Interaction===
 
===Interaction===
  
<cmd>showfields</cmd> : ?
+
{{cmd|showfields}} : ?
  
<cmd>tracefields</cmd> : ?
+
{{cmd|tracefields}} : ?
  
<cmd>traceJScode</cmd> : trace JavaScript code
+
{{cmd|traceJScode}} : trace JavaScript code
  
  
 
{{todo|A lot of commands and switches are still unexplained.}}
 
{{todo|A lot of commands and switches are still unexplained.}}
 +
 +
[[Category:Basics]]
 +
[[Category:Tools]]
 +
[[Category:Layout]]
 +
[[Category:Old Content]]

Latest revision as of 11:05, 9 February 2021

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).

Unordered

\tracefiles : ?

\tracepositions : ?

\traceposstring : ?

\traceboxplacement : ?

\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

\tracegridsnapping : ?

Tables

\tracetables : ?

\traceTABLE : ?

\tracetabulate : ?

Math

\tracemathtrue : show the layout boxes for left, middle, or right-aligned formulas.

\tracemathcommand : ?

\tracemathcollection : ?

\tracemathsymbol{name of math symbol} : show the command (name of symbol) and the symbol itself

\tracemathcollectiontrue
\tracemathsymbol{Re}
\tracemathsymbol{Im}

\tracemathcharacter : ?

Bookmarks and References

\tracebookmarks : ?

\tracelinenotes : ?

\tracereferences : ?

\tracelabels : ?


Fonts and Type

\showbodyfont : actual bodyfont family with all variants

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

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

\showsymbolset[navigation 1]

\showcharacters : list of available chars of actual bodyfont encoding (approx. 4 pages, MkII only)

\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

\tracefonthandling :

\tracechinese : ?

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

\tracedfontname{Bold}

\tracedfontencoding : ?

Colors and Graphics

Colors

\showcolor : see Color

\showcolorgroup : ?

\showpalet : ?

\tracedgreymode : ?

\tracedgreycolormode : ?

\tracedrgbcolormode : ?

\tracedcmykcolormode : ?

\tracedspotcolormode : ?

Figures

\showexternalfigures : ?

\traceexternalfigures : ?

\tracesidefloats : ?


Interaction

\showfields : ?

\tracefields : ?

\traceJScode : trace JavaScript code



TODO: A lot of commands and switches are still unexplained. (See: To-Do List)