1

I often find myself writing see Figure~\ref{fig:figname}, below or see Figure~\ref{fig:figname}, above, or similar phrases.

Is there a way to make LaTeX automatically decide between "above" and "below" depending on the location where the figure is rendered?

5
  • varioref package Dec 17, 2014 at 14:37
  • Even simpler: the cleveref package: it will suffice to type see \Cref{fig:figurename} to obtain see Figure above (or below, or nextpage or previous page).
    – Bernard
    Dec 17, 2014 at 16:16
  • @Bernard Are you sure? As far as I recall, cleveref only records the kind of object, but not its location, so \Cref{fig:figurename} will only give Figure #. On the other hand, as David suggested, varioref adds a location-associated string. Dec 18, 2014 at 0:58
  • Chcek out tex.stackexchange.com/questions/187105/… I am really proud of this one! Dec 18, 2014 at 1:24
  • @Gonzalo Medina/ I wrote too hastily: actually, cleveref more or less cooperates with varioref and is customisable enough to allow defining personal formatting of cross references so as to obtain both the reference type and its location. I did something like that some years ago (but don't remember the exact context).
    – Bernard
    Dec 18, 2014 at 1:37

0

Browse other questions tagged .