Changes

Jump to navigation Jump to search
927 bytes added ,  15:39, 8 June 2009
Add example of limiting vertical space
Source: [http://archive.contextgarden.net/thread/20050907.093522.baf795f5.en.html]
 
= Making a tight vertical fit =
By default, typing environments defined with <tt>\definetyping</tt> include some blank space before the first line and after the last line of the verbatim text. This is because the <tt>before</tt> and <tt>after</tt> commands are set to <tt>\blank</tt> by default. For example:
 
<context source="yes">
\framed[offset=0mm,strut=no,align=right]{
\starttyping
Foo
\stoptyping
}
</context>
 
Here, we've added a <tt>\framed</tt> so you can see the extra spacing, but with <tt>offset=0mm</tt> and <tt>strut=no</tt> to prevent framed from introducing spacing, and <tt>align=right</tt> to prevent framed from eating all newlines (not sure why that works like this).
 
To prevent this extra vertical space, we must unset the <tt>before</tt> and <tt>after</tt> options:
<context source="yes">
\setuptyping[before=,after=]
\framed[offset=0mm,strut=no,align=right]{
\starttyping
Foo
\stoptyping
}
</context>
= Embedded formatting commands =
Anonymous user

Navigation menu