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
Graphics, Figures & Tables ⇒ introduce an exception on the package
NEW: TikZ book now 40% off at Amazon.com for a short time.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
introduce an exception on the package
Using the caption package is a good choice. It provides commands to change the setup of floats locally. Consider the following example.
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
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}
Best regards
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10