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

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

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