ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Getting the local float reference within a float and reuse (?) it later (\somelocalfloat?)
@ 2021-07-22  8:38 Benjamin Buchmuller
  0 siblings, 0 replies; only message in thread
From: Benjamin Buchmuller @ 2021-07-22  8:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-22  8:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-22  8:38 Getting the local float reference within a float and reuse (?) it later (\somelocalfloat?) Benjamin Buchmuller

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).