GeneralSmart References to Figures etc.

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Wramberg
Posts: 1
Joined: Wed Feb 15, 2012 8:43 pm

Smart References to Figures etc.

Post by Wramberg »

Hi, I am having a problem making a smart reference to figures, pictures etc. in Latex. So far I've put this in my preamble:

Code: Select all

\newcommand{\figref}[1]{figur \ref{#1} (s. \pageref{#1})}
\newcommand{\afigref}[1]{figur \ref{#1}}
Now the first line I use when the figure is not on the same page as the reference while the second I use when the figure is. Now the problem is i have to change this manually and as you can imagine that is quite annoying with all the floating graphics ;)

So my question to you is: Is there someway I can make Latex figure out if they are on the same page and choose automatically ?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Smart References to Figures etc.

Post by localghost »

Seems like you searching for something like the cleveref and/or varioref package.


Best regards and welcome to the board
Thorsten
Post Reply