ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Benjamin Buchmuller <benjamin.buchmuller@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Getting the local float reference within a float and reuse (?) it later (\somelocalfloat?)
Date: Thu, 22 Jul 2021 10:38:46 +0200	[thread overview]
Message-ID: <4A358FA5-9A1F-48A5-AEDF-F90DC2786F66@gmail.com> (raw)

Hi, 

Is there a more convenient way to get the current reference label (stably) from within a float? For example, I would like to make an "image credits" section at the end of a document, so I do something similar to:

\defineblock[credits]

\starttext

\section[sec:topic]{Topic}

\startplacefigure
	[
	title={Awesome figure. Image credits in \about[sec:credits].},
	reference=fig:awesome,
	]

\begincredits
\in{Figure}[fig:awesome] in \in{Section}[sec:topic] was not created by me.
\endcredits
\stopplacefigure

\section[sec:credits]{Appendix}

\useblocks[credits]

\stoptext

The block mechanism comes in really handy here, especially since I have more to show at the end than just the credits. However, each time I add another figure, I have to replace the references appropriately. So, I was wondering how about exploiting some pointers:

\begincredits
\somelocalfloat[figure][current] in Section \someheadnumber[section][current] was not created by me.
\endcredits
\processblocks[credits] % expected \someheadnumber to evaluate to 1?
\stopplacefigure

Yet, even if asked to be processed within the first section, \someheadnumber evaluates at the end to "2" (should be "1" in my opinion)? This is independent of calling it from within the float or the main text. I guess, my understanding of "processblocks" is wrong in this respect.

% \begincredits
% This is the call from the text \someheadnumber[section][current]
% \endcredits
%
% \processblocks[credits]

Further, \somelocalfloat doesn't show anything. What does it do?

Two probably not really urgent questions as I can live with putting the explicit names, but maybe there is an even better approach that comes in handy in more circumstances.

Thanks in advance!


Benjamin
___________________________________________________________________________________
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-07-22  8:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4A358FA5-9A1F-48A5-AEDF-F90DC2786F66@gmail.com \
    --to=benjamin.buchmuller@gmail.com \
    --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).