ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] Placement of floats with an "anchor"
@ 2024-09-03 16:04 Gerion Entrup
  0 siblings, 0 replies; only message in thread
From: Gerion Entrup @ 2024-09-03 16:04 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hi,

in my document, I recently left a TODO note that said:
"This floating graphic needs to be on the same page than this formula at the end."

My floating graphic currently uses:
\startplacefigure[title={bla}, location=top, reference=fig:bla]
	...
\stopplacefigure

The graphic should be at the top of the page where the formulas are typeset at the end.
Normally, I would do that manually, when all other text is finished.

Can I somehow automate this in ConTeXt? So defining a (non visible) "anchor" at a random place within the normal text and then tell ConTeXt to place the float at the same page (if possible)?

Here is a minimal example to play around (the float is placed on page 1, while the "anchor" is on page 2).

```
\starttext

\input{knuth}
\input{knuth}
\input{knuth}
% anchorto is made up to demonstrate the problem
\startplacefigure[title={A figure explaining the formula.}, location=top, reference=some, anchorto={eq:important}]
	\startalign[center]
		\style[sans]{This is a figure that explains the formula.}
	\stopalign
\stopplacefigure

It is explained with these equations (see also figure \in[some]):
\startformula[reference=eq:important]
	\startalign
		\NC a \NC = b \NR
		\NC a \NC = b \NR
		\NC a \NC = b \NR
		\NC a \NC = b \NR
		\NC a \NC = b \NR
		\NC a \NC = b \NR
		\NC a \NC = b \NR
		\NC a \NC = b \NR
		\NC a \NC = b \NR
	\stopalign
\stopformula
\input{knuth}
\input{knuth}
\input{ward}

\stoptext
```

Best
Gerion

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

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

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

only message in thread, other threads:[~2024-09-03 16:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-03 16:04 [NTG-context] Placement of floats with an "anchor" Gerion Entrup

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