Graphics, Figures & Tablesintroduce an exception on the package

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
emcallen
Posts: 4
Joined: Sat May 09, 2009 7:30 pm

introduce an exception on the package

Post by emcallen »

Hi,

I'm using the following package for the position of my figures and tables : \usepackage[small,bf,nooneline,hang]{caption}.
It works very well, but i would like to introduce one exception: i would like to position just one figure with his caption in the center. I tried only "\center", but this isn't working. Do you have an idea how to introduce this exception?

Thank you already.

Evelien

Recommended reading 2024:

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

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

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

introduce an exception on the package

Post by localghost »

Using the caption package is a good choice. It provides commands to change the setup of floats locally. Consider the following example.

Code: Select all

\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{babel}
\usepackage[margin=1cm]{geometry}
\usepackage[font=small,label=bf,singlelinecheck=off,format=hang]{caption}
\usepackage{blindtext}

\setlength{\parindent}{0em}

\begin{document}
  \blindtext

  \begin{figure}[!ht]
    \rule{6.4cm}{3.6cm}
    \caption{A dummy figure}\label{fig:dummy-1}
  \end{figure}

  \blindtext

  \begin{figure}[!ht]
    \captionsetup{singlelinecheck=on}
    \centering
    \rule{6.4cm}{3.6cm}
    \caption{A dummy figure}\label{fig:dummy-2}
  \end{figure}

  \blindtext

  \begin{figure}[!ht]
    \rule{6.4cm}{3.6cm}
    \caption{A dummy figure}\label{fig:dummy-3}
  \end{figure}

  \blindtext
\end{document}
Note the way of passing options to the current version of the package. The second figure is simply centered by a switch and its caption by the local change to the caption setup.


Best regards
Thorsten
Post Reply