Graphics, Figures & TablesCaption positioning

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
kaosad
Posts: 2
Joined: Fri Aug 14, 2009 5:22 am

Caption positioning

Post by kaosad »

Hi,

I am trying to place my caption on the side of my figure using minipages (two minipages placed side-by-side.) I know that I can do with Sidecap package, but it came out quite awful that I decided not to use it.

I am using Caption package. I try to place the caption on the right of my figure. My problem is that the caption is centered on the minipage. So I turn off the 'singlelinecheck', but now the caption is flushed to the left most of the page and out of the minipage that suppose to contain it!

Below is a snippet of my latex code. Can anyone help?

Code: Select all

\usepackage[singlelinecheck=false,
font=small,format=plain,labelfont=bf,up,
textfont=it,up]{caption}

\begin{figure}[h]
\hspace{\stretch{4}}
\fbox{
\begin{minipage}[b]{.17\textwidth}
\includegraphics[scale=3.45]{myFigure}
\par\vspace{0pt}
\end{minipage}%
}
\fbox{
\begin{minipage}[b]{.34\textwidth}
\caption{}
\par\vspace{-13pt}
\end{minipage}%
}
\hspace{\stretch{1}}
\end{figure}

Recommended reading 2024:

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

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

benti
Posts: 42
Joined: Fri Mar 06, 2009 4:51 pm

Caption positioning

Post by benti »

Does this solve the problem? Found this solution on TUG a while ago, and it solved my quest back then.

Code: Select all

\begin{figure}
	\parbox[b]{.48\linewidth}{
		\includegraphics[width=\linewidth]{file.eps}}\hfill
	\parbox[b]{.48\linewidth}{
		\caption{this caption appears to the right of the figure.}
		\label{fig1}
	}
\end{figure}
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Caption positioning

Post by sommerfee »

This looks ok here, using the caption package v3.1j. (Which version do you use?)

Code: Select all

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage[singlelinecheck=false,
font=small,format=plain,labelfont=bf,up,
textfont=it,up]{caption}

\begin{document}
\begin{figure}[h]
\hspace{\stretch{4}}
\fbox{
\begin{minipage}[b]{.17\textwidth}
\includegraphics[width=\textwidth]{myFigure}
\par\vspace{0pt}
\end{minipage}%
}
\fbox{
\begin{minipage}[b]{.34\textwidth}
\caption{}
\par\vspace{-13pt}
\end{minipage}%
}
\hspace{\stretch{1}}
\end{figure}
\end{document}
So please build a complete example showing the error, so I can examine the problem.
Post Reply