ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* getmarking and empty chapter number
@ 2011-05-23 19:39 Oliver Buerschaper
  2011-05-24  0:26 ` Aditya Mahajan
  0 siblings, 1 reply; 3+ messages in thread
From: Oliver Buerschaper @ 2011-05-23 19:39 UTC (permalink / raw)
  To: mailing ConTeXt users list for

Hi all,

I'm just trying to wrap my mind around why the following doesn't work as I expect:

--
\setupheadertexts
	[]
	[{\doifsomething{\getmarking[sectionnumber]}{\getmarking[sectionnumber]\enskip}\getmarking[section]}]
	[{\doifsomething{\getmarking[chapternumber]}{\getmarking[chapternumber]\enskip}\getmarking[chapter]}]
	[]
--

When this encounters an unnumbered \startchapter (say in the front matter) then this \doifsomething should detect this void and in particular not insert the \enskip. For some reason the space ends up in the PDF nevertheless :-(

Any ideas?

Many thanks,
Oliver
___________________________________________________________________________________
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: getmarking and empty chapter number
  2011-05-23 19:39 getmarking and empty chapter number Oliver Buerschaper
@ 2011-05-24  0:26 ` Aditya Mahajan
  2011-05-24  6:28   ` Oliver Buerschaper
  0 siblings, 1 reply; 3+ messages in thread
From: Aditya Mahajan @ 2011-05-24  0:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Mon, 23 May 2011, Oliver Buerschaper wrote:

> Hi all,
>
> I'm just trying to wrap my mind around why the following doesn't work as I expect:
>
> --
> \setupheadertexts
> 	[]
> 	[{\doifsomething{\getmarking[sectionnumber]}{\getmarking[sectionnumber]\enskip}\getmarking[section]}]
> 	[{\doifsomething{\getmarking[chapternumber]}{\getmarking[chapternumber]\enskip}\getmarking[chapter]}]
> 	[]
> --
>
> When this encounters an unnumbered \startchapter (say in the front 
> matter) then this \doifsomething should detect this void and in 
> particular not insert the \enskip. For some reason the space ends up in 
> the PDF nevertheless :-(
>
> Any ideas?

From supp-box.mkiv:

%D \macros
%D   {doiftextelse, doiftext}
%D
%D When \type {\doifelse} cum suis hopelessly fail, for
%D instance because we pass data, we can fall back on the next
%D macro:
%D
%D \starttyping
%D \doiftextelse {data} {then branch} {else branch}
%D \doiftext     {data} {then branch}
%D \stoptyping

Aditya
___________________________________________________________________________________
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: getmarking and empty chapter number
  2011-05-24  0:26 ` Aditya Mahajan
@ 2011-05-24  6:28   ` Oliver Buerschaper
  0 siblings, 0 replies; 3+ messages in thread
From: Oliver Buerschaper @ 2011-05-24  6:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> %D \macros
> %D   {doiftextelse, doiftext}
> %D
> %D When \type {\doifelse} cum suis hopelessly fail, for
> %D instance because we pass data, we can fall back on the next
> %D macro:
> %D
> %D \starttyping
> %D \doiftextelse {data} {then branch} {else branch}
> %D \doiftext     {data} {then branch}
> %D \stoptyping

Works neatly! Thanks a lot.

Oliver
___________________________________________________________________________________
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-05-24  6:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-23 19:39 getmarking and empty chapter number Oliver Buerschaper
2011-05-24  0:26 ` Aditya Mahajan
2011-05-24  6:28   ` Oliver Buerschaper

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