Graphics, Figures & Tables\c@subfigure already defined

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Hermano
Posts: 14
Joined: Wed Apr 06, 2011 9:10 pm

\c@subfigure already defined

Post by Hermano »

Hi,

I want to create a subfigure in Latex but I get the following error message for the very first time: command \c@subfigure already defined, or name \end illegal.

This is the code for my figure:

Code: Select all

\begin{figure}[h!]
\begin{center}
\input{/image/synchr_vs_asynchr.tex}
\subfigure[Total]{\label{fig:total_error}\includegraphics[trim=0cm 0.6cm 0cm 0cm, clip=true]{synchr_vs_asynchr.eps}}
\input{/image/synchr_error_motion.tex}
\subfigure[Synchronous]{\label{fig:synch_error}\includegraphics[trim=0.5cm 1cm 0cm 0cm, clip=true]{synchr_error_motion.eps}}
\end{center}
\caption{\label{fig:synchr vs asynchr} My figure.}
\end{figure}
This is my preamble:

Code: Select all

\usepackage[english,dutch]{babel}
\usepackage{nomencl}   % For nomenclature
\usepackage[style=long,number=none]{glossary} % For list of abbreviations
\usepackage{hanging}
\usepackage{titlesec}
\usepackage[bottom]{footmisc} %footnote at bottom of page
\usepackage{graphicx,psfrag,color}
\usepackage{subfigure}

%set title spacing
\titlespacing*\section{0pt}{12pt plus 4pt minus 2pt}{2pt plus 2pt minus 2pt}
\titlespacing*\subsection{0pt}{12pt plus 4pt minus 2pt}{2pt plus 2pt minus 2pt}

%set spacing for the table of contents
\usepackage{tocloft}
\renewcommand\cftchapafterpnum{\vskip-12pt}
\renewcommand\cftsecafterpnum{\vskip-12pt}
\renewcommand\cftsubsecafterpnum{\vskip-12pt}

%define new title (bold)
\makeatletter
\newcommand\mycustomhead{%
  \@startsection{section}{1}{\z@}%
  {-2.5ex \@plus -1ex \@minus -.2ex}%
  {3pt \@plus.2ex}%
  {\normalfont\normalsize\bfseries}}
\newcommand\myhead[1]{\mycustomhead*{#1}}
\makeatother
Last edited by cgnieder on Mon May 20, 2013 11:45 am, edited 1 time in total.

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
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

\c@subfigure already defined

Post by sommerfee »

Hermano wrote:\usepackage{tocloft}
From the tocloft package documentation:
subfigure; This option is required if, and only if, the tocloft and subfigure packages are being used together. The two packages can be specified in any order.
So you need to load the locloft package with

Code: Select all

\usepackage[subfigure]{tocloft}
Post Reply