1

I want to use the pdfpages in Latex in landscape mode.

That's possible with the following code:

\documentclass{article}
\usepackage{pdfpages}
\begin{document}
\includepdf[landscape=true,pages=1-3,pagecommand={}]{Planning.pdf}
\end{document}

But I also want to keep the section and page number at the top and bottom of the page. For example when I do this:

\documentclass{article}
\usepackage{pdfpages}
\begin{document}
\includepdf[landscape=true,pages=1-3,pagecommand={\subsection{Bijlage 1}}]{Planning.pdf}
\end{document}

The header is also rotated, including the footer.

Is it possible to get the header and footer at the 'normal' position (so at the top and bottom of the document, like in portrait mode).

Edit: It looks like my question isn't good explained. So I draw something on paper to clarify my question.

Drawing on paper

  • Welcome to TeX.sx! Please take the time to add a full MWE (minimal working example), that is a compilable (with documentclass and such) document illustrating the problem, so that people willing to help are given all the elements they might need. – T. Verron Nov 08 '16 at 13:33
  • I added a small example. – koenieee Nov 08 '16 at 13:38
  • Welcome to TeX.SX! A tip: If you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it). – ebosi Nov 08 '16 at 13:40
  • Untried solution: is the option pagecommand={\thispagestyle{headings}} working? – ebosi Nov 08 '16 at 13:44
  • @ebo, thanks I was wondering how I could get the syntax highlighting on. – koenieee Nov 08 '16 at 13:53
  • @ebo, your solution is not working because the headers are at the side of the page instead at the top. – koenieee Nov 08 '16 at 13:54
  • @koenieee well, I actually tried it, and page numbers are correctly positioned regarding the sheet of paper (i.e. without considering the included PDF), that is, at the upper right corner of the sheet of paper. It is what you want, isn't it? (NB: your pdf viewer might rotate the page you're look at.) – ebosi Nov 08 '16 at 14:08
  • Thanks for trying, but I want the page numbers at the bottom of the page (so the normal place when in portrait mode). – koenieee Nov 08 '16 at 15:23
  • @koenieee have you tried the solution below? Is it satisfactory? – ebosi Nov 21 '16 at 15:40
  • Hi Ebo, Sorry I forget this post. I will update my question because it isn't clear – koenieee Dec 01 '16 at 10:59
  • answer edited - see below – ebosi Dec 01 '16 at 11:47

1 Answers1

1

You can have a try with following MWEs:

  • portrait-pdf.tex : the portrait file that will be included via pdfpages

    \documentclass{scrartcl}
        \usepackage{graphicx}
    \begin{document}
        \centering
        \includegraphics*[width=.9\textwidth,height=.9\textheight]{example-image-a}
        \includegraphics*[width=.9\textwidth,height=.9\textheight]{example-image-b}
    \end{document}
    

You get this result:
enter image description here

  • landscape-pdf.tex : the landscape file that will be included via pdfpages

    \documentclass[landscape]{scrartcl}
        \usepackage{graphicx}
    \begin{document}
        \centering
        \includegraphics*[width=.9\textwidth,height=.9\textheight]{example-image-c}
        \includegraphics*[width=.9\textwidth,height=.9\textheight]{example-image}
    \end{document}
    

You get this result:
enter image description here

  • main.pdf: the file that includes previously generated PDF

    \documentclass{scrartcl}
        \usepackage{pdfpages}
        \usepackage{pdflscape}
        \usepackage{lipsum}
    \begin{document}
        \section{Regular text}
        \lipsum
    
        \begin{landscape}
            \includepdf[landscape=true,pages=1-2,pagecommand={\section{Include lanscape pdf}}]{landscape-pdf}
        \end{landscape}
    
        \includepdf[landscape=false,pages=1-2,pagecommand={\section{Include portrait pdf}}]{portrait-pdf}
    \end{document}
    

enter image description here

The only issue is that on page 3 and 4 of this PDF, pages number are "on the left side": see explanations and details here.

ebosi
  • 11,692
  • Thank you for trying to answer my question, but I think you didn't understand it. I added a drawing on paper to clarify my question. – koenieee Dec 01 '16 at 11:03
  • @koenieee thanks for pinging. Could you please draw the boundaries of your included landscpape pdf on your drawing, as well as how is text written in this document (horizontally, or vertically) - so that I'm sure I understand it correctly? – ebosi Dec 01 '16 at 11:17
  • @koenieee plus: does "title" belong to the imported PDF, or the one you're trying to create? and are your PDF more than 1 page long? – ebosi Dec 01 '16 at 11:27
  • Title doesn't beolong to the imported PDF, and yes the PDF is more than 1 page long. Only at the first page the title has to be visible (imported PDF), at the second page (PDF) only the page numbers has to be visible. – koenieee Dec 07 '16 at 10:23
  • @koenieee is the proposed solution satisfactory? – ebosi Dec 07 '16 at 10:48
  • No ebo, I'm sorry. The page numbers are on the left side of the page, not at the bottom, so that's something that is not going to work for me. But thanks for helping out! I will follow the link you posted – koenieee Dec 07 '16 at 12:31