Changes

Jump to navigation Jump to search
700 bytes removed ,  10:03, 3 September 2017
inline code
Unlike LaTeX's <code>verbatim</code> environment, ConTeXt's <code>typing</code> environments have quite a range of built-in options for formatting the verbatim text, see below.
=In-line Inline text=
To typeset code inside the paragraph, you have the command <code>\startTEX ... \stopTEXtype</code> only works when typesetting the whole paragraph. If you need to type only a command or two as in-line text, you It can use the following be configured with <code>\setuptype[type][User:Taco|Taco's...]] macro (hopefully this will land in the core once in the future):</code>.
To have colored code, you need to use <texcodecode>\def\typeTEX {\bgroup \def\processinlineverbatim##1% {\processingverbatimtrue \localcatcodestrue \def\endofverbatimcommand{\TEXendofcommand##1}% \bgroup \aftergroup\endofverbatimcommand \futurelet\next\doprocessinlineverbatim}% \initializetyping{definetype[NAME][option=TEX}% \startverbatimcolor \processinlineverbatim\egroup }]</code> and use it with the name you chose. Other values are: <code>mp lua xml parsed-xml nested tex context</texcodecode>.
Now you can sayAn example that shows both features:
<texcode>\typeTEX+\typeTEX{\typeTEX is a wonderful macro}+, isn't it?</texcode><contextsource="yes">\setupcolorsdefinetype[inlineTEX][stateoption=startTEX]\def\typeTEX {\bgroup \def\processinlineverbatim##1% {\processingverbatimtrue \localcatcodestrue \def\endofverbatimcommand{\TEXendofcommand##1}% \bgroup \aftergroup\endofverbatimcommand \futurelet\next\doprocessinlineverbatim}% \initializetyping{TEX}% \startverbatimcolor \processinlineverbatim\egroup }
This is the way to type code: \type{the \ConTeXt\typeTEX+command}. And this is the way to have colored code: \typeTEXinlineTEX{the \ConTeXt\typeTEX is a wonderful macrocommand}+, isn't it?
</context>
 
Source: [http://archive.contextgarden.net/thread/20050907.093522.baf795f5.en.html]
= Making a tight vertical fit =
139

edits

Navigation menu