ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Dynamic headings & query heading information
@ 2014-02-07 14:45 Andreas Schneider
  2014-02-07 15:00 ` Wolfgang Schuster
  2014-02-07 17:12 ` Wolfgang Schuster
  0 siblings, 2 replies; 4+ messages in thread
From: Andreas Schneider @ 2014-02-07 14:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/html, Size: 1865 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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: Dynamic headings & query heading information
  2014-02-07 14:45 Dynamic headings & query heading information Andreas Schneider
@ 2014-02-07 15:00 ` Wolfgang Schuster
  2014-02-07 17:12 ` Wolfgang Schuster
  1 sibling, 0 replies; 4+ messages in thread
From: Wolfgang Schuster @ 2014-02-07 15:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1536 bytes --]


Am 07.02.2014 um 15:45 schrieb Andreas Schneider <aksdb@gmx.de>:

> Hello,
> 
> again I'm working on a technical manual and decided to use ConTeXt to do the job. Since I'm a developer, I always try to do things as flexible as possible.
> 
> I'm currently struggling to achieve two things:
> 
> 1) a macro (that will print a list) should also add a heading. However, the heading should always be one level beneath the current heading and without numbering. Example: within a \section it should be a \subsubject, within a \chapter it should be a \subject, and so on.

\definesectionlevels[extra][title,subject,subsubject,subsubsubject]

\setuphead[chapter][color=red]
\setuphead[section][color=green]
\setuphead[subsection][color=blue]

\define\PlaceList
  {\startsectionlevel[extra][title=List]
   %
   \stopsectionlevel}

\starttext

\startsectionlevel[title=Chapter 1]

\PlaceList

\startsectionlevel[title=Section 1.1]

\startsectionlevel[title=Subsection 1.1.1]
\stopsectionlevel

\startsectionlevel[title=Subsection 1.1.2]
\stopsectionlevel

\stopsectionlevel

\startsectionlevel[title=Section 1.2]
\stopsectionlevel

\stopsectionlevel

\startsectionlevel[title=Chapter 2]

\startsectionlevel[title=Section 2.1]

\PlaceList

\startsectionlevel[title=Subsection 2.1.1]
\stopsectionlevel

\startsectionlevel[title=Subsection 2.1.2]
\stopsectionlevel

\stopsectionlevel

\startsectionlevel[title=Section 2.2]
\stopsectionlevel

\stopsectionlevel

\stoptext

Wolfgang


[-- Attachment #1.2: Type: text/html, Size: 2722 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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: Dynamic headings & query heading information
  2014-02-07 14:45 Dynamic headings & query heading information Andreas Schneider
  2014-02-07 15:00 ` Wolfgang Schuster
@ 2014-02-07 17:12 ` Wolfgang Schuster
  2014-02-08  9:25   ` Andreas Schneider
  1 sibling, 1 reply; 4+ messages in thread
From: Wolfgang Schuster @ 2014-02-07 17:12 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1307 bytes --]


Am 07.02.2014 um 15:45 schrieb Andreas Schneider <aksdb@gmx.de>:

> 2) another macro should build an index at the end of the document. I use Lua to keep a list of all database tables referenced within the document (together with some metadata) and save it in the jobpasses struct. Now I also want to track the chapters, sections, etc where these references are, to be able to see, where a database table is used.
> 
> To solve these two problems, I'm looking for information about the current heading. The level and the associated reference name.
> If I have the level, I can keep my own list of necessary heading types (subject, subsubject, ...) and just get the one at level+1 to write the heading using lua (tex.sprint(....)).
> With the reference name I can obviously solve 2), since I then can simply keep a list for each db table in the jobpasses structure.

You can try the \currentstrcuture… commands but I don’t know if the are meant as user level commands.

\starttext

\chapter{Chapter}

\starttabulate
\NC Name  \EQ \currentstructurename  \NC\NR
\NC Level \EQ \currentstructurelevel \NC\NR
\stoptabulate

\section{Section}

\starttabulate
\NC Name  \EQ \currentstructurename  \NC\NR
\NC Level \EQ \currentstructurelevel \NC\NR
\stoptabulate

\stoptext

Wolfgang


[-- Attachment #1.2: Type: text/html, Size: 2133 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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: Dynamic headings & query heading information
  2014-02-07 17:12 ` Wolfgang Schuster
@ 2014-02-08  9:25   ` Andreas Schneider
  0 siblings, 0 replies; 4+ messages in thread
From: Andreas Schneider @ 2014-02-08  9:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/html, Size: 2984 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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:[~2014-02-08  9:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-07 14:45 Dynamic headings & query heading information Andreas Schneider
2014-02-07 15:00 ` Wolfgang Schuster
2014-02-07 17:12 ` Wolfgang Schuster
2014-02-08  9:25   ` Andreas Schneider

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