1

I want to include a PDF in landscape (its a table in PDF form) with include PDF. I want a section on the same side, but when I use this command, the section heading is not on top (of that landscape page).

\includepdf[landscape=true, page=1,pagecommand=\section{Section Heading}]{table.pdf}

enter image description here

As you can see. B Section Heading is on the right. But i want it on top.

  • Could you provide a image of your current result or desired result? Because compiling your code I get what I'd expect... the section gets rotated with the inserted content. – G. Bay May 18 '18 at 2:00
  • i added a picture – ziT May 18 '18 at 5:03
1

There could be multiple reasons for this. I suspect that \pdfpages still uses the "portrait coordinate system" for pages included in landscape, thus "LaTeX" does not know that you are in landscape mode. You've just rotated the one PDF-page.

If you use e.g. the pdflscape-package to tell LaTeX that you are in landscape mode first, it seems to work fine:

\documentclass{article}
\usepackage{pdflscape}
\usepackage{pdfpages}
\begin{document}
  \begin{landscape}
    \includepdf[landscape=true, pagecommand=\section{Section Heading}]{table.pdf}
  \end{landscape}
\end{document}
0

Here is a different approach, based on this answer. I have rotated the headings using textblock and rotated the included pdf again.

turned page with rotated heading

\documentclass[a4paper]{report}
\usepackage{pdfpages}
\usepackage{pdflscape}
\usepackage{textpos}
\begin{document}
\begin{landscape}
\begin{textblock}{20}(-17,-2.5){\rotatebox{90}{\leftmark}}
\section{Section Heading}

\begin{figure}[]
\includegraphics[,angle=-90,origin=c]{document_test.pdf}
\end{figure}
\end{textblock}
\end{landscape}
\end{document}

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.