Difference between revisions of "Visual Debugging"

From Wiki
Jump to navigation Jump to search
(a lot more traces)
(→‎[[Fonts]] and Type: some examples added (but perhaps the page is now too long))
Line 73: Line 73:
  
 
<cmd>showbodyfont</cmd> : actual bodyfont family with all variants
 
<cmd>showbodyfont</cmd> : actual bodyfont family with all variants
 +
 +
<context>
 +
\setuplayout[scale=.7]
 +
\showbodyfont
 +
</context>
  
 
<cmd>showbodyfontenvironment</cmd> : draws a table that shows which point sizes match the relative sizes
 
<cmd>showbodyfontenvironment</cmd> : draws a table that shows which point sizes match the relative sizes
 +
<context>
 +
\setuplayout[scale=.7]
 +
\showbodyfontenvironment
 +
</context>
  
 
<cmd>showsymbolset</cmd>[''symbolset name''] :  shows all the symbols within a given symbol set
 
<cmd>showsymbolset</cmd>[''symbolset name''] :  shows all the symbols within a given symbol set
  
<cmd>showcharacters</cmd> : list of available chars of actual bodyfont encoding
+
<texcode>
 +
\showsymbolset[navigation 1]
 +
</texcode>
 +
<context>
 +
\setuplayout[scale=.7]
 +
\showsymbolset[navigation 1]
 +
</context>
 +
 
 +
<cmd>showcharacters</cmd> : list of available chars of actual bodyfont encoding (approx. 4 pages)
 +
 
 +
<context>
 +
\setuplayout[height=12cm,scale=.7]
 +
\setupcolors[state=start]
 +
\showcharacters
 +
</context>
  
 
<cmd>showmathcharacters</cmd> : list of all the available math (non-alphabetical) characters available in math, now including all the AMS characters
 
<cmd>showmathcharacters</cmd> : list of all the available math (non-alphabetical) characters available in math, now including all the AMS characters
 +
 +
<context>
 +
\setuplayout[height=12cm,scale=.7]
 +
\setupcolors[state=start]
 +
\showmathcharacters
 +
</context>
  
 
<cmd>showaccents</cmd> : shows A-Z and a-z with all available accents
 
<cmd>showaccents</cmd> : shows A-Z and a-z with all available accents
  
<cmd>showstruts</cmd> : make invisible characters visible
+
<context>
 +
\setuplayout[height=18cm,scale=.7]
 +
\setupcolors[state=start]
 +
\showaccents
 +
</context>
 +
 
 +
<cmd>showstruts</cmd> : display struts (invisible placeholders for proper minimum line heights)
 +
 
 +
''(Make a better, slightly more complex example.)''
 +
 
 +
<texcode>
 +
\setupframed[framecolor=gray]
 +
\showstruts
 +
This will display \strut struts.\crlf
 +
Frame with struts: \framed{xxx}\crlf
 +
And frame without them: \framed[strut=no]{xxx}
 +
</texcode>
 +
<context>
 +
\setuplayout[scale=.7]
 +
\setupcolors[state=start]
 +
\setupframed[framecolor=gray]
 +
\showstruts
 +
This will display \strut struts.\crlf
 +
Frame with struts: \framed{xxx}\crlf
 +
And frame without them: \framed[strut=no]{xxx}
 +
</context>
 +
 
  
 
<cmd>showfontstrip</cmd> : the current typeface combination, with roman, sans, math, and teletype families visualised, with x-heights
 
<cmd>showfontstrip</cmd> : the current typeface combination, with roman, sans, math, and teletype families visualised, with x-heights
 +
 +
<context>
 +
\setuplayout[scale=.7]
 +
\showfontstrip
 +
</context>
  
 
<cmd>tracefonthandling</cmd> :  
 
<cmd>tracefonthandling</cmd> :  
Line 92: Line 152:
 
<cmd>tracechinese</cmd> : ?
 
<cmd>tracechinese</cmd> : ?
  
<cmd>tracedfontname</cmd> : ?
+
<cmd>tracedfontname</cmd>''{Font Name}'' : Chain of synonyms for the given font name
 +
 
 +
<texcode>
 +
\tracedfontname{Bold}
 +
</texcode>
 +
 
 +
<context>
 +
\setuplayout[scale=.7]
 +
\tracedfontname{Bold}
 +
</context>
  
 
<cmd>tracedfontencoding</cmd> : ?
 
<cmd>tracedfontencoding</cmd> : ?
 
  
 
==[[Colors]] and Graphics==
 
==[[Colors]] and Graphics==

Revision as of 22:26, 6 January 2006

< Inside ConTeXt | Visuals >

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?


Layout

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

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

\showmakeup : ?

\showframe : ?

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 : ?

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

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

\showaccents : shows A-Z and a-z with all available accents

\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 Colors

\showcolorgroup : ?

\showpalet : ?

\tracedgreymode : ?

\tracedgreycolormode : ?

\tracedrgbcolormode : ?

\tracedcmykcolormode : ?

\tracedspotcolormode : ?

Figures

\showexternalfigures : ?

\traceexternalfigures : ?

\tracesidefloats : ?


Interaction

\showfields : ?

\tracefields : ?

\traceJScode : trace JavaScript code