ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Harry <irgksjd@gmx.de>
To: ntg-context@ntg.nl
Subject: toc and macro
Date: Wed, 27 May 2015 20:13:08 +0200	[thread overview]
Message-ID: <55660934.8000000@gmx.de> (raw)

Hi,

I hope that this is the right address to post my question. If not I
would be glad for a tip.

I wanted to do something like this:

_______________________

\unprotect

%This line uncommented leads to an error
\def\tit{Oops!}

\def\Teil{\dodoubleempty\doTeil}
\def\doTeil[#1][#2]#3{%
  \def\tit{#1}
%...
  \startchapter[title={\tit},reference={#2}]
    #3
  \stopchapter
%...
}


\protect

\starttext

  \completecontent

  \doTeil[Hallo][hallo]{Text Text Text Text Text Text Text}

\stoptext

_______________________

It works if i use #1 direct (like this):
  \startchapter[title=#1,reference={#2}]
But how can I wrap it in the \tit?
(wrapping #2 works fine)

I wanted to programm \doTeil so, that I can nest it freely (for example
with \input) and the table of content uses the hierarchy of the nesting
to produce a nice TOC.

thanks for help.

Sincerely, Harry
___________________________________________________________________________________
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
___________________________________________________________________________________

             reply	other threads:[~2015-05-27 18:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-27 18:13 Harry [this message]
2015-05-28 10:47 ` Wolfgang Schuster
2015-05-28 21:08   ` Harry
2015-05-29  0:38     ` Wolfgang Schuster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55660934.8000000@gmx.de \
    --to=irgksjd@gmx.de \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).