ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* fun with markings
@ 2011-12-20 12:57 Henning Hraban Ramm
  2011-12-20 17:14 ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Henning Hraban Ramm @ 2011-12-20 12:57 UTC (permalink / raw)
  To: mailing ConTeXt users list for

Hello again,

it’s that time of year again, when I try to print my calendar and  
address book for next year, and last year’s ConTeXt code doesn’t work  
any more... (see my mails on imposition and tabulate lines problems).
Anyway; I’d like to get the first and last name on one address book  
page into its header. While that didn’t work last year at all (at  
least not in combination with imposition), I get "rather" good results  
with this code (helpfully donated by someone on this list):

"""
\setupbodyfont		[ss,18pt]

\setuplayout[location=middle,marking=on]
\setuppaper      
[nx 
= 
3 
,ny 
= 
1 
,dx 
=0mm,dy=0mm,topspace=19mm,backspace=10.5mm,page=A7,paper={A4,landscape}]
\setuparranging [XY]

\definemarking[MyNam]
\setupheadertexts[][{\getmarking[MyNam][first]–\getmarking[MyNam] 
[last]}]
\def\Name#1{#1\expanded{\marking[MyNam]{#1}}}

\starttext

\startlines
\Name{A}
\Name{B}
\Name{C}
\Name{D}
\Name{E}
\Name{F}
\Name{G}
\Name{H}
\Name{I}
\Name{J}
\Name{K}
\Name{L}
\Name{M}
\Name{N}
\Name{O}
\Name{P}
\Name{Q}
\Name{R}
\Name{S}
\Name{T}
\Name{U}
\Name{V}
\Name{W}
\Name{X}
\Name{Y}
\Name{Z}
\Name{\CONTEXT}
\stoplines

\stoptext
"""

I.e. I put the first letters of every name into the marking register  
"MyNam" and fetch its first and last value in the header.

Problem is, I get always the second and second-last name, instead the  
first and last one. E.g. if there’s A-I on the first page, header says  
B–H.




Best Greetlings!
Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: fun with markings
  2011-12-20 12:57 fun with markings Henning Hraban Ramm
@ 2011-12-20 17:14 ` Hans Hagen
  2011-12-21 10:00   ` Henning Hraban Ramm
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen @ 2011-12-20 17:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Henning Hraban Ramm

On 20-12-2011 13:57, Henning Hraban Ramm wrote:
> Hello again,
>
> it’s that time of year again, when I try to print my calendar and
> address book for next year, and last year’s ConTeXt code doesn’t work
> any more... (see my mails on imposition and tabulate lines problems).
> Anyway; I’d like to get the first and last name on one address book page
> into its header. While that didn’t work last year at all (at least not
> in combination with imposition), I get "rather" good results with this
> code (helpfully donated by someone on this list):

Marks are somewhat special in the sense that they can be loners or part 
of a chain (chapter-section-...) with special reset requirements.

As tex's natural model has some limitations, in mkiv we do things a bit 
diffrent (but rather well defined). When a set of marks on a page is 
identified, the following keywords can be used:

previous : last before sync
next     : first after sync

top      : first in sync
bottom   : last in sync

first    : first not top in sync
last     : last not bottom in sync

so, you need to use 'top' and 'bottom'. When the chain is to be ignored, 
one can append ":nocheck" to the keyword. There's also a 'current' method.

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: fun with markings
  2011-12-20 17:14 ` Hans Hagen
@ 2011-12-21 10:00   ` Henning Hraban Ramm
  0 siblings, 0 replies; 3+ messages in thread
From: Henning Hraban Ramm @ 2011-12-21 10:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 2011-12-20 um 18:14 schrieb Hans Hagen:

> Marks are somewhat special in the sense that they can be loners or  
> part of a chain (chapter-section-...) with special reset requirements.
>
> As tex's natural model has some limitations, in mkiv we do things a  
> bit diffrent (but rather well defined). When a set of marks on a  
> page is identified, the following keywords can be used:
>
> previous : last before sync
> next     : first after sync
>
> top      : first in sync
> bottom   : last in sync
>
> first    : first not top in sync
> last     : last not bottom in sync
>
> so, you need to use 'top' and 'bottom'. When the chain is to be  
> ignored, one can append ":nocheck" to the keyword. There's also a  
> 'current' method.

Thank you very much! The top and bottom keywords were missing in the  
reference.
Wikified: http://wiki.contextgarden.net/Reference/en/getmarking

I don’t really understand what you’re saying, but it works for me.




Season’s Greetlings!
Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2011-12-21 10:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-20 12:57 fun with markings Henning Hraban Ramm
2011-12-20 17:14 ` Hans Hagen
2011-12-21 10:00   ` Henning Hraban Ramm

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