ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Feature Request: ToC page number alternative
@ 2014-02-26 19:31 Thangalin
  2014-02-26 21:48 ` Wolfgang Schuster
  0 siblings, 1 reply; 2+ messages in thread
From: Thangalin @ 2014-02-26 19:31 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

The predefined alternative list setups (e.g., a, b, c...) provide
various ways to format the ToC with the page number to the right of
the list entry title. An alternative with the page number to the left
of the list entry title would be useful.

For example:

\setupinteraction[state=start,]
\setupcombinedlist[content][interaction=all,]

\unprotect

\define[3]\SectionToCEntry{%
  \hbox \strc_lists_get_reference_attribute\v!all{%
    \par \leftaligned\bgroup
      \hbox to 2em{#3}%
        \hskip 1em
        \vtop{\hsize\dimexpr\textwidth-3em\relax#2}
    \egroup \par%
  }
}

\protect


\setuplist[section][
  alternative=command,
  command=\SectionToCEntry,
]

\starttext
  \placecontent
  \dorecurse{4}{
    \chapter[title={Chapter}]
    \page
    \section[title={Section A}]
    \dorecurse{5}{\input knuth}
    \section[title={Section B}]
    \dorecurse{5}{\input ward}
  }
\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] 2+ messages in thread

* Re: Feature Request: ToC page number alternative
  2014-02-26 19:31 Feature Request: ToC page number alternative Thangalin
@ 2014-02-26 21:48 ` Wolfgang Schuster
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Schuster @ 2014-02-26 21:48 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 26.02.2014 um 20:31 schrieb Thangalin <thangalin@gmail.com>:

> Hi,
> 
> The predefined alternative list setups (e.g., a, b, c...) provide
> various ways to format the ToC with the page number to the right of
> the list entry title. An alternative with the page number to the left
> of the list entry title would be useful.
> 
> \unprotect
> 
> \define[3]\SectionToCEntry{%
>  \hbox \strc_lists_get_reference_attribute\v!all{%
>    \par \leftaligned\bgroup
>      \hbox to 2em{#3}%
>        \hskip 1em
>        \vtop{\hsize\dimexpr\textwidth-3em\relax#2}
>    \egroup \par%
>  }
> }
> 
> \protect
> 
> 
> \setuplist[section][
>  alternative=command,
>  command=\SectionToCEntry,
> ]

When you want a interactive list entry replace “alternative=command” with “alternative=interactive”.

\define[3]\SectionToCEntry
  {\leftaligned\bgroup
     \hbox to 2em{#3}%
     \hskip 1em
     \vtop{\hsize\dimexpr\textwidth-3em\relax#2}%
   \egroup}

\setuplist
  [section]
  [alternative=interactive,
   command=\SectionToCEntry]

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

end of thread, other threads:[~2014-02-26 21:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-26 19:31 Feature Request: ToC page number alternative Thangalin
2014-02-26 21:48 ` 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).