Generalfigref: undefined control sequence

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Monkey D
Posts: 22
Joined: Thu Nov 01, 2007 6:12 pm

figref: undefined control sequence

Post by Monkey D »

I don't know what's the problem. I have other documents where I use \figref and they work fine (I'm assuming figref is a standard command).

I'm using kile (KDE latex editor) and this is the output I get:
Undefined control sequence. ...some text \figref

Code: Select all

\documentclass[a4paper,11pt]{article}
....
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\usepackage{caption}
\usepackage{fontenc}
\usepackage[pdftex]{graphicx}
\usepackage{xcolor}

\usepackage[dvips,pdftex]{hyperref}

Code: Select all

\figref{fig:scene_structure}

\begin{figure}
\begin{center}
\includegraphics[scale=0.27]{../presentation/figures/scene.png}
\caption{Scene Structure.%
\label{fig:scene_structure}}
\end{center}
\end{figure}
Thanks!

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

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

figref: undefined control sequence

Post by localghost »

Monkey D wrote:[...] I have other documents where I use \figref and they work fine (I'm assuming figref is a standard command). [...]
Your assumption is wrong. Probably the other sources contain a declaration of the \figref command in the preamble. You now have two possible solutions.
  • Use the standard \ref command to reference your figures
  • Declare a new command in the preamble

    Code: Select all

    \newcommand{\figref}[1]{\figurename~\ref{#1}}
The new command only needs the label of the figure to be referenced and has "Figure 1" as output in dependence of what the command \figurename stands for. Similar commands could be declared for tables and chapters.


Best regards
Thorsten¹
Monkey D
Posts: 22
Joined: Thu Nov 01, 2007 6:12 pm

Re: figref: undefined control sequence

Post by Monkey D »

Thank you very much for the clarification. :)
Post Reply