ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Werner Hennrich <wehe@gmx.at>
To: ntg-context@ntg.nl
Subject: \doassign variable - updates not picked up
Date: Fri, 22 Jan 2021 09:48:58 +0100	[thread overview]
Message-ID: <88b0bb87-972e-0664-1e29-71e7b05388a7@gmx.at> (raw)


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

Hello everyone,

I'm using ConTeXt  (ver: 2020.09.20 23:02 LMTX) and have to have
conditional page headers based on specific content criteria. To achive
this I'd like to get some global variables in TeX, change their values
several times throughout the document and have my macro for the header
read them and act accordingly (like skip the header at all, change a
color, etc).

As a basis for this I established the following pattern in an iolated
test case:

    \def\setHeaderVar[#1]{
    \doassign[header][myvar=#1]
    \message{setHEADER: '#1'}
    }
    \def\getHeaderVar{\headermyvar}
    \setupheadertexts[\setups{page:header}]
    \startsetups page:header
    HEADER: myvar=\getHeaderVar
    \stopsetups
    \starttext
    \setHeaderVar[initval]
    page: 1
    \page
    \setHeaderVar[aaaaa]
    page: 2
    \page
    \setHeaderVar[bbbbb]
    page: 3
    \page
    \setHeaderVar[cccc]
    page: 4
    \page
    \setHeaderVar[]
    page: 5
    \stoptext

This works as expected and the header-macro prints the updated value.
But when I put the same pattern in my big environment-file, I can see
the variable being updated with different values (console), but the
header always puts out just the variable's initial value - so the
variable is read but it's updates aren't picked up by the header macro.
Peeking into console, log & tuc didn't raise any idea yet as to what is
going wrong...

Any idea what is happening and how I can fix this?

Any hints on how I can track this down?

Thanks a lot,
Werner Hennrich, Vienna AT



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

[-- Attachment #2: Type: text/plain, Size: 493 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

             reply	other threads:[~2021-01-22  8:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-22  8:48 Werner Hennrich [this message]
2021-01-22 22:46 ` Wolfgang Schuster
2021-01-23 19:03   ` Werner Hennrich

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=88b0bb87-972e-0664-1e29-71e7b05388a7@gmx.at \
    --to=wehe@gmx.at \
    --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).