Graphics, Figures & Tablessubfigure remove captions

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
CoolnessItself
Posts: 47
Joined: Wed Nov 11, 2009 9:30 pm

subfigure remove captions

Post by CoolnessItself »

I think I'm using a subfigure. I say I think because I have something like

\begin{figure}[ht]
\centering
\subfigure[]{
\includegraphics[scale=.5]{pic1.png}
}
\subfigure[]{
\includegraphics[scale=.5]{pic2.png}
}
\label{fig:subfigureExample}
\caption{wowzers}
\end{figure}

But if I \usepackage{subfigure}, I get errors due to package conflicts (says subfigure is already defined, while declaring nothing at all results in \subfigure not working). So for now I'm using the above code with \usepackage{subfig}, which runs.

So whatever package I'm using, I'd like to get rid of the (a) and (b) below each image. I tried \renewcommand\thesubfigure{} but that didn't change anything.

Suggestions?

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
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

subfigure remove captions

Post by gmedina »

CoolnessItself wrote:...Suggestions?
At least two:

a) Using \captionsetup from the caption package:

Code: Select all

\documentclass{article}
\usepackage{graphicx}
\usepackage{subfig}
\usepackage{caption}

\begin{document}

\begin{figure}[!ht]
  \captionsetup[subfigure]{labelformat=empty}
  \centering
  \subfloat[]{\rule{3cm}{2cm}}\quad
  \subfloat[]{\rule{3cm}{2cm}}
  \caption{wowzers}
  \label{fig:subfigureExample}
\end{figure}

\end{document}
b) Using minipage environments (with this approach there's no need for the subfig package):

Code: Select all

\documentclass{article}
\usepackage{graphicx}

\begin{document}

\begin{figure}[!ht]
  \centering
  \begin{minipage}{.45\textwidth}
    \centering
    \rule{3cm}{2cm}
  \end{minipage}
  \begin{minipage}{.45\textwidth}
    \centering
    \rule{3cm}{2cm}
  \end{minipage}
  \caption{wowzers}
  \label{fig:subfigureExample}
\end{figure}

\end{document}
Remarks: 1) I used \rule commands in my examples to simulate actual images making the examples compilable for everyone. Please, in your actual code use the standard \includegraphics comand instead.
2) Inside floating environments (table, figure, etc.) the \label command must always be used after the \caption command.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply