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 would like to have the caption of the Figure on the side of the figure. Plus I want to control caption width. Also, caption and Figure should be aligned all the way to the left and right of the page, respectively. Some information is provided here. I am not able to align the way I want even after a lot of attempts. Here is what I have so far.

\documentclass[12 pt]{article}
\usepackage{fullpage}
\usepackage[demo]{graphicx}
\usepackage{floatrow}

\begin{document}
\begin{figure}
\floatbox[{\capbeside\thisfloatsetup{capbesideposition= {left,center},capbesidewidth=4cm}}]{figure}[\FBwidth]
{\caption{Figure caption}\label{fig:test}}
{\includegraphics[width=5cm]{name}}
\end{figure}
\end{document}
share|improve this question

1 Answer 1

up vote 7 down vote accepted

Here's one possibility (the geometry package with its showframe option was only used to display a frame as a visual guide):

\documentclass[12 pt]{article}
\usepackage[showframe]{geometry}
\usepackage[demo]{graphicx}
\usepackage[singlelinecheck=off]{caption}
\usepackage{floatrow}
\usepackage{lipsum}

\newlength\Myfigwd

\begin{document}

\begin{figure}
\setlength\Myfigwd{5cm}
\floatbox[{\capbeside
\thisfloatsetup{capbesidesep=quad,
justification=justified,
capbesideposition= {left,center},
capbesidewidth=\dimexpr\linewidth-\Myfigwd-1em\relax}}]
{figure}[\FBwidth]
{\caption{Figure caption}\label{fig:test}}
{\includegraphics[width=\Myfigwd]{name}}
\end{figure}
\begin{figure}
\setlength\Myfigwd{7cm}
\floatbox[{\capbeside
\thisfloatsetup{capbesidesep=quad,
justification=justified,
capbesideposition= {left,center},
capbesidewidth=\dimexpr\linewidth-\Myfigwd-1em\relax}}]
{figure}[\FBwidth]
{\caption{\protect\lipsum[2]}\label{fig:test}}
{\includegraphics[width=\Myfigwd]{name}}
\end{figure}

\end{document}

enter image description here

share|improve this answer

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.