The default page layout is “portrait”, but sometimes it is still useful/necessary to have the whole document or only single pages changed to “landscape”. The latter might be due to a large table or figure. This post will tell you how to change the page layout of the whole document or single pages to “landscape”. In addition, it is possible to make single pages appear left side up in the PDF, making them more readable.
Changing the whole document to “landscape” can be done be using the geometry-package:
\usepackage[landscape]{geometry}
You can also just change the page content to landscape, but not the actual page layout through the optional argument of the command “documentclass”. It does not make much sense, but you can do it:
\documentclass[landscape, 12pt]{report}
Next I will show you how to change the page layout of single pages. The lscape-package provides according possiblities:
\usepackage{lscape}
With
\begin{landscape}
...
\end{landscape}
you define the section of your document to be set to “landscape”, e.g. a large table or figure.
This will not automatically rotate the page in the PDF and is useful if the document is destined for printing.
If you want to make appear the left side up, better readable on screen, the pdflscape-package will do it:
\usepackage{pdflscape}
and again:
\begin{landscape}
...
\end{landscape}
for the page to be “landscape”, while the rest will remain in “portrait” orientation. Nevertheless, the header/footer will also be changed in orientation.
January 21st, 2008 at 7:50 pm
[...] Nevertheless, this is not sufficient, as it only turns the slide, but not the paper (see the previous post for details). [...]
March 16th, 2008 at 9:01 am
Thank you, its very useful!!!!
April 17th, 2008 at 4:45 pm
Thanks! The only correct reference on landscape pages in latex!
Alin
August 4th, 2008 at 6:58 pm
Amazing and perfect!
Thank you for your post.
November 23rd, 2008 at 6:23 pm
[...] Actually quite easy. Found it on Texblog. [...]
February 24th, 2009 at 12:16 am
Thanks!
March 20th, 2009 at 3:38 pm
Thank you for this.
Quick question: when using pdflscape, should the headers and footers also be reoriented or should they remain in a portrait orientation? Mine seem to be doing the latter. I am using fancy headers/footers.
December 20th, 2010 at 2:46 pm
The header/footer will not be rotated. You need to do it differently if you also want to rotate the header/footer.
Tom.
April 13th, 2009 at 12:31 am
Thanks a lot…it’s very useful information for us!!!
April 30th, 2009 at 11:21 am
Thanks a lot
September 4th, 2009 at 6:00 pm
thanks .. was really helpful !
September 16th, 2009 at 1:26 am
Thanks! Very clear and useful!
September 28th, 2009 at 1:27 pm
THX VERY MUCH!!
October 4th, 2009 at 12:57 am
Is there a way to get this to work with fancyhdr? It seems using pdflscape rotates the content, but not the fancyhdrs.
May 8th, 2010 at 8:49 pm
The page header/footer is for consultation purposes and therefore should not be rotated with the page. Hence, it is correct that the headers/footers are not rotated with when using
pdflscape. Imagine a book with rotated headers!If you really want to rotate the header/footer with the content, you might check the
typeareapackage. It seems, you can’t do it withfancyhdr.Tom.
October 25th, 2009 at 3:55 pm
Thanks, completely clear and useful!
November 7th, 2009 at 2:56 pm
A timely tip which saved my time to visit the bookshelf to pick up that fat book.
December 16th, 2009 at 8:44 pm
Very useful and very good blog!
thx for posting it!
February 3rd, 2010 at 12:52 pm
Thanks! I was very helpful. keep it up
February 17th, 2010 at 4:22 pm
I was trying using landscape as an option in the documentclass command but the page orientation was still the usual.
But the package geometry with the option landscape solved it! Thank you!
April 19th, 2010 at 3:19 am
This was extremely helpful, particularly pointing out pdflscape. Thank you!
July 16th, 2010 at 2:46 pm
Worked like a charm, thank you!
July 20th, 2010 at 1:56 pm
thank you sooooo much… it was really helpful
August 3rd, 2010 at 12:09 am
I couldn’t get the single page landscape (\usepackage{pdflscape}, \begin{landscape} … \end{landscape}) to work with \mbox. In particular, there was no error message, the page content just didn’t rotate. After removing the mbox it works. Thanks!
August 8th, 2010 at 12:56 pm
Thanks a lot, very useful, worked all right, saved me a lot of time and effort.
September 29th, 2010 at 5:39 pm
Thanks a lot for your help and saving time for me….
October 26th, 2010 at 5:26 pm
Once in landscape mode (from \usepackage[landscape]) how to rotate back to vertical one single page, because for example I have a tall table
thanks
December 20th, 2010 at 2:42 pm
Hi Pietro,
Once in landscape mode, you can rotate back using
.
\begin{landscape}...\end{landscape}for portrait pages. This is not straight forward, but it worksTom.
March 2nd, 2011 at 1:03 am
Great post, helped me to fit a large figure which was causing all sorts of trouble before
Thanks a lot!
April 7th, 2011 at 8:59 am
Thanks, useful article!
April 14th, 2011 at 1:23 pm
very helpful, thx a lot:) I was desperate and this is so simple solution and works perfectly
April 24th, 2011 at 4:37 pm
Hi, you all,
I am using landscape and it works fine to landscape one page and portrait the other ones. However, on a doublesided document the landscape pages of even pagenumbers (on the left side of the document) should be upside down from the ones of the odd pagenumbers (on the right side of the document). How do I get a landscape page rotated 180 degrees?
Thanks for any idea
Angelika
April 25th, 2011 at 3:27 am
Hi Angelika,
Thanks for your comment. You are right, lscape will not rotate the page accordingly when using the twoside-option. There is another solution however, using the “rotating”-package:
\usepackage{rotating} ... \begin{sideways}...\end{sideways} \begin{sidewaysfigure}...\end{sidewaysfigure} \begin{sidewaystable}...\end{sidewaystable}From here. Hope that solves your problem.
Cheers, Tom.
May 10th, 2011 at 6:02 pm
Hi all,
Thanks for the post…..it is working fine…..but in my case i have a wide and a multi-page table and when i do the above mentioned procedure in addition with longtable package, i can get only 1 page rotated and the other information is being cut that means howmuch ever i include i get only 1 page and rest all is not in the pdf. I would be very greatful if someone could help me with this.
Cheers,
Aravind
May 11th, 2011 at 8:27 am
Hi Aravind,
Please provide a minimal example for your problem.
Thanks, Tom.
May 11th, 2011 at 3:37 pm
YOU ARE THE BEST!
May 11th, 2011 at 4:32 pm
I doubt that, but thanks anyway. Glad to hear I could help
. Tom.
May 12th, 2011 at 9:19 am
Hi tom,
As i said i have a wide table and therefore i decided to use sideways table so that i can place all the columns well horizontally on a page…..but i am facing a problem when i extend it to multiple pages using longtable package…..may be sideways and longtable packages don’t work parallel….in this case i can see the data only in the frst page of the PDF output
May 12th, 2011 at 10:43 am
It seems that you cannot combine sideways and longtable. The example below might help depending on how wide you table is. It uses landscape environment, a smaller text size and longtable for multipage.
\begin{landscape} \begin{footnotesize} \begin{longtable}{cccccccccccc} \caption{Longtable example}\\ \hline head content... \hline \endhead \hline \multicolumn{12}{r}{\emph{Cont. on following page}} \endfoot \hline \endlastfoot body content... \end{longtable} \end{footnotesize} \end{landscape}You can also try to change the page margins to get more space using the geometry package:
\newgeometry{⟨options⟩}and
Cheers, Tom.
June 11th, 2011 at 11:42 am
I’m glad this page is one of the highest hits on the Google search “tex command landscape portrait”, because it contains just the information that I needed.
July 4th, 2011 at 2:11 pm
Hi everybody,
Thanks to everybody because your posts helped me alot
While writing a paper for ACM proceedings I a faced a problem. I added a large image using \begin{landscape} … \end{landscape} in my document. Problem is, LATEX does not adjust the text with the image automatically, e.g., when I add some lines of text before the image then a new page before (landscape) image is shown instead of moving that text after the image, which is normally done in prtrait mode.
Any ideas how to handle it?
Thanks in advance,
Regards,
Naeem
July 4th, 2011 at 3:16 pm
Hi Naeem,
Latex will place the figure where it fits “best”. But you can influence the decision using an exclamation mark:
\begin{figure}[h!t]...Tom.
July 4th, 2011 at 3:52 pm
Hi Tom,
Many thanks for your quick reply.
Unfortunately, use of exclamation doesn’t do the trick for me, i.e., I still face the same problem.
Let me explain the problem a bit more. I have total 7 pages, landscape image is on page 4 (while page 3 is full with text). If I add a new paragraph just before the image then LATEX moves the image to page 5 and shows only the newly added lines on page 4 while leaving the rest of page 4 empty. If I use the portrait image then it merges the newly added text with the existing text, i.e., do not leaves the empty space with newly added text.
I face the same problem if I use table in \landscape envoronment.
Any ideas??
Thanks again,
Naeem
PS: I also tried \clearpage, but no success:-(
October 31st, 2011 at 4:33 pm
I have the same problem as Naeem. It seems \landscape starts a new page wherever it’s introduced, which makes sense. But I’d like it to act something like a float because I have the same frustrating behavior as Naeem. Anyone else find a solution?
December 14th, 2011 at 5:04 pm
I have the same problem too. Maybe someone can suggest something?
February 1st, 2012 at 10:48 pm
use sidewaystable.
June 6th, 2012 at 9:24 am
Hello
I had the same problem, but “float” package solved it. So you can use the \usepackage{float}, and then the option \begin{figure}[H]. As you see, the difference is that here you have to use the Capital letter “H”
June 6th, 2012 at 12:46 pm
Hi Maryam,
Thanks for the tip! Appreciate it. Tom.
July 15th, 2011 at 1:56 am
Thank you Tom. This answered a recurring problem I had with landscape mode. Now I just wish there were an easy way to get fancyhdr to work with \landscape…
October 4th, 2011 at 3:08 pm
Hi,
I think I have a similar problem to Aravind. I am trying to include a pdf document (which is landscape and 7 pages long) into my own document (which is otherwise portrait). I have tried a number of different methods, but I always get the same result that the first page is displayed correctly in landscape, but the subsequent pages aren’t.
I would be very grateful for any help.
Paul
October 6th, 2011 at 4:28 am
Hi Paul.
I prepared a mini example. The first piece of code generates a document in landscape format which is then included in a portrait-format document in the second piece of code. Hope it helps, Tom.
\documentclass[landscape, 11pt]{article} \usepackage[english]{babel} \usepackage{blindtext} \usepackage[landscape]{geometry} \begin{document} \blinddocument \end{document}\documentclass[11pt]{article} \usepackage[english]{babel} \usepackage{blindtext} \usepackage{pdfpages} \begin{document} \Blindtext \includepdf[landscape=true, pages=-]{lscapeDoc} \Blindtext \end{document}October 19th, 2011 at 9:02 pm
Hi, thanks for it.
Lets suppose in the portrait mode, I have few lines in page 4, and then I insert table in landscape, and then continue to write other text.
What is happening—page 4 is left with a lot of space, table goes to page 5, and the new text I write goes to page 6.
Can not latex do formatting for me itself?
October 24th, 2011 at 3:03 am
Hi! You’ll need a floating environment to fill space automatically. Try using
sidewaystablefrom therotatingpackage for your table. Best, Tom.December 30th, 2011 at 11:04 pm
Still very very useful!
Thanks a lot!
Intrepid
January 3rd, 2012 at 12:08 pm
Thank you very much =)
June 6th, 2012 at 9:27 am
It was so useful Tom
Thank you so much
October 10th, 2012 at 10:53 pm
Thanks for this great info! The one thing about
\usepackage[landscape]{geometry}is that the even pages have different margins than the odd pages, as if they are going to be printed in a big landscape book, which looks weird when scrolling on a screen. But I found that using
\usepackage[landscape,centering]{geometry}makes all margins uniform.
October 11th, 2012 at 8:22 am
Hi Eric,
Thanks for your comment. I didn’t know that.
Tom.
December 3rd, 2012 at 9:13 pm
This is very interesting, You are a very skilled blogger.
I’ve joined your feed and look forward to seeking more of your great post. Also, I’ve shared your web site in my social networks!
December 8th, 2012 at 6:00 am
Thanks for sharing my website. Appreciate it. Tom.
January 1st, 2013 at 8:31 pm
Tom:
Your message is very helpful. I think everyone loves it if he/she get a chance to read and use what you have written here. Keep the good work!
Xunming from Nevada
April 15th, 2013 at 2:58 pm
Thanks, this helped a lot !!