Changes

Jump to navigation Jump to search
377 bytes added ,  22:40, 27 December 2021
m
→‎Defining your own set of colors: comment on mkii only setting
< [[Visuals]] | [[Verbatim with line breaks]] >
 
=Displayed text=
{{cmd|starttyping}},
=Inline text=
To typeset code inside the paragraph, you have the command <code>\type</code>. It can be configured with <code>\setuptype[type][...]</code>.
To have colored code, you need to use <code>\definetype[NAME][option=TEX]</code> and use it with the name you chose. Other values are: <code>mp lua xml parsed-xml nested tex context</code>.
And this is the way to have colored code: \inlineTEX{the \ConTeXt\ command},
</context>
 
 
You can also refer to a TeX command with: {{cmd|tex}}<tt>{a tex command}</tt>
<context source="yes">
\tex{a tex command}
</context>
[[Image:Verbatim-mkiv.png‎]]
 
= Verbatim with line breaks=
 
[[Verbatim with line breaks|Dedicated page]]
 
[[Line breaks marker]]
= Pretty printing =
% XML code will be typeset with the palette you just defined
\definepalet[XMLcolorpretty] [MYcolors] % the name is magic !- mkii only
\starttext
This results in:
:<context>
\setupbodyfont[8pt]
\definecolor[MYcolorone] [r=.8,g=.5,b=.5]
prettyfour=MYcolorfour]
% \definepalet[XMLcolorpretty] [MYcolors] % the name is magic !
\setupcolors[state=start]
\stoptext
</context>
 
== Syntax highlighting source code or configuration files ==
 
see [[Verbatim_with_LuaTeX]] with Python, Apache httpd.conf and zc.buildout config files examples.
= Colored background =
<texcode>
\setuplinenumbering[location=intexttext]
\startcode
This is the first line
after={\stopframedcode}]
\setuplinenumbering[location=intexttext]
\startcode
This is the first line
(-a- --> [[User:Andrea]])
 
 
[[Category:Basics]]
174

edits

Navigation menu