TransWikia.com

Insert figure automatically at first ref (not at declaration)

TeX - LaTeX Asked by Sassi on January 22, 2021

I have inherited a long document with a high density of figures. As I am going through the editing process, I noticed that it is prone to producing errors with respect to the position and sequence of figures.

For example: if I move a paragraph including ref{fig:...} within a chapter, I have to make sure the declaration is now still in the appropriate place. It may be

  1. directly in the paragraph -> fine
  2. somewhere far above still -> fine
  3. now below the moved paragraph -> figures no longer in sequence of reference and not placed near first reference.

Case 3 is what I want to avoid. Is there a package that achieves this?

I imagine this might work as a NEWref command which checks if a figure with the given label has already been defined.
If not, it calls the appropriate begin{fig....} from elsewhere in the same or a dedicated document and also sets the ref{fig:...}.
If yes, only ref{fig...} is inserted.

I would be really grateful for any help!

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP