Difference between revisions of "Command/type"
< Command
Jump to navigation
Jump to search
(Created page with "Documentation for \type") |
(Add an example showing the use of 'compact=last'.) |
||
(One intermediate revision by one other user not shown) | |||
Line 25: | Line 25: | ||
In a caption (and probably other places), {{cmd|type}} can cause errors if it | In a caption (and probably other places), {{cmd|type}} can cause errors if it | ||
− | contains active characters (<tt>|</tt> for example). You can use | + | contains active characters (<tt>|</tt> for example). You can use |
<texcode>\type{...}\type{|}\type{...}</texcode> as a workaround, since the first character is not expanded. | <texcode>\type{...}\type{|}\type{...}</texcode> as a workaround, since the first character is not expanded. | ||
Line 36: | Line 36: | ||
With options \type[option=TEX]{\ConTeXt\ colouring} | With options \type[option=TEX]{\ConTeXt\ colouring} | ||
+ | </context></cd:example><cd:example title="Preserving some spaces needs more work"><context source="yes"> | ||
+ | In some cases spaces disappear unless you do a bit more work. For example, notice the missing space here: \type{\someCommand [option]}. | ||
+ | |||
+ | The following usage preserves that space: \type[compact=last]{\someCommand [option]}. | ||
</context></cd:example></cd:examples> | </context></cd:example></cd:examples> | ||
<cd:notes></cd:notes> | <cd:notes></cd:notes> | ||
Line 43: | Line 47: | ||
<cd:source file="buff-ver.mkiv" originator="system"></cd:source> | <cd:source file="buff-ver.mkiv" originator="system"></cd:source> | ||
<cd:wikipage originator="system" page="Category:Verbatim"></cd:wikipage> | <cd:wikipage originator="system" page="Category:Verbatim"></cd:wikipage> | ||
− | <cd:commandref name="starttyping"></cd:commandref></cd:seealso> | + | <cd:commandref name="starttyping"></cd:commandref> |
+ | <cd:wikipage page="Verbatim text"></cd:wikipage></cd:seealso> | ||
</cd:commandgroup> | </cd:commandgroup> |
Latest revision as of 15:23, 3 February 2024
Contents
\type
Summary
The command \type typesets verbatim TeX code
Settings
Settings angles
Description
Verbatim text, typeset in typewriter font.
In a caption (and probably other places), \type can cause errors if it contains active characters (| for example). You can use
\type{...}\type{|}\type{...}as a workaround, since the first character is not expanded.
Examples
Example 1
Plain example: \type{\bf You can type any %ld thing you |ike, even command$.} Alternate delimiters: \type-You can choose your own delimiters- With options \type[option=TEX]{\ConTeXt\ colouring}
Preserving some spaces needs more work
In some cases spaces disappear unless you do a bit more work. For example, notice the missing space here: \type{\someCommand [option]}. The following usage preserves that space: \type[compact=last]{\someCommand [option]}.