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.
Create your slides / presentations with Latex « Blog on Latex Matters
[…] Nevertheless, this is not sufficient, as it only turns the slide, but not the paper (see the previous post for details). […]
Linda Octa
Thank you, its very useful!!!!
Alin Tolea
Thanks! The only correct reference on landscape pages in latex!
Alin
Jinbae
Amazing and perfect!
Thank you for your post.
Hartwork Blog » Single landscape pages in LaTeX
[…] Actually quite easy. Found it on Texblog. […]
Victor
Thanks!
Jason Morgan
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.
tom
The header/footer will not be rotated. You need to do it differently if you also want to rotate the header/footer.
Tom.
Jonathan
Thanks a lot…it’s very useful information for us!!!
Osmikraska
Thanks a lot 😉
Jobi
thanks .. was really helpful !
Mirek
Thanks! Very clear and useful!
BC
THX VERY MUCH!!
Eric
Is there a way to get this to work with fancyhdr? It seems using pdflscape rotates the content, but not the fancyhdrs.
tom
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
typearea
package. It seems, you can’t do it withfancyhdr
.Tom.
Peter
Thanks, completely clear and useful!
Raghu Prasad
A timely tip which saved my time to visit the bookshelf to pick up that fat book.
Wagner
Very useful and very good blog!
thx for posting it!
Mtzie
Thanks! I was very helpful. keep it up
rev. Beraldo
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!
Chris Lasher
This was extremely helpful, particularly pointing out pdflscape. Thank you!
romunov
Worked like a charm, thank you!
raditya
thank you sooooo much… it was really helpful
enoksrd
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!
Joseph
Thanks a lot, very useful, worked all right, saved me a lot of time and effort.
Upananda
Thanks a lot for your help and saving time for me….
pietro
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
tom
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 works :-).Tom.
Isere Abednego
This is going to be the solution of what I have been thinking about
Matthew Carr
Great post, helped me to fit a large figure which was causing all sorts of trouble before 🙂 Thanks a lot!
jbecker85
Thanks, useful article!
ivik
very helpful, thx a lot:) I was desperate and this is so simple solution and works perfectly
Angelika
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
tom
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:
From here. Hope that solves your problem.
Cheers, Tom.
Aravind
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
tom
Hi Aravind,
Please provide a minimal example for your problem.
Thanks, Tom.
Cyrus Kosar
YOU ARE THE BEST!
tom
I doubt that, but thanks anyway. Glad to hear I could help :-). Tom.
Aravind
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
tom
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.
You can also try to change the page margins to get more space using the geometry package:
and
Cheers, Tom.
Warwick Dumas
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.
Naeem
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
tom
Hi Naeem,
Latex will place the figure where it fits “best”. But you can influence the decision using an exclamation mark:
Tom.
Naeem
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:-(
Chad
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?
Tim Rudnevsky
I have the same problem too. Maybe someone can suggest something?
ebrahim
use sidewaystable.
Maryam
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”
tom
Hi Maryam,
Thanks for the tip! Appreciate it. Tom.
randpen
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…
PaulB
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
tom
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.
Musi Ali
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?
tom
Hi! You’ll need a floating environment to fill space automatically. Try using
sidewaystable
from therotating
package for your table. Best, Tom.Intrepid
Still very very useful!
Thanks a lot!
Intrepid
Stunt21
Thank you very much =)
Maryam
It was so useful Tom 🙂 Thank you so much 🙂
Eric
Thanks for this great info! The one thing about
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
makes all margins uniform.
tom
Hi Eric,
Thanks for your comment. I didn’t know that.
Tom.
web ressource
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!
tom
Thanks for sharing my website. Appreciate it. Tom.
Xunming Du
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
Hrushikesh
Thanks, this helped a lot !!
Emma
Thanks! Very helpful.
droeawe
Dear Tom,
Kindly guide me on what I need to do to add caption,tablenote and label to my table using sideways environment.The following shows what I have been doing with caption and label but without success.Thanks.
tom
Hey!
Thanks for your question. Here is an example using the rotating package:
My recent article on the topic might also be of interest to you.
Cheers, Tom.
droeawe
Many thanks Tom for this useful suggestions.However,I initially opted for sideways environment because the sidewaystable environment will normally relocate the table by one or more pages away from where it is needed in the document.But going by your suggestions,it appears that sidewaystable environment can still not be avoided.Ok,thanks.
tom
The solution largely depends on your needs: the size of the table, where you need it, etc. If you are going with
sidewaystable
, try adding\clearpage
at the end. If not, below is a rotated table based onsideways
. Please provide a minimal example to illustrate your problem, should this not be what you were looking for.Thanks, Tom
Isabelle
Thanks for your information! But no matter what I do, it always turns my page in the PDF view. I don’t want that (I only want to turn the table), since the document will be printed. I tried the following two possibilities:
I’m grateful for any suggestions on how to rotate my table without rotating the whole PDF page. Thanks!
tom
It shouldn’t matter if the physical page is turned, even if you print the document. In any case, here is an example where only the table is rotated, not the page. The first table is embedded between text, the second takes the whole page.
Best wishes,
Tom
Isabelle
Thank you for your examples, but the page is still turned in my pdf document. I’m working on a mac and I’m using texmaker. I wonder if another package does the turning?
The problem is that the printer does not notice the turned page and just prints the page like it were portrait.
I’m glad for further suggestions!
tom
It might be another package. When I run the example I posted, the page doesn’t get turned, only when using the
landscape
environment of the pdflscape package.If you can’t fix the issue, why not just rotate the single page back using Preview before printing?
Tom
Isabelle
That would work of course. Thank you!
Ketan
thanks for giving good example.this is very useful….
Sergiy
Hi!
Thanks for a usefull post! For me everything worked fine, but here a small coment on lscape, pdflscape and automatic page rotation.
pdflscape is thought to work with pdflatex (and lscape with latex). So, for pdflatex everything woks great. If used with latex->dvipdf, the pages in pdf are not rotated (the same happans to lscape).
To get automatic page rotation with latex, the way over .ps should be used, means latex->dvips->ps2pdf. Then the automatic pages rotation works fine with both packages lscape and pdflscape.
Just for the case there are some people left who uses “old school” latex :)))
tom
Absolutely, thanks much for the clarification! Best, Tom