ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Daniel Pittman <daniel@rimspace.net>
Subject: Re: How to place an item between table rows, centered on the page.
Date: Thu, 07 Mar 2002 18:00:05 +1100	[thread overview]
Message-ID: <874rjs9822.fsf@inanna.rimspace.net> (raw)
In-Reply-To: <5.1.0.14.1.20020306101103.034df6d0@server-1> (Hans Hagen's message of "Wed, 06 Mar 2002 10:11:30 +0100")

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


  parent reply	other threads:[~2002-03-07  7:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-06  8:37 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 [this message]
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

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=874rjs9822.fsf@inanna.rimspace.net \
    --to=daniel@rimspace.net \
    /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).