ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* More headache with \setuphead
@ 2015-01-31 23:26 Rob Heusdens
  2015-02-01  9:42 ` Pablo Rodriguez
  0 siblings, 1 reply; 2+ messages in thread
From: Rob Heusdens @ 2015-01-31 23:26 UTC (permalink / raw)
  To: ntg-context

Related post:
section with \sethupead[section][alternative=text]; other type of section
misbehaves..


Hello list,

It seems I have more problems with \setuphead, which I can't get hold on.

This time content misbehaves in way I can't understand.

Here are the relevant definitions/commands:

\setuphead[chapter]
   [header=nomarking,
   command=\MyChapterCommand,
   aligntitle=yes,
   align={flushleft,nothyphenated,verytolerant}]

\setuphead[content]
   [command=,
    textcommand=\MyContentCommand]

What I expect this set of definitions to do is to indeed perform
\MyChapterCommand for a chapter to typeset the title of a chapter.

For the table of contents, I hoped that it would not do the command, which
I set for chapter (by clearing that option with =,), and instead perform
the textcommand \MyContentCommand.

However from my output it is clear that the table of content still does
\MyChapterCommand.

As a workaround, I postponed setting \setuphead for chapter till after the
content.

But why does this not work?

Even if content is supposedly doing the same thing as chapter does, it I
make thereafter changes to content, and in fact "undo" the command setting
and instead direct it to perform a textcommand, I don't expect it to still
perform \MyChapterCommand. But it does that.

Below the definitions for both commands:

\define[1]\MyContentCommand%
  {\framed[frame=off,offset=none,frameoffset=0pt]
     {\vbox{\blank[4cm]\Word{#1}}}}


\define[2]\MyChapterCommand%
  {\framed[frame=off,offset=none,frameoffset=0pt]
     {\vbox{\blank[4cm]{\small \headtext{chapter}
#1}\blank\unhyphenated{#2}}}}


Can anyone advise?

Thanks,

Rob

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

* Re: More headache with \setuphead
  2015-01-31 23:26 More headache with \setuphead Rob Heusdens
@ 2015-02-01  9:42 ` Pablo Rodriguez
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Rodriguez @ 2015-02-01  9:42 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 02/01/2015 12:26 AM, Rob Heusdens wrote:
> Related post:
> section with \sethupead[section][alternative=text]; other type of section
> misbehaves..
> [...]
> Can anyone advise?

Hi Rob,

how about providing a sample that can be copied, pasted and compiled and
a brief description of what you get and what you intend?

It might be that I’m not good at reading, that my background is not
computer science, that my English is broken, or that I’m a lazy person
(or simply a jerk :-)).

Seriously, the sample avoids guesswork. Not only reconstructing the
code, but meeting the requirements you have for your document.

I think this should be your improved sample:

\define[1]\MyContentCommand%
  {\framed[frame=on,offset=none,frameoffset=0pt]
     {\vbox{\blank[1cm]\Word{#1}}}}

\define[2]\MyChapterCommand%
  {\framed[frame=on,offset=none,frameoffset=0pt]
     {\vbox{\blank[4cm]{\small \headtext{chapter}
        #1}\blank\unhyphenated{#2}}}}

\setuphead[chapter]
   [header=nomarking,
   command=\MyChapterCommand,
   aligntitle=yes,
   align={flushleft,nothyphenated,verytolerant}]

\setuphead[title]
   [command=,
    textcommand=\MyContentCommand]

\starttext
\completecontent

\chapter{Chapter}
\stoptext

In \completecontent, the heading command is not \content but \title.

At least, it seems to work in the previous sample.

I hope it helps,


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
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] 2+ messages in thread

end of thread, other threads:[~2015-02-01  9:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-31 23:26 More headache with \setuphead Rob Heusdens
2015-02-01  9:42 ` Pablo Rodriguez

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