Changes

Jump to navigation Jump to search
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 <smallcode>tabular</code> environment, as in this example. <pretexcode>
\documentclass{article}
\begin{document}
a midaligned parbox: \parbox[c]{1em}{1 2 3}
\end{document}
</pretexcode== ConTeXt == In ConTeXt, the {{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:\framed [location=middle, % vertically centered align=flushleft, % align=no (default) is a normal hbox % align=flushleft/middle/flushright/normal is used for multiple lines offset=5pt] % to make the frame wider (as in LaTeX) {1\\2\\3} a midaligned parbox:\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}</texcode> This produces the following pair of results: <context>a box with a table:\framed [location=middle, % vertically centered align=flushleft, % align=no (default) is a normal hbox % align=flushleft/middle/flushright/normal is used for multiple lines offset=5pt] % to make the frame wider (as in LaTeX) {1\\2\\3} a midaligned parbox:\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}</context> This is simply a replacement for the vertical centering; to replace a <code>tabular</code> environment that's a proper table with more than one column, use <code>\bTABLE ... \eTABLE</code> or something similar instead of <code>1\\2\\3</smallcode>. See the [[Tables Overview]] for a discussion of the different methods for doing tables in ConTeXt.
ConTeXt[[Category: ???Basics]][[Category:From LaTeX]]

Navigation menu