4

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{}
\fancyhead[C]{Fancy page header}
\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}
  \includegraphics[scale=.9,angle=90]{example-image-a}  %% adjust angle
  \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:

enter image description here

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). – Torbjørn T. Oct 11 '13 at 9:18
  • Does the package hvfloat help? – Marco Daniel Oct 11 '13 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. – barbara beeton Oct 11 '13 at 14:37
  • @MarcoDaniel yes, I tried the hvfloat out - it does not help. – farhigh Oct 14 '13 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. – farhigh Oct 14 '13 at 8:23
4
\documentclass{article}
\usepackage{graphicx}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[C]{Fancy page header}
\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}
  \includegraphics[scale=.9,angle=90]{example-image-a}  %% adjust angle
  \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}

enter image description here

\documentclass{article}
\usepackage{graphicx}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[C]{Fancy page header}
\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}

enter image description here

  • 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. – farhigh Oct 11 '13 at 10:27
  • P.S. I am compiling LaTeX to PDF. – farhigh Oct 11 '13 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? – farhigh Oct 11 '13 at 11:11
  • That does not help. Please see my comment to @barbara beeton above. – farhigh Oct 14 '13 at 8:27
  • I have added a sketch to that you better understand what I would like to get. – farhigh Oct 15 '13 at 6:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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