ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* An Index problem (repost II)
@ 2007-03-06  8:58 luigi scarso
  2007-03-06  9:57 ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: luigi scarso @ 2007-03-06  8:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users

I have the following
\starttext
%%\placemaincontent
\chapter{AAA}
\section{Hause one} Foo one \page
\section{Hause two} Foo  two \page
\section{Hause three} Foo  three \page
\section{Hause four} Foo  four\page
\section{Dog boo} Koo   \page
\section{Dog foo} Boo \page
\section{Money ba} Boo \page
\section{Mail bee} Ugh \page
\stoptext
In main content I should like to have
\bf{AAA} %% no problem here
\bf{HAUSE} one ..... page x
 Hause two ..............page x
 Hause three............page x
 Hause four ..............page x
\bf{DOG} boo ...........page x
 Dog foo.....................page x
\bf{MONEY} ba.........page x
\bf{MAIL} bee.............page x

ie, the very first word in bold face and upper case,
the following in normal face if and only of the very first word was
equal to the first
word of actual item (I know, it's strange).

Many thanks in advance
luigi

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: An Index problem (repost II)
  2007-03-06  8:58 An Index problem (repost II) luigi scarso
@ 2007-03-06  9:57 ` Hans Hagen
  2007-03-06 12:51   ` luigi scarso
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen @ 2007-03-06  9:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users

luigi scarso wrote:
> I have the following
> \starttext
> %%\placemaincontent
> \chapter{AAA}
> \section{Hause one} Foo one \page
> \section{Hause two} Foo  two \page
> \section{Hause three} Foo  three \page
> \section{Hause four} Foo  four\page
> \section{Dog boo} Koo   \page
> \section{Dog foo} Boo \page
> \section{Money ba} Boo \page
> \section{Mail bee} Ugh \page
> \stoptext
> In main content I should like to have
> \bf{AAA} %% no problem here
> \bf{HAUSE} one ..... page x
>  Hause two ..............page x
>  Hause three............page x
>  Hause four ..............page x
> \bf{DOG} boo ...........page x
>  Dog foo.....................page x
> \bf{MONEY} ba.........page x
> \bf{MAIL} bee.............page x
>
> ie, the very first word in bold face and upper case,
> the following in normal face if and only of the very first word was
> equal to the first
> word of actual item (I know, it's strange).
>   
\let\LastSectionEntry\empty

\def\ChapterEntry#1%
  {\global\let\LastSectionEntry\empty
   #1}

\def\SectionEntry#1%
  {\splitstring#1\at{ }\to\PartA\and\PartB
   \doifelse\PartA\LastSectionEntry
     {#1}
     {\global\let\LastSectionEntry\PartA
      {\bf\PartA} \PartB}}

\setuplist[chapter][style=bold,textcommand=\ChapterEntry]
\setuplist[section][textcommand=\SectionEntry]

\starttext
\placelist[chapter,section]
\chapter{AAA}
\section{Hause one} Foo one \page
\section{Hause two} Foo  two \page
\section{Hause three} Foo  three \page
\section{Hause four} Foo  four\page
\section{Dog boo} Koo   \page
\section{Dog foo} Boo \page
\section{Money ba} Boo \page
\section{Mail bee} Ugh \page
\chapter{BBB}
\section{Mail bee} Ugh \page
\section{Mail bee} Ugh \page
\section{Mail bee} Ugh \page
\stoptext



-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: An Index problem (repost II)
  2007-03-06  9:57 ` Hans Hagen
@ 2007-03-06 12:51   ` luigi scarso
  0 siblings, 0 replies; 3+ messages in thread
From: luigi scarso @ 2007-03-06 12:51 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 3/6/07, Hans Hagen <pragma@wxs.nl> wrote:
> luigi scarso wrote:
> > I have the following
> > \starttext
> > %%\placemaincontent
> > \chapter{AAA}
> > \section{Hause one} Foo one \page
> > \section{Hause two} Foo  two \page
> > \section{Hause three} Foo  three \page
> > \section{Hause four} Foo  four\page
> > \section{Dog boo} Koo   \page
> > \section{Dog foo} Boo \page
> > \section{Money ba} Boo \page
> > \section{Mail bee} Ugh \page
> > \stoptext
> > In main content I should like to have
> > \bf{AAA} %% no problem here
> > \bf{HAUSE} one ..... page x
> >  Hause two ..............page x
> >  Hause three............page x
> >  Hause four ..............page x
> > \bf{DOG} boo ...........page x
> >  Dog foo.....................page x
> > \bf{MONEY} ba.........page x
> > \bf{MAIL} bee.............page x
> >
> > ie, the very first word in bold face and upper case,
> > the following in normal face if and only of the very first word was
> > equal to the first
> > word of actual item (I know, it's strange).
> >
> \let\LastSectionEntry\empty
>
> \def\ChapterEntry#1%
>   {\global\let\LastSectionEntry\empty
>    #1}
>
> \def\SectionEntry#1%
>   {\splitstring#1\at{ }\to\PartA\and\PartB
>    \doifelse\PartA\LastSectionEntry
>      {#1}
>      {\global\let\LastSectionEntry\PartA
>       {\bf\PartA} \PartB}}
>
> \setuplist[chapter][style=bold,textcommand=\ChapterEntry]
> \setuplist[section][textcommand=\SectionEntry]
>
> \starttext
> \placelist[chapter,section]
> \chapter{AAA}
> \section{Hause one} Foo one \page
> \section{Hause two} Foo  two \page
> \section{Hause three} Foo  three \page
> \section{Hause four} Foo  four\page
> \section{Dog boo} Koo   \page
> \section{Dog foo} Boo \page
> \section{Money ba} Boo \page
> \section{Mail bee} Ugh \page
> \chapter{BBB}
> \section{Mail bee} Ugh \page
> \section{Mail bee} Ugh \page
> \section{Mail bee} Ugh \page
> \stoptext

yes, it is.
Many thanks Hans.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-03-06 12:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-06  8:58 An Index problem (repost II) luigi scarso
2007-03-06  9:57 ` Hans Hagen
2007-03-06 12:51   ` luigi scarso

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