Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want to stop my figures floating, but I still want to be able to have the caption to the side of them; mainly to save space and for presentation.

The only way I know how to get the figure caption to the side of an image is as follows;

\begin{SCfigure}
  \centering
  \includegraphics[width=80mm]{image.png}
  \caption{This text is added at the side of the image as a figure description.}
\end{SCfigure}

But, these always float which as it turns out isn't saving space and it just looks messy, so I want this sort of layout for my figures, but I want to fix their position.

Is there anyway to do this?

Thank you.

share|improve this question
add comment

3 Answers

up vote 7 down vote accepted

Obviously, place a figure where I placed the table, and note that in the \captionof argument.

\documentclass{article}
\usepackage{caption}
\begin{document}
\begin{minipage}{\textwidth}
\centering
\begin{tabular}{|l|l|}
\hline
     hello & world\\
     hello & world\\
     hello & world\\
     hello & world\\
\hline
\end{tabular}\hspace{1em}
\parbox[c]{2in}{\captionof{table}{my table has this somewhat long caption}}
\end{minipage}
\end{document}

enter image description here

For figures, a \raisebox may be necessary for vertical positioning:

\documentclass{article}
\usepackage{caption}
\usepackage[demo]{graphicx}
\begin{document}
\begin{minipage}{\textwidth}
\centering
\raisebox{-.8in}{\includegraphics[width=2in,height=2in]{figure}}
\hspace{1em}
\parbox[c]{2in}{\captionof{figure}{my table has this somewhat long caption}}
\end{minipage}
\end{document}

enter image description here

share|improve this answer
2  
ah I think I'll delete mine, you seem to have covered most of it. –  David Carlisle Feb 25 at 13:40
    
Thank you so much, Steven. –  user46840 Feb 25 at 13:49
add comment

To stop figures from floating outside the section, I recommend using the placeins package.

To put the caption to the side of the picture, use minipage inside \begin{figure} and \end{figure}. For example:

\usepackage[section,subsection,subsubsection]{placeins}
%...
%...
\FloatBarrier
    \begin{figure}[htbp!]
        \begin{center}
            \begin{minipage}[c]{.45\linewidth}
            \centering
            \caption{The caption of the picture on the right side}
            \label{fig:pictureonright}
            \end{minipage}%
            \begin{minipage}[c]{.45\linewidth}
            \centering
            \includegraphics[width=6cm]{figs/youpicture}
            \end{minipage}
        \end{center}
    \end{figure}

Hope it works for you!

PS: If you want to read more on working with graphics in LaTeX and PdfLaTeX, here is a recommended source: http://tug.ctan.org/tex-archive/info/epslatex/english/epslatex.pdf

share|improve this answer
    
Welcome to TeX.SX! A tip: You can use backticks ` to mark your inline code as I did in my edit. –  Adam Liter Feb 25 at 15:13
    
Thank you so much, @AdamLiter. This tip works great and the links are very useful to me. –  thanh.h.le Apr 24 at 3:35
add comment

You can use the floatand floatrow package: the first defines a H option for the placement that enforces the float placement "here" ([!h] meaning "here, as much as possible). With the second, you can define caption settings.

So, if you want all your figures to have a sideways caption (and not other floats), you could write in your preamble, if you want your caption to be, say, on the left side, at the top of the figure, something like:

\usepackage{float}
\usepackage{floatrow}
\floatsetup[figure]{capposition=beside, capbesideposition={left,top}}

In the document body, just write:

\begin{figure}[H]
  \centering
  \includegraphics[width=80mm]{image.png}
  \caption{This text is added at the side of the image as a figure description.}
\end{figure}

If you want sideways captions only for some floats, don't write \floatsetup… in the preamble, and write:

\thisfloatsetup{capposition=beside, capbesideposition={left,top}}
\begin{figure}[H]
   .............

Of course you have access to may other settings (fonts, width of cation, &c.)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.