ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* DIY toc (or similar list)
@ 2010-02-07 21:58 Thomas A. Schmitz
  2010-02-07 22:16 ` Wolfgang Schuster
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas A. Schmitz @ 2010-02-07 21:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi experts,

I'm thinking about a new presentation style and need some general advice from the TeXperts. I would like to have a list of topics on some area of the slide (similar to s-pre-19.tex). However, if at all possible, I would like it to be a bit fancier. Let's say I want the list of topics typeset in gray frames in a black font, but the current topic in a blue frame with a white font. Would this be possible with something like \definelist? Is there any notion of "currentlistitem" or "currentmarking" in such lists? Or, even better: would it be possible to have access to the single members of a list and maybe compare them to a current value and then typeset them accordingly? Something like this pseudocode:

for member in topiclist do
  if member == currentvalue
     <some fancy framing and metapost stuff with member>
  else
     <less fancy but still nice-looking metapost stuff>
  end
end

Or am I trying to reinvent the wheel here? I would be happy to hear any ideas on that. 

All best

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

* Re: DIY toc (or similar list)
  2010-02-07 21:58 DIY toc (or similar list) Thomas A. Schmitz
@ 2010-02-07 22:16 ` Wolfgang Schuster
  2010-02-07 22:55   ` Thomas A. Schmitz
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Schuster @ 2010-02-07 22:16 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 07.02.10 22:58, schrieb Thomas A. Schmitz:
> Hi experts,
>
> I'm thinking about a new presentation style and need some general advice from the TeXperts. I would like to have a list of topics on some area of the slide (similar to s-pre-19.tex). However, if at all possible, I would like it to be a bit fancier. Let's say I want the list of topics typeset in gray frames in a black font, but the current topic in a blue frame with a white font. Would this be possible with something like \definelist? Is there any notion of "currentlistitem" or "currentmarking" in such lists? Or, even better: would it be possible to have access to the single members of a list and maybe compare them to a current value and then typeset them accordingly? Something like this pseudocode:
>
> for member in topiclist do
>    if member == currentvalue
>       <some fancy framing and metapost stuff with member>
>    else
>       <less fancy but still nice-looking metapost stuff>
>    end
> end
>
> Or am I trying to reinvent the wheel here? I would be happy to hear any ideas on that.
>    
you can do something like this (not sure if it works):

\setuplist[...][alternative=command,command=\MyFancyListentry]

\define[3]\MyFancyListentry
   {\doifelse{#2}{\fullstructureheadtitle} % is this the correct value?
      {...}% fancy layout
      {...}% normal layout
    ...}

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

* Re: DIY toc (or similar list)
  2010-02-07 22:16 ` Wolfgang Schuster
@ 2010-02-07 22:55   ` Thomas A. Schmitz
  2010-02-07 23:12     ` Wolfgang Schuster
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas A. Schmitz @ 2010-02-07 22:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users


On Feb 7, 2010, at 11:16 PM, Wolfgang Schuster wrote:

> you can do something like this (not sure if it works):
> 
> \setuplist[...][alternative=command,command=\MyFancyListentry]
> 
> \define[3]\MyFancyListentry
>  {\doifelse{#2}{\fullstructureheadtitle} % is this the correct value?
>     {...}% fancy layout
>     {...}% normal layout
>   ...}
> 
> Wolfgang

Wolfgang, thanks a lot! I could adapt your code so it does what I want! Here's what I have now, I'm sure I can run with that for the presentation stuff. Thanks a lot, and best wishes!

Thomas


\definelist[MyTopics][criterium=all]

\define[3]\FancyEntry
 {\doifelse{#1}{\MyMark} %
    {\color[blue]{#1}}% fancy layout
    {\color[red]{#1}}% normal layout
\par}

\setuplist[MyTopics]
          [style=\tfxx,
           pagenumber=no,
           alternative=command,
           command=\FancyEntry]


\def\Topic#1{%
  \def\MyMark{#1}%
  \writetolist[MyTopics]{#1}{}%
  \completelist[MyTopics]%
}

\starttext

\Topic{First}

Hello 1

\page

\Topic{Second}

Hello 2

\page

\Topic{Third}

Hello 3

\page

\Topic{Fourth}

Hello 4

\stoptext

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

* Re: DIY toc (or similar list)
  2010-02-07 22:55   ` Thomas A. Schmitz
@ 2010-02-07 23:12     ` Wolfgang Schuster
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Schuster @ 2010-02-07 23:12 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 07.02.10 23:55, schrieb Thomas A. Schmitz:
> \def\Topic#1{%
>    \def\MyMark{#1}%
>    \writetolist[MyTopics]{#1}{}%
>    
\writetolist[MyTopics]{}{#1}%

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

end of thread, other threads:[~2010-02-07 23:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-07 21:58 DIY toc (or similar list) Thomas A. Schmitz
2010-02-07 22:16 ` Wolfgang Schuster
2010-02-07 22:55   ` Thomas A. Schmitz
2010-02-07 23:12     ` Wolfgang Schuster

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