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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

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