PDFpages landscape with normal footer and header (on top)
You can have a try with following MWE
s:
-
portrait-pdf.tex
: the portrait file that will be included viapdfpages
\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}
-
landscape-pdf.tex
: the landscape file that will be included viapdfpages
\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}
-
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}
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.
Related videos on Youtube
koenieee
Updated on August 01, 2022Comments
-
koenieee over 1 year
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.
-
T. Verron about 7 yearsWelcome 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.
-
koenieee about 7 yearsI added a small example.
-
ebosi about 7 yearsWelcome 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 about 7 yearsUntried solution: is the option
pagecommand={\thispagestyle{headings}}
working? -
koenieee about 7 years@ebo, thanks I was wondering how I could get the syntax highlighting on.
-
koenieee about 7 years@ebo, your solution is not working because the headers are at the side of the page instead at the top.
-
ebosi about 7 years@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.)
-
koenieee about 7 yearsThanks for trying, but I want the page numbers at the bottom of the page (so the normal place when in portrait mode).
-
ebosi almost 7 years@koenieee have you tried the solution below? Is it satisfactory?
-
koenieee almost 7 yearsHi Ebo, Sorry I forget this post. I will update my question because it isn't clear
-
ebosi almost 7 yearsanswer edited - see below
-
-
koenieee almost 7 yearsThank 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.
-
ebosi almost 7 years@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 almost 7 years@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?
-
koenieee almost 7 yearsTitle 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.
-
ebosi almost 7 years@koenieee is the proposed solution satisfactory?
-
koenieee almost 7 yearsNo 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