ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* conditional evaluation and section names
@ 2011-02-15  8:11 Daniel Lyons
  2011-02-15 18:12 ` Wolfgang Schuster
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel Lyons @ 2011-02-15  8:11 UTC (permalink / raw)
  To: ntg-context

Hi again,

I have this in my environment

\startsetups[sectioninfo]
\ss
  \rlap{\userpagenumber}
  \hfill
  § \getmarking[sectionnumber][current]
  \emspace
  \bf \getmarking[section][current]
  \hfill
  \llap{}
\stopsetups

\setupheadertexts[\setups{chapterinfo}][]
                 []                    [\setups{sectioninfo}]

This seems to be working, but there are a couple improvements I'd like to make and I'm not quite sure where to start:

1. If I'm in a later chapter than the current section is defined in, it shows up anyway. I'd like to prevent that.
2. If I'm in a chapter that doesn't have sections, I'd like the chapter name to show up instead (without the §).

I'm not sure at all how to go about doing this. I suspect the answer is to use plain TeX but I don't understand TeX's conditional system well enough to figure out how to make it work (nor ConTeXt's marking system). If anyone can help, I'd greatly appreciate it!

Thanks again,

— 
Daniel Lyons

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

* Re: conditional evaluation and section names
  2011-02-15  8:11 conditional evaluation and section names Daniel Lyons
@ 2011-02-15 18:12 ` Wolfgang Schuster
  2011-02-15 18:53   ` Daniel Lyons
  2011-02-15 19:55   ` Daniel Lyons
  0 siblings, 2 replies; 9+ messages in thread
From: Wolfgang Schuster @ 2011-02-15 18:12 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 15.02.2011 um 09:11 schrieb Daniel Lyons:

> Hi again,
> 
> I have this in my environment
> 
> \startsetups[sectioninfo]
> \ss
>  \rlap{\userpagenumber}
>  \hfill
>  § \getmarking[sectionnumber][current]
>  \emspace
>  \bf \getmarking[section][current]
>  \hfill
>  \llap{}
> \stopsetups
> 
> \setupheadertexts[\setups{chapterinfo}][]
>                 []                    [\setups{sectioninfo}]
> 
> This seems to be working, but there are a couple improvements I'd like to make and I'm not quite sure where to start:
> 
> 1. If I'm in a later chapter than the current section is defined in, it shows up anyway. I'd like to prevent that.
> 2. If I'm in a chapter that doesn't have sections, I'd like the chapter name to show up instead (without the §).
> 
> I'm not sure at all how to go about doing this. I suspect the answer is to use plain TeX but I don't understand TeX's conditional system well enough to figure out how to make it work (nor ConTeXt's marking system). If anyone can help, I'd greatly appreciate it!

Make a *complete* minimal example!

Wolfgang

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

* Re: conditional evaluation and section names
  2011-02-15 18:12 ` Wolfgang Schuster
@ 2011-02-15 18:53   ` Daniel Lyons
  2011-02-15 19:05     ` Wolfgang Schuster
  2011-02-15 19:55   ` Daniel Lyons
  1 sibling, 1 reply; 9+ messages in thread
From: Daniel Lyons @ 2011-02-15 18:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Tue, Feb 15, 2011 at 07:12:51PM +0100, Wolfgang Schuster wrote:
> > 2. If I'm in a chapter that doesn't have sections, I'd like the chapter name to show up instead (without the §).
> > 
> > I'm not sure at all how to go about doing this. I suspect the answer is to use plain TeX but I don't understand TeX's conditional system well enough to figure out how to make it work (nor ConTeXt's marking system). If anyone can help, I'd greatly appreciate it!
> 
> Make a *complete* minimal example!

OK, for #2:


\startsetups[sectioninfo]
§ \getmarking[sectionnumber]
\stopsetups

\setupheadertexts[\setups{sectioninfo}]

\starttext
\chapter{One}
\input knuth
\stoptext


This will give me a § in the header even on the first page. I'd like
to conditionally not show the § if there's no content in
\getmarking[sectionnumber]. 

I realize this is probably a basic TeX programming thing, but I
haven't yet found a resource that explains TeX as a programming
language. If you know of one, please refer me to it; I'm not trying to
waste anyone's time.

I'll cook up a minimal example of the other thing later today. It's
probably a mistake in my environment, since using the code above does
not have the problem.

Thanks again,

-- 
Daniel
___________________________________________________________________________________
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] 9+ messages in thread

* Re: conditional evaluation and section names
  2011-02-15 18:53   ` Daniel Lyons
@ 2011-02-15 19:05     ` Wolfgang Schuster
  2011-02-16  4:52       ` Daniel Lyons
  0 siblings, 1 reply; 9+ messages in thread
From: Wolfgang Schuster @ 2011-02-15 19:05 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 15.02.2011 um 19:53 schrieb Daniel Lyons:

> On Tue, Feb 15, 2011 at 07:12:51PM +0100, Wolfgang Schuster wrote:
>>> 2. If I'm in a chapter that doesn't have sections, I'd like the chapter name to show up instead (without the §).
>>> 
>>> I'm not sure at all how to go about doing this. I suspect the answer is to use plain TeX but I don't understand TeX's conditional system well enough to figure out how to make it work (nor ConTeXt's marking system). If anyone can help, I'd greatly appreciate it!
>> 
>> Make a *complete* minimal example!
> 
> OK, for #2:
> 
> 
> \startsetups[sectioninfo]
> § \getmarking[sectionnumber]
> \stopsetups

\startsetups[sectioninfo]
\doiftextelse{\getmarking[sectionnumber]}
  {§ \getmarking[sectionnumber]}
  {\unknown}
\stopsetups

Wolfgang

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

* Re: conditional evaluation and section names
  2011-02-15 18:12 ` Wolfgang Schuster
  2011-02-15 18:53   ` Daniel Lyons
@ 2011-02-15 19:55   ` Daniel Lyons
  2011-02-16  4:50     ` Daniel Lyons
  1 sibling, 1 reply; 9+ messages in thread
From: Daniel Lyons @ 2011-02-15 19:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users


On Feb 15, 2011, at 11:12 AM, Wolfgang Schuster wrote:

> Make a *complete* minimal example!

>> 1. If I'm in a later chapter than the current section is defined in, it shows up anyway. I'd like to prevent that.

I've fixed the symptom by adding this code:

\setuphead[chapter][after={\marking[section][]}]

I still haven't found a minimal example of the behavior, so later on I'll see if I can distill my error.

Thanks,

— 
Daniel Lyons

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

* Re: conditional evaluation and section names
  2011-02-15 19:55   ` Daniel Lyons
@ 2011-02-16  4:50     ` Daniel Lyons
  0 siblings, 0 replies; 9+ messages in thread
From: Daniel Lyons @ 2011-02-16  4:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users


On Feb 15, 2011, at 12:55 PM, Daniel Lyons wrote:

> 
> On Feb 15, 2011, at 11:12 AM, Wolfgang Schuster wrote:
> 
>> Make a *complete* minimal example!
> 
>>> 1. If I'm in a later chapter than the current section is defined in, it shows up anyway. I'd like to prevent that.
> 
> I still haven't found a minimal example of the behavior, so later on I'll see if I can distill my error.


The problem happens reliably in my big project, but I can't seem to boil it down without getting rid of it. If I discover what it is, I'll report back, but in the meantime I've worked around it, and it seems to be a configuration issue on my end. Sorry about the trouble.

— 
Daniel Lyons

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

* Re: conditional evaluation and section names
  2011-02-15 19:05     ` Wolfgang Schuster
@ 2011-02-16  4:52       ` Daniel Lyons
  2011-02-16  7:36         ` Cedric Mauclair
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel Lyons @ 2011-02-16  4:52 UTC (permalink / raw)
  To: mailing list for ConTeXt users


On Feb 15, 2011, at 12:05 PM, Wolfgang Schuster wrote:

> \doiftextelse{\getmarking[sectionnumber]}
>  {§ \getmarking[sectionnumber]}
>  {\unknown}


I assume there are other helpful functions like this that aren't documented on the wiki (such as \DropCap). Is there a place where these things are documented that I should be looking? Or a particular piece of source code I should read to get acquainted with these sorts of library functions?

Thanks again,

— 
Daniel Lyons

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

* Re: conditional evaluation and section names
  2011-02-16  4:52       ` Daniel Lyons
@ 2011-02-16  7:36         ` Cedric Mauclair
  2011-02-16 15:03           ` Wolfgang Schuster
  0 siblings, 1 reply; 9+ messages in thread
From: Cedric Mauclair @ 2011-02-16  7:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, Feb 16, 2011 at 05:52, Daniel Lyons <fusion@storytotell.org> wrote:
>
> On Feb 15, 2011, at 12:05 PM, Wolfgang Schuster wrote:
>
>> \doiftextelse{\getmarking[sectionnumber]}
>>  {§ \getmarking[sectionnumber]}
>>  {\unknown}
>
>
> I assume there are other helpful functions like this that aren't documented on the wiki (such as \DropCap). Is there a place where these things are documented that I should be looking? Or a particular piece of source code I should read to get acquainted with these sorts of library functions?

You definitely need to check syst-aux.mkiv.


Regards.

-- Cédric

>
> Thanks again,
>
> —
> Daniel Lyons
>
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
>
___________________________________________________________________________________
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] 9+ messages in thread

* Re: conditional evaluation and section names
  2011-02-16  7:36         ` Cedric Mauclair
@ 2011-02-16 15:03           ` Wolfgang Schuster
  0 siblings, 0 replies; 9+ messages in thread
From: Wolfgang Schuster @ 2011-02-16 15:03 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 822 bytes --]


Am 16.02.2011 um 08:36 schrieb Cedric Mauclair:

> On Wed, Feb 16, 2011 at 05:52, Daniel Lyons <fusion@storytotell.org> wrote:
>> 
>> On Feb 15, 2011, at 12:05 PM, Wolfgang Schuster wrote:
>> 
>>> \doiftextelse{\getmarking[sectionnumber]}
>>>  {§ \getmarking[sectionnumber]}
>>>  {\unknown}
>> 
>> 
>> I assume there are other helpful functions like this that aren't documented on the wiki (such as \DropCap). Is there a place where these things are documented that I should be looking? Or a particular piece of source code I should read to get acquainted with these sorts of library functions?
> 
> You definitely need to check syst-aux.mkiv.


The wiki explains a few of the command too:

- http://tex.aanhet.net/context/syst-gen-doc.pdf
- http://wiki.contextgarden.net/System_Macros

Wolfgang


[-- Attachment #1.2: Type: text/html, Size: 1760 bytes --]

[-- Attachment #2: Type: text/plain, Size: 486 bytes --]

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

end of thread, other threads:[~2011-02-16 15:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-15  8:11 conditional evaluation and section names Daniel Lyons
2011-02-15 18:12 ` Wolfgang Schuster
2011-02-15 18:53   ` Daniel Lyons
2011-02-15 19:05     ` Wolfgang Schuster
2011-02-16  4:52       ` Daniel Lyons
2011-02-16  7:36         ` Cedric Mauclair
2011-02-16 15:03           ` Wolfgang Schuster
2011-02-15 19:55   ` Daniel Lyons
2011-02-16  4:50     ` Daniel Lyons

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