ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Pawel Urbanski via ntg-context <ntg-context@ntg.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Pawel Urbanski <urbanski.pawel@gmail.com>
Subject: Re: Use section custom value in a header text.
Date: Tue, 20 Dec 2022 20:31:23 +0100	[thread overview]
Message-ID: <CADUDiDFLAOO0EHkfd7RqHDmwYPJgi6YRmtBRCBHuiJA9Yq6RbA@mail.gmail.com> (raw)
In-Reply-To: <d70b5573-783d-c9b2-8efe-c1c0cdaefe4d@fiee.net>


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

Hi,
Let me clarify my question more...
I need to attach some value to a chapter in that key. That custom prefix +
the value in the key is ment to be in the header or a footer as a matter of
fact. The case can apply to both headers and footers.
I tried:
\chapter[title={A sample title}][custom_random={custom_value}]
\setupheadertexts[{Prefix: \structureuservariable{custom_random}}]
...
\stopchapter
I tried this code when trying to figure out the mechanism. The prefix
string in placed in the header, but hte custom value of the attached key is
not expanded..
Evey page will contain just one section started by a \startchapter and
\stop chapter. I would like to put this custom attached value in the right
slot in the document header.

I hope that htis time around htigs are more clear.

On Tue, Dec 20, 2022 at 8:13 PM Henning Hraban Ramm via ntg-context <
ntg-context@ntg.nl> wrote:

> Am 20.12.22 um 19:44 schrieb Pawel Urbanski via ntg-context:
> > Dear Friends,
> > I spent some time searching and coding simple documents, but failed and
> > therefore I'm asking for help...
> > A section such as chapter cn have custom keys with values. One uses the:
> > \structureuservariable command to access such values.
> > How can I use such a value to create a custom header in a format:
> > Prefix: \structureuservariable{foo}
> >
> > I am asking for the only thing that worked when I tried was calling the:
> > \setupheadertexts command inside a chapter environment block with some
> > prefix. Unfortunately the value from the custom field was not expanded.
> > It was correctly inserted in a regular paragraph.
> > For example:
> > \startchapter
> > [title={A sample title}][custom_something={random_value}]
> > ...
> > \stopchapter
> >
> > How can I put the value of: custom_something in the header with some
> prefix?
>
> \define[2]\MyChapter{No.#1 – Prefix
> \structureuservariable{custom_something}: #2}
>
> \setuphead[chapter][
>   command=\MyChapter,
> ]
>
> Is this what you meant?
>
> Hraban
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : https://contextgarden.net
>
> ___________________________________________________________________________________
>

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

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

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2022-12-20 19:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-20 18:44 Pawel Urbanski via ntg-context
2022-12-20 19:12 ` Henning Hraban Ramm via ntg-context
2022-12-20 19:31   ` Pawel Urbanski via ntg-context [this message]
2022-12-20 19:34     ` Henning Hraban Ramm via ntg-context
2022-12-20 20:48     ` Rik Kabel via ntg-context
2022-12-22  0:04       ` Pawel Urbanski via ntg-context

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=CADUDiDFLAOO0EHkfd7RqHDmwYPJgi6YRmtBRCBHuiJA9Yq6RbA@mail.gmail.com \
    --to=ntg-context@ntg.nl \
    --cc=urbanski.pawel@gmail.com \
    /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).