ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Code Called Twice?
@ 2013-10-11  6:21 Thangalin
  2013-10-11  7:27 ` Marco Patzer
  2013-10-11 11:00 ` Philipp Gesang
  0 siblings, 2 replies; 7+ messages in thread
From: Thangalin @ 2013-10-11  6:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

I noticed something unexpected with the following code:

\enabletrackers[metapost.showlog]

\startuseMPgraphic{heading:ThemeTitleStyle}
  show "HEADING:THEMETITLESTYLE";
  show \MPstring{heading:title};

  draw textext( \MPstring{heading:title} ) rotated 5
    withcolor blue;
\stopuseMPgraphic

\defineframed[ThemeTitleStyle][
  background=\useMPgraphic{ThemeTitleStyle},
]

\def\processword#1{%
  \setMPtext{heading:title}{#1}%
  \useMPgraphic{heading:ThemeTitleStyle}
}

\define[1]\ThemeChapterTitle{\applytosplitstringword\processword{#1}}
\setuphead[chapter][deeptextcommand={\ThemeChapterTitle}]

\starttext
  \startchapter[title=Why Is heading:ThemeTitleStyle Called Twice?]
  \input knuth
  \stopchapter
\stoptext

It appears as though heading:ThemeTitleStyle is being called twice:

metapost        > info:
>> "HEADING:THEMETITLESTYLE"
>> "Why"
metapost        > info:
>> "HEADING:THEMETITLESTYLE"
>> "Why"

I am trying to produce a random number that is not equal to the
previous random number. However, if the code is called twice, then I'd
have to add code to ignore one of the calls.

Any ideas why the code seems to be called twice and what can be done
to ensure that it is only called once?

Thank you!
___________________________________________________________________________________
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] 7+ messages in thread

end of thread, other threads:[~2013-10-12  0:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-11  6:21 Code Called Twice? Thangalin
2013-10-11  7:27 ` Marco Patzer
2013-10-11 16:39   ` Thangalin
2013-10-11 11:00 ` Philipp Gesang
2013-10-11 21:29   ` Hans Hagen
2013-10-12  0:09     ` Philipp Gesang
2013-10-12  0:16       ` Hans Hagen

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