ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Daniel Lyons <fusion@storytotell.org>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: conditional evaluation and section names
Date: Tue, 15 Feb 2011 12:53:00 -0600	[thread overview]
Message-ID: <20110215185300.GA13504@clanspum.net> (raw)
In-Reply-To: <33505296-72FC-45BE-9690-E3FDA5635F09@gmail.com>

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
___________________________________________________________________________________


  reply	other threads:[~2011-02-15 18:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-15  8:11 Daniel Lyons
2011-02-15 18:12 ` Wolfgang Schuster
2011-02-15 18:53   ` Daniel Lyons [this message]
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

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=20110215185300.GA13504@clanspum.net \
    --to=fusion@storytotell.org \
    --cc=ntg-context@ntg.nl \
    /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).