[texhax] referencing figures, prepend word "Fig"

Donald Arseneau asnd at triumf.ca
Wed Apr 9 03:19:38 CEST 2008


Andy Farnell <padawan12 at obiwannabe.co.uk> writes:

> or \ref{tab:atable} and so forth.
> 
> Now, I want to automatically prepend the word "Fig" or "Table" to each
> reference depending on the three characters that appear before the colon.

You got an answer to this question, but did you know that
LaTeX already knows if it is a figure or table, regardless 
of the tag?   Just use that:

\makeatletter
\def\p at figure{Fig~}
\def\p at table{Table~}
\makeatother


-- 
Donald Arseneau                          asnd at triumf.ca


More information about the texhax mailing list