ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* How to place an item between table rows, centered on the page.
@ 2002-03-06  8:37 Daniel Pittman
  2002-03-06  9:11 ` Hans Hagen
  0 siblings, 1 reply; 12+ messages in thread
From: Daniel Pittman @ 2002-03-06  8:37 UTC (permalink / raw)


I would like to typeset one of two things[1] between each row of a table:
* a partial width line
* a graphic

The effect I would like to achieve is to make a visual distinction
between the rows of the table without a full width table line (as
achieved by \HL &c.).

I would like to have this item centered against the page it is in, not
aligned with the table columns. I currently have a table defined as:

\definetabulate[steps][|p(.3\hsize)|p|]

The closest I have been able to get to my goal has been to place an
additional row in the table following each row of content, containing
the following:

\NC \NC \blackrule[width=.2\hsize,height=1pt,depth=0pt] \NC \NR

That places a rule of around the right size at around the right place.
It has the fairly major drawback, however, of placing a full line height
of blank space between the rows containing content.

This is less than totally desirable; I would much rather ~ half a line
height of blank space with a rule centered in it, but less than that if
I end up using the graphic.

In the long term I suspect that the graphic divider will be used,
providing a more ornate separation of the steps. As such I would be
interested in knowing how to achieve both items, not just one.

Regards,
        Daniel

Footnotes: 
[1]  Actually, I would like to try both and see which one works best.

-- 
...Two and two are four. Sometimes, Winston. Sometimes they are five.
Sometimes they are three. Sometimes they are all of them at once. You must try
harder. It is not easy to become sane.
        -- George Orwell, _1984_


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

* Re: How to place an item between table rows, centered on the page.
  2002-03-06  8:37 How to place an item between table rows, centered on the page Daniel Pittman
@ 2002-03-06  9:11 ` Hans Hagen
  2002-03-06  9:57   ` Daniel Pittman
                     ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Hans Hagen @ 2002-03-06  9:11 UTC (permalink / raw)
  Cc: ntg-context

At 07:37 PM 3/6/2002 +1100, Daniel Pittman wrote:
>I would like to typeset one of two things[1] between each row of a table:
>* a partial width line
>* a graphic
>
>The effect I would like to achieve is to make a visual distinction
>between the rows of the table without a full width table line (as
>achieved by \HL &c.).

\starttext

\setupcolors[state=start]

\showstruts

\def\betweentabulate#1%
   {\TABLEnoalign{\nointerlineskip#1\nointerlineskip}}

\starttabulate[|l|l|]
\NC it makes \NC much sense        \NC \NR
\betweentabulate{\blackrule[color=red,width=10mm,height=1mm,depth=1mm]}
\NC to read  \NC those tufte books \NC \NR
\stoptabulate

\stoptext

I guess that GB loves this trick -)

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
-------------------------------------------------------------------------
                                   fall-back web server: 
www.pragma-ade.nl
-------------------------------------------------------------------------


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

* Re: How to place an item between table rows, centered on the page.
  2002-03-06  9:11 ` Hans Hagen
@ 2002-03-06  9:57   ` Daniel Pittman
  2002-03-06 10:26   ` Re[2]: " Giuseppe Bilotta
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 12+ messages in thread
From: Daniel Pittman @ 2002-03-06  9:57 UTC (permalink / raw)


On Wed, 06 Mar 2002, Hans Hagen wrote:
> At 07:37 PM 3/6/2002 +1100, Daniel Pittman wrote:
>>I would like to typeset one of two things[1] between each row of a table:
>>* a partial width line
>>* a graphic

[...]

> I guess that GB loves this trick -)

Thank you so much for this. :)

One of the greatest things about ConTeXt, and one of my main reasons for
using it, is that you are so wonderfully responsive and helpful when
people ask strange things of you. Thanks.

        Daniel

-- 
Among persons under 30, the inability to program is regarded as a form
of illiteracy.          -- James Martin 
(Comment predicting trends of the late 1990s, Made in the early 70's)


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

* Re[2]: How to place an item between table rows, centered on the page.
  2002-03-06  9:11 ` Hans Hagen
  2002-03-06  9:57   ` Daniel Pittman
@ 2002-03-06 10:26   ` Giuseppe Bilotta
  2002-03-06 11:05   ` Daniel Pittman
  2002-03-07  7:00   ` Daniel Pittman
  3 siblings, 0 replies; 12+ messages in thread
From: Giuseppe Bilotta @ 2002-03-06 10:26 UTC (permalink / raw)
  Cc: ntg-context

Wednesday, March 06, 2002 Hans Hagen wrote:

HH> \def\betweentabulate#1%
HH>    {\TABLEnoalign{\nointerlineskip#1\nointerlineskip}}

HH> I guess that GB loves this trick -)

How would you guess? :-) Now let's have a vertical one!

--
Giuseppe "Oblomov" Bilotta


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

* Re: How to place an item between table rows, centered on the page.
  2002-03-06  9:11 ` Hans Hagen
  2002-03-06  9:57   ` Daniel Pittman
  2002-03-06 10:26   ` Re[2]: " Giuseppe Bilotta
@ 2002-03-06 11:05   ` Daniel Pittman
  2002-03-06 19:55     ` Hartmut Henkel
  2002-03-07  7:00   ` Daniel Pittman
  3 siblings, 1 reply; 12+ messages in thread
From: Daniel Pittman @ 2002-03-06 11:05 UTC (permalink / raw)


On Wed, 06 Mar 2002, Hans Hagen wrote:
> At 07:37 PM 3/6/2002 +1100, Daniel Pittman wrote:
>>I would like to typeset one of two things[1] between each row of a table:
>>* a partial width line
>>* a graphic

[...]

> \starttabulate[|l|l|] \NC it makes \NC much sense \NC \NR
> \betweentabulate{\blackrule[color=red,width=10mm,height=1mm,depth=1mm]}
> \NC to read \NC those tufte books \NC \NR \stoptabulate

Just one other question, which seems relevant. What /are/ the Tufte
books?

I presume, from the context, that they are a book or books that discuss
visual presentation of information. If so, I would be very pleased if
someone could give me the rest of the details (title, ISBN &c.) so that
I could, er, wish that I had the money to buy them. :)

        Daniel

-- 
The sexual revolution is over and the microbes won.
        -- P. J. O'Rourke, _Give war a chance_, 1992


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

* Re: How to place an item between table rows, centered on the page.
  2002-03-06 11:05   ` Daniel Pittman
@ 2002-03-06 19:55     ` Hartmut Henkel
  2002-03-08 20:48       ` Michael Hallgren
  0 siblings, 1 reply; 12+ messages in thread
From: Hartmut Henkel @ 2002-03-06 19:55 UTC (permalink / raw)
  Cc: ntg-context

Books from Prof. Edward Tufte see http://www.edwardtufte.com
You will like them.

Greetings Hartmut

On Wed, 6 Mar 2002, Daniel Pittman wrote:

> [...]
> 
> Just one other question, which seems relevant. What /are/ the Tufte
> books?
> 
>         Daniel

------------------------------------------------------------------------
Dr.-Ing. Hartmut Henkel
In den Auwiesen 6, D-68723 Oftersheim, Germany
E-Mail: hartmut_henkel@gmx.de
http://www.circuitwizard.de
------------------------------------------------------------------------


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

* Re: How to place an item between table rows, centered on the page.
  2002-03-06  9:11 ` Hans Hagen
                     ` (2 preceding siblings ...)
  2002-03-06 11:05   ` Daniel Pittman
@ 2002-03-07  7:00   ` Daniel Pittman
  2002-03-07 23:27     ` Hans Hagen
  3 siblings, 1 reply; 12+ messages in thread
From: Daniel Pittman @ 2002-03-07  7:00 UTC (permalink / raw)


On Wed, 06 Mar 2002, Hans Hagen wrote:
> At 07:37 PM 3/6/2002 +1100, Daniel Pittman wrote:
>>I would like to typeset one of two things[1] between each row of a
>>table: * a partial width line * a graphic
>>
>>The effect I would like to achieve is to make a visual distinction
>>between the rows of the table without a full width table line (as
>>achieved by \HL &c.).

[... trick for placing ...]

> I guess that GB loves this trick -)

I found a couple of issues with the code as you supplied it.

The main problem was that a \blackrule of 1cm would reduce the width of
the second column (p, in my case) by 1cm. Setting it to \hsize would
force that second column to be as thin as possible.

Both of these were reducing the width available from the right hand side
of the page.

The second problem was that I couldn't center the bar using the
\midaligned{} operation in ConTeXt, which would blow up with errors
dealing with \prevdepth.[1]

So, to resolve both of these I did a bit of playing around with TeX
primitives and came up with the following code:

\newbox\StepDividerBox
\def\StepDivider{               % called from the macro that writes
  \TABLEnoalign{                % table rows
    \nointerlineskip
    \vskip 4pt
    {
      \setbox\StepDividerBox=\hbox to \hsize{%
        \hfil \blackrule[width=.3\hsize,height=.5pt,depth=.3pt] \hfil
      }
      \wd\StepDividerBox=0pt
      \box\StepDividerBox
    }
    \vskip 6pt
  }
}

This gives me a centered rule of the size I want, using the spacing
between table rows I desire, but doesn't interfere with the layout of
the table rows before it.

While I feel vaguely proud of managing to achieve this result[2], I
can't help but feel that it's a bit of a hack, not a well polished use
of the tool at hand.

So, would anyone like to suggest what, if anything, I might do to make
this a cleaner command?

I am using:

This is pdfeTeX, Version 3.14159-1.00a-pretest-20011114-ojmw-2.1 (Web2C 7.3.7) (format=cont-en 2002.3.4)  7 MAR 2002 17:34
entering extended mode
**&cont-en cookbook.tex
(./cookbook.tex{/usr/share/texmf/pdftex/config/pdftex.cfg}

ConTeXt  ver: 2002.2.25  fmt: 2002.3.4  int: english  mes: english

        Daniel

Footnotes: 
[1]  I can cite these if needed.

[2]  It's the most complex layout I have ever done with TeX itself.

-- 
There is eloquence in screaming.
        -- Patrick Jones


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

* Re: How to place an item between table rows, centered on the page.
  2002-03-07  7:00   ` Daniel Pittman
@ 2002-03-07 23:27     ` Hans Hagen
  2002-03-08 10:33       ` Daniel Pittman
  0 siblings, 1 reply; 12+ messages in thread
From: Hans Hagen @ 2002-03-07 23:27 UTC (permalink / raw)
  Cc: ntg-context

At 06:00 PM 3/7/2002 +1100, Daniel Pittman wrote:

>So, to resolve both of these I did a bit of playing around with TeX
>primitives and came up with the following code:
>
>\newbox\StepDividerBox
>\def\StepDivider{               % called from the macro that writes
>   \TABLEnoalign{                % table rows
>     \nointerlineskip
>     \vskip 4pt
>     {
>       \setbox\StepDividerBox=\hbox to \hsize{%
>         \hfil \blackrule[width=.3\hsize,height=.5pt,depth=.3pt] \hfil
                                                                 ^ no space 
here

>       }
>       \wd\StepDividerBox=0pt
>       \box\StepDividerBox
>     }
>     \vskip 6pt
>   }
>}

\def\StepDivider
   {\TABLEnoalign
      {\nointerlineskip
       \vskip .4\lineheight
       \hbox to \hsize
         {\hfil
          \blackrule[width=.3\hsize,height=.5pt,depth=.3pt]%
          \hfil}%
       \vskip .6\lineheight}}

will probbaly also do,

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
-------------------------------------------------------------------------
                                   fall-back web server: 
www.pragma-ade.nl
-------------------------------------------------------------------------


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

* Re: How to place an item between table rows, centered on the page.
  2002-03-07 23:27     ` Hans Hagen
@ 2002-03-08 10:33       ` Daniel Pittman
  2002-03-08 11:23         ` Hans Hagen
  2002-03-08 11:27         ` Taco Hoekwater
  0 siblings, 2 replies; 12+ messages in thread
From: Daniel Pittman @ 2002-03-08 10:33 UTC (permalink / raw)


On Fri, 08 Mar 2002, Hans Hagen wrote:
> At 06:00 PM 3/7/2002 +1100, Daniel Pittman wrote:
> 
>>So, to resolve both of these I did a bit of playing around with TeX
>>primitives and came up with the following code:

[...]

>>       \setbox\StepDividerBox=\hbox to \hsize{%
>>         \hfil \blackrule[width=.3\hsize,height=.5pt,depth=.3pt] \hfil
>                                                                  ^ no
>                                                                  space
>                                                                  here

I am curious -- why should I avoid the space between the \blackrule and
the \hfil?  As far as I could tell it worked just fine with the space
and, as far as I know, TeX should be in the space skipping state when it
completes the execution of the \blackrule...

So, what have I missed? :)

[...]

> \def\StepDivider

[...]

> will probbaly also do,

Nope. That also had the 'squeeze the text to nothing' effect. You can
grab a copy of the PDF file from
<https://lists.rimspace.net/context-sample.pdf>

        Daniel

-- 
Life is demented enough as it is.
Why I haven't gone crazy, I don't know.
But sometimes I wish I were. 
        -- Jason Q. 


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

* Re: How to place an item between table rows, centered on the page.
  2002-03-08 10:33       ` Daniel Pittman
@ 2002-03-08 11:23         ` Hans Hagen
  2002-03-08 11:27         ` Taco Hoekwater
  1 sibling, 0 replies; 12+ messages in thread
From: Hans Hagen @ 2002-03-08 11:23 UTC (permalink / raw)
  Cc: ntg-context

At 09:33 PM 3/8/2002 +1100, Daniel Pittman wrote:

>I am curious -- why should I avoid the space between the \blackrule and
>the \hfil?  As far as I could tell it worked just fine with the space
>and, as far as I know, TeX should be in the space skipping state when it
>completes the execution of the \blackrule...
>
>So, what have I missed? :)

the space -)

you cannot be sure that \blackrule is in space skipping mode, in case of 
doubt try

....] *\hfill

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
-------------------------------------------------------------------------
                                   fall-back web server: 
www.pragma-ade.nl
-------------------------------------------------------------------------


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

* Re: How to place an item between table rows, centered on the page.
  2002-03-08 10:33       ` Daniel Pittman
  2002-03-08 11:23         ` Hans Hagen
@ 2002-03-08 11:27         ` Taco Hoekwater
  1 sibling, 0 replies; 12+ messages in thread
From: Taco Hoekwater @ 2002-03-08 11:27 UTC (permalink / raw)
  Cc: ntg-context

On Fri, 08 Mar 2002 21:33:49 +1100 "Daniel Pittman" <daniel@rimspace.net> wrote:

> I am curious -- why should I avoid the space between the \blackrule and
> the \hfil?  As far as I could tell it worked just fine with the space
> and, as far as I know, TeX should be in the space skipping state when it
> completes the execution of the \blackrule...

TeX is not in space skipping mode there. Here is the contents of the box:

\hbox(0.5+0.3)x426.78743, glue set 147.41664fil
.\glue 0.0 plus 1.0fil
.\rule(0.5+0.3)x128.03752
.\glue 3.91663 plus 1.95831 minus 1.30554
.\glue 0.0 plus 1.0fil

-- 
groeten,

Taco


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

* RE: How to place an item between table rows, centered on the page.
  2002-03-06 19:55     ` Hartmut Henkel
@ 2002-03-08 20:48       ` Michael Hallgren
  0 siblings, 0 replies; 12+ messages in thread
From: Michael Hallgren @ 2002-03-08 20:48 UTC (permalink / raw)
  Cc: ntg-context

>Books from Prof. Edward Tufte see http://www.edwardtufte.com

Interesting. Site seems to have a DNS problem tonight, though?

mh

>You will like them.
>
>Greetings Hartmut
>

On Wed, 6 Mar 2002, Daniel Pittman wrote:

> [...]
> 
> Just one other question, which seems relevant. What /are/ the Tufte
> books?
> 
>         Daniel

------------------------------------------------------------------------
Dr.-Ing. Hartmut Henkel
In den Auwiesen 6, D-68723 Oftersheim, Germany
E-Mail: hartmut_henkel@gmx.de
http://www.circuitwizard.de
------------------------------------------------------------------------


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

end of thread, other threads:[~2002-03-08 20:48 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-06  8:37 How to place an item between table rows, centered on the page Daniel Pittman
2002-03-06  9:11 ` Hans Hagen
2002-03-06  9:57   ` Daniel Pittman
2002-03-06 10:26   ` Re[2]: " Giuseppe Bilotta
2002-03-06 11:05   ` Daniel Pittman
2002-03-06 19:55     ` Hartmut Henkel
2002-03-08 20:48       ` Michael Hallgren
2002-03-07  7:00   ` Daniel Pittman
2002-03-07 23:27     ` Hans Hagen
2002-03-08 10:33       ` Daniel Pittman
2002-03-08 11:23         ` Hans Hagen
2002-03-08 11:27         ` Taco Hoekwater

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