ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Code for multiline footers here
@ 2002-07-23  7:00 mari.voipio
  0 siblings, 0 replies; 11+ messages in thread
From: mari.voipio @ 2002-07-23  7:00 UTC (permalink / raw)


I promised to send in the code with which I got my multiline footers to
work. Here's the code, complete with our manuals information and the
comments in the code (intended for our translators etc. non-ConTeXt
people; note that you should cut an paste this into a ConTeXt page before
running, this piece only sets the footer. The style of this footer is
crud, but that's how our manuals look now and I was supposed to achieve
something that looks alike...

%------------------------------------------------------------------
% The combination of boxes below make it possible to use multiple
% lines in the footer and also puts the hairline above the text.
% If you don't know what you are doing, do NOT touch anything but
% the  content visible in the pdf version!
%------------------------------------------------------------------
\setupfootertexts
     [\vbox{
        \hbox to \textwidth{\hairline}
        \hbox to \textwidth{
            \hbox{{\tfxx {\sc Instruction Manual for K-Patents
            Process Refractometer PR-03-D}}}
            \hfill
            \hbox{{\tfxx Document No. INM-3D: Rev. 1/1}}
            }
        \hbox to \textwidth{
            \hfill
            \hbox{{\tfxx Effective: April 19\high{th}, 2001}}
            }
        }
     ][\blank]
     [\vbox{
        \hbox to \textwidth{\hairline}
        \hbox to \textwidth{
            \hbox{{\tfxx {\sc Instruction Manual for K-Patents
            Process Refractometer PR-03-D}}}
            \hfill
            \hbox{{\tfxx Document No. INM-3D: Rev. 1/1}}
            }
        \hbox to \textwidth{
            \hfill
            \hbox{{\tfxx Effective: April 19\high{th}, 2001}}
            }
        }
     ][\blank]
% End of Footer.
%-----------------------------------------------------------------

Mari
(in whose document this really works...)


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

* Re: Code for multiline footers here
  2002-07-23 21:13               ` Nigel King
@ 2002-07-24 16:28                 ` Hans Hagen
  0 siblings, 0 replies; 11+ messages in thread
From: Hans Hagen @ 2002-07-24 16:28 UTC (permalink / raw)
  Cc: ntg-context

At 10:13 PM 7/23/2002 +0100, you wrote:
> > in comma separated lists, only spaces after the comma are ignores
>
>Sometimes it seems that spaces after commas are a problem in lists. In the
>following example using multiple background layers if I put a space between
>'bg,' and 'backgraphics,' then the backgraphics do not show up in the
>output.
>
>\setupbackgrounds
>     [page]
>     [background={bg,backgraphics,foreground,foregraphics}]
>
>It seems to me that 'The Manual' needs to state the rule for these spaces
>rather strongly since this seems to be a Context business rather than
>something one can learn in any other manual.

you're right, backgrounds is one of the few places where fast comma list 
parsing is used, only for the sake of fast processing; i will probably 
change that to the normal parsing when my laptop crosses the 4 Gig barrier, 
which is probably a year from now (just ordered a 2 Gig one so i will keep 
the fast commalist in there for a while -)

general rule: in key=value, no problem, elsewhere, avoid spaces after commas

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] 11+ messages in thread

* Re: Code for multiline footers here
  2002-07-23 17:03             ` Hans Hagen
@ 2002-07-23 21:13               ` Nigel King
  2002-07-24 16:28                 ` Hans Hagen
  0 siblings, 1 reply; 11+ messages in thread
From: Nigel King @ 2002-07-23 21:13 UTC (permalink / raw)
  Cc: ntg-context

> in comma separated lists, only spaces after the comma are ignores

Sometimes it seems that spaces after commas are a problem in lists. In the
following example using multiple background layers if I put a space between
'bg,' and 'backgraphics,' then the backgraphics do not show up in the
output.

\setupbackgrounds
    [page]
    [background={bg,backgraphics,foreground,foregraphics}]

It seems to me that 'The Manual' needs to state the rule for these spaces
rather strongly since this seems to be a Context business rather than
something one can learn in any other manual.

Thanks
-- 
Nigel


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

* Re: Code for multiline footers here
  2002-07-23 15:49           ` Adam Lindsay
@ 2002-07-23 17:03             ` Hans Hagen
  2002-07-23 21:13               ` Nigel King
  0 siblings, 1 reply; 11+ messages in thread
From: Hans Hagen @ 2002-07-23 17:03 UTC (permalink / raw)
  Cc: ntg-context

At 04:49 PM 7/23/2002 +0100, you wrote:
>Okay, cool. That's helpful to know.
>
>The bug in my own code that I had a tough time finding was when I typed:
>\definecombinedlist [content]
>
>[    section,
>
>      subsection  ]
>
>
>...when I should have typed:
>\definecombinedlist [content]
>
>[    section,
>
>      subsection]
>
>
>I never imagined the whitespace after 'subsection' would be judged as part
>of the token. Perhaps this is part of the same issue, but I'm not so sure
>right now.

in comma separated lists, only spaces after the comma are ignores
-------------------------------------------------------------------------
                                   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] 11+ messages in thread

* Re: Code for multiline footers here
  2002-07-23 14:19         ` Hans Hagen
@ 2002-07-23 15:49           ` Adam Lindsay
  2002-07-23 17:03             ` Hans Hagen
  0 siblings, 1 reply; 11+ messages in thread
From: Adam Lindsay @ 2002-07-23 15:49 UTC (permalink / raw)
  Cc: mari.voipio, ConTeXt Mailing List, Rosemary Fitzgerald

Okay, cool. That's helpful to know.

The bug in my own code that I had a tough time finding was when I typed:
\definecombinedlist [content]

[    section,

     subsection  ]

...when I should have typed:
\definecombinedlist [content]

[    section,

     subsection]

I never imagined the whitespace after 'subsection' would be judged as part
of the token. Perhaps this is part of the same issue, but I'm not so sure
right now.

Best regards,
adam

----- Original Message -----
From: "Hans Hagen" <pragma@wxs.nl>
To: "Adam Lindsay" <atl@comp.lancs.ac.uk>
Cc: <mari.voipio@iki.fi>; "ConTeXt Mailing List" <ntg-context@ntg.nl>;
"Rosemary Fitzgerald" <rosemary.fitzgerald@btinternet.com>
Sent: Tuesday, July 23, 2002 3:19 PM
Subject: Re: Code for multiline footers here

> At 02:31 PM 7/23/2002 +0100, Adam Lindsay wrote:
>
> >It's not that there is whitespace sensitivity, but that it's not
consistent
> >between (for example) \setups (IIRC, that's what gave me such problems).
I
> >haven't yet figured out (or found in the docs) a pattern where certain
> >commands are more or less sensitive to TeXy things.
>
> in general:
>
> in hmode spaces do matter, so when you are in a sentence (or hbox) be
> careful with spaces,
>
> in vertical mode, between paragraphs, spaces don't matter
>
> so:
>
> \hbox { here spaces count }
> \vbox { here they only \par count in sentences }
>
> 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] 11+ messages in thread

* Re: Code for multiline footers here
  2002-07-23 13:31       ` Adam Lindsay
@ 2002-07-23 14:19         ` Hans Hagen
  2002-07-23 15:49           ` Adam Lindsay
  0 siblings, 1 reply; 11+ messages in thread
From: Hans Hagen @ 2002-07-23 14:19 UTC (permalink / raw)
  Cc: mari.voipio, ConTeXt Mailing List, Rosemary Fitzgerald

At 02:31 PM 7/23/2002 +0100, Adam Lindsay wrote:

>It's not that there is whitespace sensitivity, but that it's not consistent
>between (for example) \setups (IIRC, that's what gave me such problems). I
>haven't yet figured out (or found in the docs) a pattern where certain
>commands are more or less sensitive to TeXy things.

in general:

in hmode spaces do matter, so when you are in a sentence (or hbox) be 
careful with spaces,

in vertical mode, between paragraphs, spaces don't matter

so:

\hbox { here spaces count }
\vbox { here they only \par count in sentences }

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] 11+ messages in thread

* Re: Code for multiline footers here
  2002-07-23 11:19     ` Hans Hagen
@ 2002-07-23 13:31       ` Adam Lindsay
  2002-07-23 14:19         ` Hans Hagen
  0 siblings, 1 reply; 11+ messages in thread
From: Adam Lindsay @ 2002-07-23 13:31 UTC (permalink / raw)
  Cc: ConTeXt Mailing List, Rosemary Fitzgerald

Hi all.

I just have to chime in as a newbie.

> come on, it's not that bad, it's just that in tex you need to be aware of
> spaces creeping in
>
> so, not:
>
> \hbox{
>   test
> }
>
> but
>
> \hbox
>    {test}
>
> [snip...]
> vboxes are less sensitive; also, you can always do things like

Ah-ha. That difference (less sensitive) is what's key, and what I have spent
a few frustrating hours trying to debug, myself.

It's not that there is whitespace sensitivity, but that it's not consistent
between (for example) \setups (IIRC, that's what gave me such problems). I
haven't yet figured out (or found in the docs) a pattern where certain
commands are more or less sensitive to TeXy things.

Many of the examples given in the docs are nicely spaced out, so it's a hard
pattern to grasp without general guidance.

Of course ConTeXt is amazing. In being a month-old beginner, I've
typeset/designed/edited a pair of course handbooks for my fiancee, which in
turn convinced her to use it for her own PhD thesis.

The thing is, there are still some odd gotchas for people trying to use it
on a high level, who *want* to stay relatively TeX-ignorant. Is that such a
heresy when you, Hans, are providing an elegant, high-level macro package?

Bedankt,
adam


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

* Re: Code for multiline footers here
       [not found]   ` <Pine.OSF.4.30.0207231325390.6142-100000@sirppi.helsinki.fi >
  2002-07-23 11:19     ` Hans Hagen
@ 2002-07-23 11:23     ` Hans Hagen
  1 sibling, 0 replies; 11+ messages in thread
From: Hans Hagen @ 2002-07-23 11:23 UTC (permalink / raw)
  Cc: ConTeXt Mailing List

At 01:32 PM 7/23/2002 +0300, mari.voipio@iki.fi wrote:

>I do not mean to demean anybody's efforts and I find this mailing list a
>valuable help tool. But using ConTeXt will not get very common until the
>first steps are a bit easier. I will myself try to help here, but there
>are many things I need to learn first, I would not like to be a bad
>example...

btw, one way to solve this problem is that users summarize solutions (+ an 
example) so that it can be posted somewhere

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] 11+ messages in thread

* Re: Code for multiline footers here
       [not found]   ` <Pine.OSF.4.30.0207231325390.6142-100000@sirppi.helsinki.fi >
@ 2002-07-23 11:19     ` Hans Hagen
  2002-07-23 13:31       ` Adam Lindsay
  2002-07-23 11:23     ` Hans Hagen
  1 sibling, 1 reply; 11+ messages in thread
From: Hans Hagen @ 2002-07-23 11:19 UTC (permalink / raw)
  Cc: ConTeXt Mailing List

At 01:32 PM 7/23/2002 +0300, mari.voipio@iki.fi wrote:

>I think that this is one of the problems with ConTeXt: my brother said
>that in the beginning he learned a lot about TeX just by cutting and
>pasting existing code and that's also how I learned quite much HTML once I
>grasped the basic idea. But I had no complete ConTeXt files (i.e. tex
>files, not pdf) to look at and thus I seem to have misunderstood some
>things.
>I like writing loose code that's easy to read - but it seems now, that
>some of my code has too many line breaks and I still don't quite
>understand the logic of them (at least there must be one). It seems that
>I'd need a "pre-newbie" manual or something. Or just examples of short
>papers and similar written in ConTeXt - better ConTeXt than mine, I
>probably shouldn't post anything for many months yet. :-)

come on, it's not that bad, it's just that in tex you need to be aware of 
spaces creeping in

so, not:

\hbox{
  test
}

but

\hbox
   {test}

or

\hbox{%
   test%
  }

vboxes are less sensitive; also, you can always do things like

\hbox \bgroup \ignorespaces
   test
\unskip \egroup

actually: once you understand hbox, hskip, vbox, vskip you're nearly done

also: \framed may be of help, i use that a lot and just turn off the frame 
when things look ok

also: \strut is important (\showstruts will learn that)

> > also: the \blank is not needed
>
>I couldn't make it work without, but now I see that the problem was
>elsewhere, so you are correct. Now that I got the accidental spaces out, I
>don't need to tweak the code with that either.
>
>Now I got my multiline footer down to this for one page (and \ruledhbox
>shows that there aren't any extra spaces, at least I can't find any):
>
>\setupfootertexts
>      [\vbox{
>         \hbox to \textwidth{\hairline}
>         \hbox to \textwidth{\hbox{{\tfxx {\sc Instruction Manual for
>             K-Patents Process Refractometer PR-03-D}}}
>             \hfill
>             \hbox{{\tfxx Document No. INM-3D: Rev. 1/1}}}
>         \hbox to \textwidth{
>             \hfill
>             \hbox{{\tfxx Effective: April 19\high{th}, 2001}}}}]
>      []
>
>Simpler recipes, anyone?

no boxes at all:

\startbuffer
   \inframed
     [width=broad,topframe=on,frame=off,offset=0pt]
     {\tfxx {\sc Instruction Manual for
      K-Patents Process Refractometer PR-03-D}\hfill
      Document No. INM-3D: Rev. 1/1}
   \nointerlineskip
   \inframed
     [width=broad,frame=off,align=left,offset=0pt]
     {\tfxx Effective: April 19\high{th}, 2001}
\stopbuffer

\setupfootertexts [\vbox{\getbuffer}] []

>I like ConTeXt very much, *when* I get it to work. But I also find it
>pretty mindboggling and sometimes I get pretty desperate. The only thing
>that keeps me going on is the thought that some day I can convert my +100
>page Word file into a ConTeXt file and I don't ever again have to worry
>about my Windows tilting because of that dratted manual file (for a
>measuring instrument). But getting that far seems like hard work (at least
>I get paid for doing it) and takes a great deal of motivation.
>
>I do not mean to demean anybody's efforts and I find this mailing list a
>valuable help tool. But using ConTeXt will not get very common until the
>first steps are a bit easier. I will myself try to help here, but there
>are many things I need to learn first, I would not like to be a bad
>example...

the problem with tex systems is that once you know that a lot can be done 
... you want to do it ... and then enterthe learning curve

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] 11+ messages in thread

* Re: Code for multiline footers here
  2002-07-23  7:40 ` Hans Hagen
@ 2002-07-23 10:32   ` mari.voipio
       [not found]   ` <Pine.OSF.4.30.0207231325390.6142-100000@sirppi.helsinki.fi >
  1 sibling, 0 replies; 11+ messages in thread
From: mari.voipio @ 2002-07-23 10:32 UTC (permalink / raw)


[Life is learning - I finally managed to set up my email program so that
my messages don't get stuck in the list's spam filter.]

On Tue, 23 Jul 2002, Hans Hagen wrote:
>
> that's a lot of spurious spaces, better use an explicit one \space or
> use \hfill
>
> try \ruledhbox instead of the \hboxes and you see what i mean

You were correct, as always. I had not realized *at*all* that my way of
writing ConTeXt code might cause the problems with extra space and at the
time I fought with that footer I had no means to figure out what a
\ruledhbox would do - that really was a helpful tool.

You see, I've never seen any ConTeXt code except the elementary crud
written by myself, a complete beginner (without background in TeX).  And
then of course I've seen the snippets of code on this list, but more than
half of that is way beyond my understanding of ConTeXt and typography in
general (even if it was in Finnish, I'd still not understand).

I think that this is one of the problems with ConTeXt: my brother said
that in the beginning he learned a lot about TeX just by cutting and
pasting existing code and that's also how I learned quite much HTML once I
grasped the basic idea. But I had no complete ConTeXt files (i.e. tex
files, not pdf) to look at and thus I seem to have misunderstood some
things.
I like writing loose code that's easy to read - but it seems now, that
some of my code has too many line breaks and I still don't quite
understand the logic of them (at least there must be one). It seems that
I'd need a "pre-newbie" manual or something. Or just examples of short
papers and similar written in ConTeXt - better ConTeXt than mine, I
probably shouldn't post anything for many months yet. :-)

> also: the \blank is not needed

I couldn't make it work without, but now I see that the problem was
elsewhere, so you are correct. Now that I got the accidental spaces out, I
don't need to tweak the code with that either.

Now I got my multiline footer down to this for one page (and \ruledhbox
shows that there aren't any extra spaces, at least I can't find any):

\setupfootertexts
     [\vbox{
        \hbox to \textwidth{\hairline}
        \hbox to \textwidth{\hbox{{\tfxx {\sc Instruction Manual for
            K-Patents Process Refractometer PR-03-D}}}
            \hfill
            \hbox{{\tfxx Document No. INM-3D: Rev. 1/1}}}
        \hbox to \textwidth{
            \hfill
            \hbox{{\tfxx Effective: April 19\high{th}, 2001}}}}]
     []

Simpler recipes, anyone?

I like ConTeXt very much, *when* I get it to work. But I also find it
pretty mindboggling and sometimes I get pretty desperate. The only thing
that keeps me going on is the thought that some day I can convert my +100
page Word file into a ConTeXt file and I don't ever again have to worry
about my Windows tilting because of that dratted manual file (for a
measuring instrument). But getting that far seems like hard work (at least
I get paid for doing it) and takes a great deal of motivation.

I do not mean to demean anybody's efforts and I find this mailing list a
valuable help tool. But using ConTeXt will not get very common until the
first steps are a bit easier. I will myself try to help here, but there
are many things I need to learn first, I would not like to be a bad
example...

My five eurocents,

Mari


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

* Re: Code for multiline footers here
       [not found] <Pine.OSF.4.30.0207230955180.14502-100000@sirppi.helsinki.f i>
@ 2002-07-23  7:40 ` Hans Hagen
  2002-07-23 10:32   ` mari.voipio
       [not found]   ` <Pine.OSF.4.30.0207231325390.6142-100000@sirppi.helsinki.fi >
  0 siblings, 2 replies; 11+ messages in thread
From: Hans Hagen @ 2002-07-23  7:40 UTC (permalink / raw)
  Cc: ConTeXt Mailing List

At 10:00 AM 7/23/2002 +0300, mari.voipio@iki.fi wrote:

>%------------------------------------------------------------------
>% The combination of boxes below make it possible to use multiple
>% lines in the footer and also puts the hairline above the text.
>% If you don't know what you are doing, do NOT touch anything but
>% the  content visible in the pdf version!
>%------------------------------------------------------------------
>\setupfootertexts
>      [\vbox{

              ^^

>         \hbox to \textwidth{\hairline}
>         \hbox to \textwidth{

                              ^^

>             \hbox{{\tfxx {\sc Instruction Manual for K-Patents
>             Process Refractometer PR-03-D}}}
>             \hfill
>             \hbox{{\tfxx Document No. INM-3D: Rev. 1/1}}
                                                          ^^

>             }
>         \hbox to \textwidth{
                              ^^

>             \hfill

that's a lot of spurious spaces, better use an explicit one \space or use 
\hfill

try \ruledhbox instead of the \hboxes and you see what i mean

also: the \blank is not needed

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] 11+ messages in thread

end of thread, other threads:[~2002-07-24 16:28 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-23  7:00 Code for multiline footers here mari.voipio
     [not found] <Pine.OSF.4.30.0207230955180.14502-100000@sirppi.helsinki.f i>
2002-07-23  7:40 ` Hans Hagen
2002-07-23 10:32   ` mari.voipio
     [not found]   ` <Pine.OSF.4.30.0207231325390.6142-100000@sirppi.helsinki.fi >
2002-07-23 11:19     ` Hans Hagen
2002-07-23 13:31       ` Adam Lindsay
2002-07-23 14:19         ` Hans Hagen
2002-07-23 15:49           ` Adam Lindsay
2002-07-23 17:03             ` Hans Hagen
2002-07-23 21:13               ` Nigel King
2002-07-24 16:28                 ` Hans Hagen
2002-07-23 11:23     ` Hans Hagen

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