ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* midalignment
@ 2002-06-16  3:15 Idris S Hamid
  2002-06-21 21:39 ` midalignment Patrick Gundlach
  0 siblings, 1 reply; 4+ messages in thread
From: Idris S Hamid @ 2002-06-16  3:15 UTC (permalink / raw)


Dear folks,

In the following example, \midalign is not placing its argument in the center 
of the line but rather offset to the right a bit. \cbox works but I guess I'm 
not supposed to use that command in running text:-).

Please advise.

Best wishes
Idris
===============================================
\setuppapersize[letter]
\setuplayout[width=middle,height=middle,location={middle,singlesided},marking=off]
\setuppagenumbering[location=footer,alternative=singlesided]

\starttext

\startnarrower[3*left,3*right]

 \midaligned{Abstract}
%\cbox{Abstract}
\tfx%
This is my abstract This is my abstract This is my abstract This is my 
abstract
This is my abstract This is my abstract This is my abstract This is my 
abstract
This is my abstract This is my abstract This is my abstract This is my 
abstract
This is my abstract This is my abstract This is my abstract This is my 
abstract
This is my abstract This is my abstract This is my abstract This is my 
abstract
This is my abstract This is my abstract This is my abstract This is my 
abstract
This is my abstract This is my abstract This is my abstract This is my 
abstract
This is my abstract This is my abstract This is my abstract This is my 
abstract
\stopnarrower

\stoptext

-- 
Dr. Idris S Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80526


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: midalignment
  2002-06-16  3:15 midalignment Idris S Hamid
@ 2002-06-21 21:39 ` Patrick Gundlach
  2002-06-23 21:58   ` midalignment Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Patrick Gundlach @ 2002-06-21 21:39 UTC (permalink / raw)
  Cc: Giuseppe Bilotta

Idris S Hamid <ishamid@attbi.com> writes:

> Dear folks,
> 
> In the following example, \midalign is not placing its argument in the center 
> of the line but rather offset to the right a bit.

this is because \midalign (and other alignment macros) do not look at
the \leftskip and the \rightskip the \startnarrow sets. If you run
(pdf)etex you can try this code before the \midalign:

\def\doalignline#1#2% \\ == newline 
  {\bgroup
   \def\\{\egroup\par\doalignline{#1}{#2}\bgroup}%
   \dowithnextbox
     {\noindent\hbox to \dimexpr(\hsize - \rightskip - \leftskip)
       {\strut#1\unhbox\nextbox#2}\egroup}
     \hbox}

Hans should fix this. Sorry I don't have the time to put this into
bugzilla.

This should also answer a question from Giuseppe B.:

==================================================
From: Giuseppe Bilotta <bourbaki@bigfoot.com>
Subject: Misalignment in narrower.
To: ntg-context@ntg.nl
Date: Mon, 15 Apr 2002 16:47:14 +0200
Reply-To: Giuseppe Bilotta <bourbaki@bigfoot.com>

Hello,

Please try the following:

\starttext

\input tufte

\startnarrower

\midaligned{some text which should be centered but is not}

\input tufte

\rightaligned{some text which should be right-aligned but is not}

\stopnarrower

\input tufte

\stoptext

Please note that the ...aligned text is shifted too much to the
right in both cases. Prefixing a \noindent is of no use.

==================================================

Patrick

-- 
I'll fade into the darkness


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: midalignment
  2002-06-21 21:39 ` midalignment Patrick Gundlach
@ 2002-06-23 21:58   ` Hans Hagen
  2002-06-24  8:14     ` midalignment Patrick Gundlach
  0 siblings, 1 reply; 4+ messages in thread
From: Hans Hagen @ 2002-06-23 21:58 UTC (permalink / raw)
  Cc: ntg-context, Giuseppe Bilotta

At 11:39 PM 6/21/2002 +0200, Patrick Gundlach wrote:
>Idris S Hamid <ishamid@attbi.com> writes:
>
> > Dear folks,
> >
> > In the following example, \midalign is not placing its argument in the 
> center
> > of the line but rather offset to the right a bit.
>
>this is because \midalign (and other alignment macros) do not look at
>the \leftskip and the \rightskip the \startnarrow sets. If you run
>(pdf)etex you can try this code before the \midalign:
>
>
>\def\doalignline#1#2% \\ == newline
>   {\bgroup
>    \def\\{\egroup\par\doalignline{#1}{#2}\bgroup}%
>    \dowithnextbox
>      {\noindent\hbox to \dimexpr(\hsize - \rightskip - \leftskip)
>        {\strut#1\unhbox\nextbox#2}\egroup}
>      \hbox}
>
>
>Hans should fix this. Sorry I don't have the time to put this into
>bugzilla.

better is:

\def\doalignline#1#2% \\ == newline
   {\bgroup
    \setlocalhsize % new
    \def\\{\egroup\par\doalignline{#1}{#2}\bgroup}%
    \dowithnextbox
      {\noindent\hbox to \localhsize{\strut#1\unhbox\nextbox#2}\egroup}
      \hbox}

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: midalignment
  2002-06-23 21:58   ` midalignment Hans Hagen
@ 2002-06-24  8:14     ` Patrick Gundlach
  0 siblings, 0 replies; 4+ messages in thread
From: Patrick Gundlach @ 2002-06-24  8:14 UTC (permalink / raw)


Hans Hagen <pragma@wxs.nl> writes:

>       {\noindent\hbox to \localhsize{\strut#1\unhbox\nextbox#2}\egroup}

Uh, localhsize. I was looking for that one.

Patrick

-- 
I'll fade into the darkness


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-06-24  8:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-16  3:15 midalignment Idris S Hamid
2002-06-21 21:39 ` midalignment Patrick Gundlach
2002-06-23 21:58   ` midalignment Hans Hagen
2002-06-24  8:14     ` midalignment Patrick Gundlach

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).