ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Steve Lumos <slumos@nevada.edu>
Subject: Re: Horizontal centering \startlines...\stoplines / poems
Date: Tue, 06 Mar 2001 20:08:55 -0800	[thread overview]
Message-ID: <058ae1810040731HAMS3@lvcablemodem.com> (raw)
In-Reply-To: Message from Hans Hagen <pragma@wxs.nl>  of "Sun, 04 Mar 2001 22:09:37 +0100." <3.0.6.32.20010304220937.01736af0@server-1>

>>This centers the title on the poem, but what I was hoping to do
>>was center the entire poem horizontally on the page.  This definitely
>>gives me a way to get started though.
>
>>> ... 
>>>\def\stopFancyPoem%
>>>  {\stoplines
>>>   \endofshapebox
>>>   \dimen1=0pt
>>>   \reshapebox
>>>     {\setbox\scratchbox=\hbox{\unhcopy\shapebox}%
>>>      \ifdim\wd\scratchbox>\dimen1 \global\dimen1=\wd\scratchbox \fi
>>>      \unhbox\shapebox}
>>>   \bgroup
>>>     \hsize\dimen1
>>>     \PoemTitle
>>>   \egroup
>
>Then add here: 
>
>\expanded{\setuplayout[width=\the\dimen1]}
>
>>>   \flushshapebox}
>>>
>>>\starttext
>
>(untested)
>
>
>Hans

Changing width like this moves the margin away from the edge of the
page.  I'm doubltess about to show how much of a beginner I am, but
this is what I did:

\def\startCenterBlock%
  {\beginofshapebox}

\def\stopCenterBlock%
  {\endofshapebox
   \dimen1=0pt
   \reshapebox
     {\setbox\scratchbox=\hbox{\unhcopy\shapebox}%
      \ifdim\wd\scratchbox>\dimen1 \global\dimen1=\wd\scratchbox \fi
     \unhbox\shapebox}
  \dimen2=\hsize
  \advance\dimen2 by-\dimen1
  \divide\dimen2 by 2
  \moveright\dimen2\box\newshapebox
  \flushshapebox}

I'm not sure whether it is considered bad to reference \newshapebox,
but I couldn't figure out another way.  This seems to work as long as
the poem is shorter than a page.  I'm still playing with settings, but
here's what I'm using now if it makes any difference:

\definepapersize[booklet][width=5.5in,height=8.5in]
\setuppapersize[booklet][letter,landscape]
\setuplayout
  [topspace=0.1in,
   backspace=0.25in,
   header=0.25in,
   footer=0pt,
   leftmargin=0pt,
   leftmargindistance=0pt,
   rightmargin=0.4in,
   rightmargindistance=0.1in,
   height=fit,
   width=fit]

\setuppagenumbering
  [alternative=doublesided,
   location={header,inmargin},
   command=\InverseBox]
\setuparranging[2UP,rotated]

Steve


  reply	other threads:[~2001-03-07  4:08 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-22  7:24 Horizontal centering \startlines...\stoplines Steve Lumos
2001-02-22  8:47 ` Horizontal centering \startlines...\stoplines / poems Hans Hagen
2001-03-03  9:22   ` Steve Lumos
2001-03-04 21:09     ` Hans Hagen
2001-03-07  4:08       ` Steve Lumos [this message]
2001-03-07  8:14         ` Hans Hagen
  -- strict thread matches above, loose matches on Subject: below --
2002-05-25 18:14 Broken catcodes Giuseppe Bilotta
2002-05-25 20:17 ` Hans Hagen
2002-05-25 21:46   ` Re[2]: " Giuseppe Bilotta
2002-05-26 17:39     ` Hans Hagen
     [not found]       ` <pragma@wxs.nl>
2001-03-12 16:50         ` fonts fonts and fonts Hans Hagen
2001-03-12 17:07           ` Frans Goddijn
2001-03-12 23:11           ` Christoph Dreyer
2001-03-13  9:33             ` S2P development
2001-03-13 10:12               ` Han The Thanh
2001-03-13 10:35               ` Hans Hagen
2001-03-14 21:32               ` H. Ramm
2001-03-13  7:12           ` Steve Lumos
2001-03-13  9:13             ` Hans Hagen
2001-03-14  0:29             ` Uwe Koloska
2001-03-13 14:35           ` Ed L Cashin
2001-03-14  0:18           ` Uwe Koloska
2001-03-15 21:55           ` H. Ramm
2002-05-27 15:27         ` Re[2]: Broken catcodes Daniel Flipo
2002-05-27 15:32           ` Hans Hagen
2002-05-26 20:38       ` Re[3]: " Giuseppe Bilotta
2001-05-30 11:40 Environments, Projects, Products, Components Giuseppe Bilotta
2001-05-30 15:14 ` Taco Hoekwater
2001-05-30 18:01   ` Re[2]: " Giuseppe Bilotta
2001-05-31  7:51     ` Taco Hoekwater
2001-05-31  9:34       ` Hans Hagen
2001-08-30 17:54         ` Steve Lumos
2001-08-31  7:19           ` Hans Hagen
2001-05-31  8:11     ` Re[2]: " Hans Hagen
2000-08-19 12:21 Setting up footnotes Joop Susan
2000-08-21 11:00 ` Hans Hagen
2000-08-21 18:19   ` Joop Susan
2000-08-22  6:59     ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=058ae1810040731HAMS3@lvcablemodem.com \
    --to=slumos@nevada.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).