Difference between revisions of "Command/definehighlight"

From Wiki
Jump to navigation Jump to search
(initial page)
 
Line 19: Line 19:
 
   </tr>
 
   </tr>
 
</table>
 
</table>
 
  
 
== Description ==  
 
== Description ==  
  
 +
(MkIV only)
 
''Highlights'' are a generic facility for defining and maintaining
 
''Highlights'' are a generic facility for defining and maintaining
 
different emphases.
 
different emphases.
<texcode>
+
 
 +
Highlights are respected by the XML export (see {{cmd|setupbackend}}),
 +
resulting in a tag {{code|highlight}}, with the respective names as
 +
argument to the attribute ''detail''.
 +
 
 +
== Example ==
 +
 
 +
<context source=yes mode=mkiv>
 
\definehighlight [important]      [style=bold] %% define a highlight
 
\definehighlight [important]      [style=bold] %% define a highlight
 
\definehighlight [reallyimportant] [important]  %% inherit setups
 
\definehighlight [reallyimportant] [important]  %% inherit setups
Line 33: Line 40:
 
This, however, \reallyimportant{everybody} needs to know!
 
This, however, \reallyimportant{everybody} needs to know!
 
\stoptext
 
\stoptext
</texcode>
+
</context>
Highlights are respected by the
+
 
[[Command/setupbackend|XML export]],
 
resulting in a tag <code>highlight</code>, with the respective names as
 
Argument to the attribute ''detail''.
 
 
<xmlcode>
 
<xmlcode>
<document language="en" file="example-highlight" date="Sat Jun 16 12:20:48 2012" context="2012.06.13 23:46" version="0.30" xmlns:m="http://www.w3.org/1998/Math/MathML">
+
<document language="en" file="example-highlight" date="Sat Jun 16 12:20:48 2012"  
 +
          context="2012.06.13 23:46" version="0.30" xmlns:m="http://www.w3.org/1998/Math/MathML">
 
This <highlight detail="important">you</highlight> need to know.
 
This <highlight detail="important">you</highlight> need to know.
 
   <break/>
 
   <break/>
Line 45: Line 50:
 
</document>
 
</document>
 
</xmlcode>
 
</xmlcode>
The functionality is implemented in
 
[http://repo.or.cz/w/context.git/blob/HEAD:/tex/context/base/core-sys.mkiv#l197 core-sys.mkiv].
 
  
 +
== See Also ==
 +
 +
* {{cmd|highlight}}
 +
* {{src|core-sys.mkiv#l197|core-sys.mkiv}}
  
 
== Help from ConTeXt-Mailinglist/Forum ==
 
== Help from ConTeXt-Mailinglist/Forum ==
Line 56: Line 63:
  
 
[[Category:Commands|definehighlight]]
 
[[Category:Commands|definehighlight]]
 +
[[Category:Commands|MkIV only]]

Revision as of 14:15, 2 July 2012

\definehighlight

Syntax

\definehighlight[...][...,...=...,...]
[...] name
[...,...=...,...] see \setuphighlight

Description

(MkIV only) Highlights are a generic facility for defining and maintaining different emphases.

Highlights are respected by the XML export (see \setupbackend), resulting in a tag highlight, with the respective names as argument to the attribute detail.

Example

\definehighlight [important]       [style=bold] %% define a highlight
\definehighlight [reallyimportant] [important]  %% inherit setups
\setuphighlight  [reallyimportant] [color=red]  %% modify the copy
\starttext
This \important{you} need to know.\par
This, however, \reallyimportant{everybody} needs to know!
\stoptext

<document language="en" file="example-highlight" date="Sat Jun 16 12:20:48 2012" 
          context="2012.06.13 23:46" version="0.30" xmlns:m="http://www.w3.org/1998/Math/MathML">
This <highlight detail="important">you</highlight> need to know.
  <break/>
This, however, <highlight detail="reallyimportant">everybody</highlight> needs to know!
</document>

See Also

Help from ConTeXt-Mailinglist/Forum

All issues with: