From: Hans Hagen <pragma@wxs.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Expansion of date inside \section
Date: Sun, 19 Jun 2016 23:51:39 +0200 [thread overview]
Message-ID: <4ea7ef3d-a17e-4e5c-c40e-38490eff4a78@wxs.nl> (raw)
In-Reply-To: <CALBOmsazBsSXB7PUo3pzpPEDVGwb1AS_cQ1SWUNPdGDNXSxarg@mail.gmail.com>
On 6/19/2016 10:17 PM, Mojca Miklavec wrote:
> Hi,
>
> I'm trying to generate daily reports and wanted to include the date in
> bookmarks, but there is some weird (non)expansion going on.
>
> I might just as well switch to lua for certain parts of the document
> (like cycling through dates), but I suspect that there must be some
> trivial hack to prevent me from getting my sections labeled
> date[y={2016},m={06},d={25}]
>
> \setupinteraction
> [state=start]
> \placebookmarks
> [chapter,section,subsection]
> [chapter,section]
> \setupinteractionscreen
> [option=bookmark]
>
> \def\generatesection#1#2#3{%
> \edef\dt{\date[y={#1},m={#2},d={#3}][year,-,mm,-,dd]}
> \setupheadertexts[{\dt}][pagenumber]
> \section{\dt}
> % \externalfigure[#1#2#3.pdf]
> }
>
> \starttext
> \chapter{Daily files}
> \generatesection{2016}{06}{25}
> \generatesection{2016}{06}{26}
> \stoptext
first of all, did you try
\startsection[title=foo,bookmark=bar]
to separate between typeset text and bookmark (bookmark then can be
#1-#2-#3)
another possibility is
\enabledirectives[references.bookmarks.preroll]
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________
next prev parent reply other threads:[~2016-06-19 21:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-19 20:17 Mojca Miklavec
2016-06-19 20:38 ` Mojca Miklavec
2016-06-19 21:37 ` Thomas A. Schmitz
2016-06-19 21:51 ` Hans Hagen [this message]
2016-06-20 5:34 ` Pablo Rodriguez
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=4ea7ef3d-a17e-4e5c-c40e-38490eff4a78@wxs.nl \
--to=pragma@wxs.nl \
--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).