Open main menu

Changes

m
Text replacement - "</cmd>" to "}}"
==LaTeX== In LaTeX===, it's fairly easy to produce vertically centered boxes, using optional arguments to either the <code>\parbox</code> command or the <code>tabular</code> environment, as in this example. 
<texcode>
\documentclass{article}
</texcode>
===In ConTeXt: ???=== Please note that this is only my suggestion. I believe there must be an easier way too!
For In ConTeXt, the first box:{{cmd|framed}} command can be used to produce similar results. To produce exactly the same output as the LaTeX commands requires the specification of rather more options, but this is mainly because the defaults are different.
<texcode>
a box with a table:\setupTABLEframed [framelocation=off]middle, % vertically centered\setupTABLE[c][1 align=flushleft,2][% align=lohi]\bTABLE\bTR\bTD a box with no (default) is a table:normal hbox\eTD\bTD[frame % align=on]flushleft/middle/flushright/normal is used for multiple lines {\bTABLE[frame offset=off5pt] % to make the frame wider (as in LaTeX) \bTR\bTD {1 \eTD\eTR \bTR\bTD 2 \eTD\eTR \bTR\bTD 3 \eTD\eTR \eTABLE}\eTD\eTR\eTABLE</texcode>
or <texcode>a box with a tablemidaligned parbox: \vcenter{\framed{\bTABLE [location=middle, % vertically centered align=normal, % justified alignment frame=off, % no frame width=1em] % make box 1em wide; note that line breaking is not the same as in LaTeX (?) \bTR\bTD {1 \eTD\eTR \bTR\bTD 2 \eTD\eTR \bTR\bTD 3 \eTD\eTR\eTABLE}}
</texcode>
It works on older ConTeXt distributions, here it seems to be brokenThis produces the following pair of results:
<context>
a box with a table: \vcenter{\framed{\bTABLE [framelocation=middle, % vertically centered align=flushleft, % align=no (default) is a normal hbox % align=flushleft/middle/flushright/normal is used for multiple lines offset=off5pt] % to make the frame wider (as in LaTeX) \bTR\bTD {1 \eTD\eTR \bTR\bTD 2 \eTD\eTR3} a midaligned parbox: \bTR\bTD framed [location=middle, % vertically centered align=normal, % justified alignment frame=off, % no frame width=1em] % make box 1em wide; note that line breaking is not the same as in LaTeX (?) {1 2 3 \eTD\eTR\eTABLE}}
</context>
The second box This is simply a replacement for the vertical centering; to replace a <bcode>shouldtabular</bcode> be possible to typeset asenvironment that's a proper table with more than one column, use <texcodecode>\setupTABLE[frame=on]bTABLE ... \setupTABLE[c][eTABLE</code> or something similar instead of <code>1,2][align=lohi]\bTABLE\bTR\bTD a midaligned parbox:2\eTD\bTD[offset=0pt,width=1em] 1 2 3\eTD\eTR\eTABLE</texcodecode>. See the [[Tables Overview]] for a discussion of the different methods for doing tables in ConTeXt.
but it doesn't work[[Category<context>\setupTABLE[frame=onBasics]]\setupTABLE[c][1,2Category:From LaTeX][align=lohi]\bTABLE\bTR\bTD a midaligned parbox:\eTD\bTD[offset=0pt,width=1em] 1 2 3\eTD\eTR\eTABLE</context>