ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* spread box contents [trying again]
@ 2007-03-07 16:47 Idris Samawi Hamid
  2007-03-07 17:38 ` Sanjoy Mahajan
  2007-03-07 22:10 ` Willi Egger
  0 siblings, 2 replies; 6+ messages in thread
From: Idris Samawi Hamid @ 2007-03-07 16:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi gang,

Did not get any feedback, I'll try again:
==================================
Date: 2007-03-02 07:34 -700

Hmm, no reply yet, maybe the following is more interesting:

On Thu, 01 Mar 2007 12:30:42 -0700, Idris Samawi Hamid
<ishamid.at.remove.this.colostate.edu> wrote:

> How can I evenly spread the contents of a box or column-row? In PlainTeX
> there is
>
> \hbox{Here\hfill is\hfill an\hfill evenly\hfill spread\hfill line.}
>
> but there must be a better (read "ConTeXt-") way. I looked into thisyears
> ago and may have found the answer; but I've forgotten it...

===================================
\starttext

\defineparagraphs[TwoColumns][n=2,distance=2cm]
\setupparagraphs[TwoColumns][each][width=5cm,tolerance=stretch]
\setupframedtexts[frame=off]
      \startframedtext[middle]
      \startalignment[middle]
      \startTwoColumns
      \hbox spread \textwidth{Here is the first line 1a}
      \TwoColumns
      Here \hfill is \hfill the \hfill first \hfill line \hfill 1b
      \stopTwoColumns
      \startTwoColumns
      Here \hfill is \hfill the \hfill second \hfill line \hfill 2a
      \TwoColumns
      Here \hfill is \hfill the \hfill second \hfill line \hfill 2b
      \stopTwoColumns
      \stopalignment
      \stopframedtext

\stoptext
==============================

How can I get the first column right? Note that, according to the manual,
\textwidth gives the width of a column but in this case it apparently
gives a full \hsize.

RELATED QUESTION: How can I control the distance between rows? I do not
want any extra whitespace between rows (i.e., except the normal
interparagraph space).

Please advise!

Best
Idris

-- 
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

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

* Re: spread box contents [trying again]
  2007-03-07 16:47 spread box contents [trying again] Idris Samawi Hamid
@ 2007-03-07 17:38 ` Sanjoy Mahajan
  2007-03-07 19:43   ` Idris Samawi Hamid
  2007-03-07 22:10 ` Willi Egger
  1 sibling, 1 reply; 6+ messages in thread
From: Sanjoy Mahajan @ 2007-03-07 17:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users

I don't know if this method qualifies as a ConTeXt way, but it's what
I would do in plain tex, and it works in ConTeXt:

\starttext
\line{\spaceskip0pt plus 1fil\relax hello how are you}
\stoptext

-Sanjoy

`Not all those who wander are lost.' (J.R.R. Tolkien)

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

* Re: spread box contents [trying again]
  2007-03-07 17:38 ` Sanjoy Mahajan
@ 2007-03-07 19:43   ` Idris Samawi Hamid
  2007-03-07 20:41     ` Sanjoy Mahajan
  0 siblings, 1 reply; 6+ messages in thread
From: Idris Samawi Hamid @ 2007-03-07 19:43 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Thank you, Sanjoy, this will help me write a spread macro.

But I can't help thinking there's a context-way to do this, it seems like  
such a mundane operation...

Best
Idris

On Wed, 07 Mar 2007 10:38:34 -0700, Sanjoy Mahajan <sanjoy@mrao.cam.ac.uk>  
wrote:

> I don't know if this method qualifies as a ConTeXt way, but it's what
> I would do in plain tex, and it works in ConTeXt:
>
> \starttext
> \line{\spaceskip0pt plus 1fil\relax hello how are you}
> \stoptext

-- 
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

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

* Re: spread box contents [trying again]
  2007-03-07 19:43   ` Idris Samawi Hamid
@ 2007-03-07 20:41     ` Sanjoy Mahajan
  0 siblings, 0 replies; 6+ messages in thread
From: Sanjoy Mahajan @ 2007-03-07 20:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users

By the way, the \relax may not be needed.  It's like garlic for
vampires.  It may help and I haven't learnt enough about TeX's parser
to know whether I should put it in.  So I was being safe and lazy.

-Sanjoy

`Not all those who wander are lost.' (J.R.R. Tolkien)

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

* Re: spread box contents [trying again]
  2007-03-07 16:47 spread box contents [trying again] Idris Samawi Hamid
  2007-03-07 17:38 ` Sanjoy Mahajan
@ 2007-03-07 22:10 ` Willi Egger
  2007-03-08  2:14   ` Idris Samawi Hamid
  1 sibling, 1 reply; 6+ messages in thread
From: Willi Egger @ 2007-03-07 22:10 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Idris,

I played with an example derived from the columns manual:

\definecolumnset[example][n=2]
\definecolumnsetspan[wide][n=2,background=screen]
\setuptolerance[verytolerant,stretch]
\setupcolors[state=start]

\starttext
	\startcolumnset[example]
	\startcolumnsetspan[wide]
		\stretched{Here is the first line 1a}
	\stopcolumnsetspan
	\input tufte
		Here is the second line 2a
	\column
	\input tufte
		Here is the second line 2a
	\stopcolumnset
\stoptext

I do hope, that this is giving you a clue.

On Mar 7, 2007, at 5:47 PM, Idris Samawi Hamid wrote:

> Hi gang,
>
> Did not get any feedback, I'll try again:
> ==================================
> Date: 2007-03-02 07:34 -700
>
> Hmm, no reply yet, maybe the following is more interesting:
>
> On Thu, 01 Mar 2007 12:30:42 -0700, Idris Samawi Hamid
> <ishamid.at.remove.this.colostate.edu> wrote:
>
>> How can I evenly spread the contents of a box or column-row? In  
>> PlainTeX
>> there is
>>
>> \hbox{Here\hfill is\hfill an\hfill evenly\hfill spread\hfill line.}
>>
>> but there must be a better (read "ConTeXt-") way. I looked into  
>> thisyears
>> ago and may have found the answer; but I've forgotten it...
>
> ===================================
> \starttext
>
> \defineparagraphs[TwoColumns][n=2,distance=2cm]
> \setupparagraphs[TwoColumns][each][width=5cm,tolerance=stretch]
> \setupframedtexts[frame=off]
>       \startframedtext[middle]
>       \startalignment[middle]
>       \startTwoColumns
>       \hbox spread \textwidth{Here is the first line 1a}
>       \TwoColumns
>       Here \hfill is \hfill the \hfill first \hfill line \hfill 1b
>       \stopTwoColumns
>       \startTwoColumns
>       Here \hfill is \hfill the \hfill second \hfill line \hfill 2a
>       \TwoColumns
>       Here \hfill is \hfill the \hfill second \hfill line \hfill 2b
>       \stopTwoColumns
>       \stopalignment
>       \stopframedtext
>
> \stoptext
> ==============================
>
> How can I get the first column right? Note that, according to the  
> manual,
> \textwidth gives the width of a column but in this case it apparently
> gives a full \hsize.
>
> RELATED QUESTION: How can I control the distance between rows? I do  
> not
> want any extra whitespace between rows (i.e., except the normal
> interparagraph space).
>
> Please advise!
>
> Best
> Idris
>
> -- 
> Professor Idris Samawi Hamid
> Department of Philosophy
> Colorado State University
> Fort Collins, CO 80523
>
> --
> Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context

Willi Egger
w.egger@boede.nl

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

* Re: spread box contents [trying again]
  2007-03-07 22:10 ` Willi Egger
@ 2007-03-08  2:14   ` Idris Samawi Hamid
  0 siblings, 0 replies; 6+ messages in thread
From: Idris Samawi Hamid @ 2007-03-08  2:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Willi,

On Wed, 07 Mar 2007 15:10:18 -0700, Willi Egger <w.egger@boede.nl> wrote:

> 		\stretched{Here is the first line 1a}

\stretched!!! That was it! I looked in the Layout chapter of the manual,  
but it was in the Typography chapter.

What a gangster! THNX, Willi.

Best
Idris

-- 
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

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

end of thread, other threads:[~2007-03-08  2:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-07 16:47 spread box contents [trying again] Idris Samawi Hamid
2007-03-07 17:38 ` Sanjoy Mahajan
2007-03-07 19:43   ` Idris Samawi Hamid
2007-03-07 20:41     ` Sanjoy Mahajan
2007-03-07 22:10 ` Willi Egger
2007-03-08  2:14   ` Idris Samawi Hamid

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