Referring figures in a document

4 views
Skip to first unread message

Karthikeyan Nainar

unread,
Apr 27, 2010, 10:20:31 AM4/27/10
to latex...@googlegroups.com
Hi all,
I come across this command in latex users group forum and I found it worth sharing. If you want to refer a figure in your document, normally you use for example

" As shown in Fig. \ref{label}, sag has occurred at 0.025 secs."

Instead if you simply include the following command

\newcommand{\figref}[1]{Fig.~\ref{#1}}

as a preamble i.e., before the \begin{document} statement, it is sufficient  if you type

" As shown in \figref{label}, sag has occurred at 0.025 secs"

In this way you can simply refer a figure by \figref command. You can also change the command to suit your needs, for example if you want " Figure 1" replace "Fig." in "\newcommand" statement with "Figure" and throughout your document you can simply refer your figure with \figref statement to get desired reference format.

Hope this will simply your typing a little bit.

--
Share what you know and crave what you want to know
Reply all
Reply to author
Forward
0 new messages