Centering a figure vertically on a page
Hello, the subject line basically covers my problem: I have a large (tikz) figure, and I want to have it by itself on a page, centered both horizontally and vertically. How can I achieve this? I already know that \setuppagenumber[state=stop] is a good idea, and \midaligned{...} gives me horizontal centering; what about vertical? The problem is that the figure is larger than the text area (and this doesn't bother me, it's a game board and it may extend almost to the paper border), so \vfill doesn't work (and \vss doesn't, either). TIA -- Marcin Borkowski http://mbork.pl
Am 03.07.2012 um 13:21 schrieb Marcin Borkowski:
Hello,
the subject line basically covers my problem: I have a large (tikz) figure, and I want to have it by itself on a page, centered both horizontally and vertically. How can I achieve this? I already know that \setuppagenumber[state=stop] is a good idea, and \midaligned{...} gives me horizontal centering; what about vertical? The problem is that the figure is larger than the text area (and this doesn't bother me, it's a game board and it may extend almost to the paper border), so \vfill doesn't work (and \vss doesn't, either).
\starttext %\noheaderandfooterlines \centerbox{\externalfigure[cow]} \stoptext Wolfgang
Dnia 2012-07-03, o godz. 13:30:22
Wolfgang Schuster
Am 03.07.2012 um 13:21 schrieb Marcin Borkowski:
Hello,
the subject line basically covers my problem: I have a large (tikz) figure, and I want to have it by itself on a page, centered both horizontally and vertically. How can I achieve this? I already know that \setuppagenumber[state=stop] is a good idea, and \midaligned{...} gives me horizontal centering; what about vertical? The problem is that the figure is larger than the text area (and this doesn't bother me, it's a game board and it may extend almost to the paper border), so \vfill doesn't work (and \vss doesn't, either).
\starttext %\noheaderandfooterlines \centerbox{\externalfigure[cow]} \stoptext
Wolfgang
Thanks a lot, it works! -- Marcin Borkowski http://mbork.pl
On 3-7-2012 15:10, Alan BRASLAU wrote:
On Tue, 3 Jul 2012 13:30:22 +0200 Wolfgang Schuster
wrote: \centerbox{\externalfigure[cow]}
Wow! \centerbox{}
It's a rather (old) low level boxing macro ... \start \showboxes \centerbox width 10cm height 3cm {Alan is surprised} \stop .. simulating the regular tex syntax for box dimensions Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Tue, 3 Jul 2012 15:48:43 +0200
Hans Hagen
It's a rather (old) low level boxing macro ...
\start \showboxes \centerbox width 10cm height 3cm {Alan is surprised} \stop
My TeX culture remains, alas, always limited (even if I have the TeXbook on my office bookshelf, indeed \centerbox does not appear in plain TeX). Nothing in the ConTeXt manual, either. Of course, a leisurely browsing of the source code would reveal many such treasures! On the garden: Context 2005.05.25 ... \centerbox now accepts \par in it;s argument ... Alan
On Tue, 3 Jul 2012, Alan BRASLAU wrote:
plain TeX). Nothing in the ConTeXt manual, either. Of course, a leisurely browsing of the source code would reveal many such treasures!
supp-box.mkiv is a good place to start a leisurely browsing of the source code. It contains many useful box manipuation macros. Aditya
On Tue, Jul 3, 2012 at 5:27 PM, Alan BRASLAU
On Tue, 3 Jul 2012 15:48:43 +0200 Hans Hagen
wrote: It's a rather (old) low level boxing macro ...
\start \showboxes \centerbox width 10cm height 3cm {Alan is surprised} \stop
My TeX culture remains, alas, always limited (even if I have the TeXbook on my office bookshelf, indeed \centerbox does not appear in plain TeX). Nothing in the ConTeXt manual, either. Of course, a leisurely browsing of the source code would reveal many such treasures! There is also \vcenter
\starttext xxxxxxxxxxg\ruledvbox{\hsize=5cm\vcenter to 3cm{Alan is surprised}}gxxxxxxxxx \type{\vcenter}\par xxxxxxxxxxg\ruledvbox{\centerbox width5cm height3cm{Alan is surprised}}gxxxxxxxxx \type{\centerbox}\par xxxxxxxxxxg\ruledvbox{\vcenter{\centerbox width5cm height3cm{Alan is surprised}}}gxxxxxxxxx\type{\centerbox+\vcenter}\par \stoptext (\vcenter is a TeX primitive) -- luigi
Am 03.07.2012 um 18:04 schrieb luigi scarso:
On Tue, Jul 3, 2012 at 5:27 PM, Alan BRASLAU
wrote: On Tue, 3 Jul 2012 15:48:43 +0200 Hans Hagen
wrote: It's a rather (old) low level boxing macro ...
\start \showboxes \centerbox width 10cm height 3cm {Alan is surprised} \stop
My TeX culture remains, alas, always limited (even if I have the TeXbook on my office bookshelf, indeed \centerbox does not appear in plain TeX). Nothing in the ConTeXt manual, either. Of course, a leisurely browsing of the source code would reveal many such treasures! There is also \vcenter
\starttext xxxxxxxxxxg\ruledvbox{\hsize=5cm\vcenter to 3cm{Alan is surprised}}gxxxxxxxxx \type{\vcenter}\par xxxxxxxxxxg\ruledvbox{\centerbox width5cm height3cm{Alan is surprised}}gxxxxxxxxx \type{\centerbox}\par xxxxxxxxxxg\ruledvbox{\vcenter{\centerbox width5cm height3cm{Alan is surprised}}}gxxxxxxxxx\type{\centerbox+\vcenter}\par \stoptext
(\vcenter is a TeX primitive)
ConTeXt redefines \vcenter because the primitive can only be used in math mode. Wolfgang
On Tue, Jul 3, 2012 at 6:08 PM, Wolfgang Schuster < schuster.wolfgang@gmail.com> wrote:
Am 03.07.2012 um 18:04 schrieb luigi scarso:
On Tue, Jul 3, 2012 at 5:27 PM, Alan BRASLAU
wrote: On Tue, 3 Jul 2012 15:48:43 +0200 Hans Hagen
wrote: It's a rather (old) low level boxing macro ...
\start \showboxes \centerbox width 10cm height 3cm {Alan is surprised} \stop
My TeX culture remains, alas, always limited (even if I have the TeXbook on my office bookshelf, indeed \centerbox does not appear in plain TeX). Nothing in the ConTeXt manual, either. Of course, a leisurely browsing of the source code would reveal many such treasures! There is also \vcenter
\starttext xxxxxxxxxxg\ruledvbox{\hsize=5cm\vcenter to 3cm{Alan is surprised}}gxxxxxxxxx \type{\vcenter}\par xxxxxxxxxxg\ruledvbox{\centerbox width5cm height3cm{Alan is surprised}}gxxxxxxxxx \type{\centerbox}\par xxxxxxxxxxg\ruledvbox{\vcenter{\centerbox width5cm height3cm{Alan is surprised}}}gxxxxxxxxx\type{\centerbox+\vcenter}\par \stoptext
(\vcenter is a TeX primitive)
ConTeXt redefines \vcenter because the primitive can only be used in math mode.
yes I know ... and original TeX primitive is still available as \normalvcenter (kind of easter egg for Alan..) -- luigi
Am 03.07.2012 um 18:19 schrieb luigi scarso:
(\vcenter is a TeX primitive)
ConTeXt redefines \vcenter because the primitive can only be used in math mode. yes I know ... and original TeX primitive is still available as \normalvcenter (kind of easter egg for Alan..)
All primitives are available as \normal… and sometimes it’s the only way to use them because the names are used for other commands, e.g. \unexpanded. Wolfgang
participants (6)
-
Aditya Mahajan
-
Alan BRASLAU
-
Hans Hagen
-
luigi scarso
-
Marcin Borkowski
-
Wolfgang Schuster