# Caption at the side of the PDF figure in landscape orientation

The PDF document page I need to include in my document is in landscape orientation. How do I get the resulting output page in the PDF file on one hand shown in landscape orientation with the rotated PDF image for better visibility and on the other hand with the caption on the left side of the page and not at the bottom as my document has to be printed out in portrait orientation? Also it should remain on Page 1 and not go to the next page.

As I have a PDF figure so I tried it out with \usepackage{pdflscape}:

\documentclass{article}
\usepackage{graphicx}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyfoot[C]{Footer}
\fancyfoot[R]{\thepage}
\usepackage{kantlipsum}
\usepackage{afterpage}
\usepackage{pdflscape}

\begin{document}

\kant[1]
\afterpage{
\clearpage
\section{New Section}
\begin{landscape}
\begin{figure}[htb]
\centering
\rotatebox[origin=c]{-90}{
\begin{minipage}{.5\linewidth}
\caption{Figure caption is coming here and it will be by the side of the figure}
\end{minipage}%
}
\end{figure}
\end{landscape}
}
\kant
\end{document}


but the \usepackage{pdflscape} brings it to a new page and the caption is at the bottom.

This is the result I would like to have:

Do I have too many wishes?

I am thankful for any feedback in advance.

• I added the code from your 'answer' to the other question. That will probably be removed from public view soon, so the link wont be of much help to most people (only those with more than 10k rep will be able to see it). Oct 11, 2013 at 9:18
• Does the package hvfloat help? Oct 11, 2013 at 11:28
• i know this is possible (i've done it), but haven't time to experiment just now. but a clarification -- you say the caption should be at the left of the page, which implies that the bottom of the graphic is at the left. this seems wrong-minded to me, unless the document is in a right-to-left language. all landscape figures in a document should face in the same direction, so the reader doesn't have to keep turning it back and forth. Oct 11, 2013 at 14:37
• @MarcoDaniel yes, I tried the hvfloat out - it does not help. Oct 14, 2013 at 7:55
• @barbarabeeton I think you misunderstood. Looking at the output page in landscape orientation, the bottom of the image should be on the bottom of the page and the caption on the page left side. Basically if you compile the code from my question, just imagine the caption should be on the left side in the same orientation as page number (also same as fancy header and footer I have in my original document). And this all should stay on one page and not go to a new page. Please, if you have done it, share it. Oct 14, 2013 at 8:23

\documentclass{article}
\usepackage{graphicx}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyfoot[C]{Footer}
\fancyfoot[R]{\thepage}
\usepackage{kantlipsum}
\usepackage{afterpage}
\usepackage{pdflscape}

\begin{document}

\kant[1]
\afterpage{
\clearpage
\begin{landscape}
\begin{figure}[htb]
\centering
\rotatebox[origin=c]{-90}{
\begin{minipage}{.5\linewidth}
\caption{Figure caption is coming here and it will be by the side of the figure}
\end{minipage}%
}
\end{figure}
\end{landscape}
}
\kant
\end{document}


\documentclass{article}
\usepackage{graphicx}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyfoot[C]{Footer}
\fancyfoot[R]{\thepage}
\usepackage{kantlipsum}

\begin{document}
\section{This is a section}
\begin{figure}[!htb]
\centering
\includegraphics[scale=1.1,angle=90]{example-image-a}  %% adjust angle and scale appropriately
\caption{Figure caption is coming here and it will be by the side of the figure}
\end{figure}
\kant
\end{document}


• This does not solve the problem Harish. I need the output PDF page to be in landscape. Your both examples result in portrait orientation. Basically, if we look at the solution with the sidecap above, the page should be in landscape, the figure A letter should be rotated by 90 deg clockwise and the caption should be on the left side of the page also rotated by 90 deg clockwise. Oct 11, 2013 at 10:27
• P.S. I am compiling LaTeX to PDF. Oct 11, 2013 at 10:33
• your last answer does not give the result I want. You rotated the caption correctly, but two things are still wrong: 1) The figure is not rotated correctly - now it should be shown 90 deg counter clockwise to be correct 2) Page is still in portrait orientation, not in landscape. Maybe one has to separate the rotation of the caption and the picture? I repeat: the output profile I use is LaTeX to PDF. Is there another alternative than {landscape} connected with \usepackage{pdflscape} to get the page in landscape? Oct 11, 2013 at 11:11
• That does not help. Please see my comment to @barbara beeton above. Oct 14, 2013 at 8:27
• I have added a sketch to that you better understand what I would like to get. Oct 15, 2013 at 6:52