Switching to landscape in LaTeX

I have to write a project proposal using LaTeX, which is pretty new for me. I've been doing good so far, but I now need to include a Gantt-diagram inside the proposal and, as the image with the diagram is horizontal, I'd like to turn the Page which includes to diagram to be in landscape mode. What can I use to achieve this?

Taggings:

3 answers

You can use the pdflscape package for this, which you must initialize in the following way:

\usepackage{pdflscape}

To then use it inside your document you must use the following commands:

\begin{landscape}
{your diagram}
\end{landscape}

Note that this can result in the page number being misplaced if you include one. For this you can copy the following definition to your code and then add the \placepagenumber comand above the \end{landscape} comand:

\def\placepagenumber{%
\par\pagestyle{empty}%
\vbox to 0pt{\vss}\vfill
\vbox to 0pt{\baselineskip0pt
\hbox to\linewidth{\hss}%
\baselineskip\footskip
\hbox to\linewidth{%
\hfil\thepage\hfil}\vss}}

Taggings:

Comments

I use the package \usepackage{pgfgantt} which is used for gantt diagram. Hard to say if it would be a another solution on your problem but maybe

Mathilda Moström - Thu, 12/16/2021 - 10:24 :::

great solution. I have struggled with Latex in the past and stopped using it because it was so user unfriendly. But if I ever need it again, I will remember this

Ondrej Brichta - Mon, 12/20/2021 - 11:01 :::

I never had the problem, but as this post describes [1], the package lscape provides also this functionality. According to [1], pdflscape is only usable with pdfLaTeX.

[1] https://tex.stackexchange.com/questions/337/how-to-change-certain-pages-...

Thomas Stoiber - Mon, 12/20/2021 - 15:44 :::

Thanks for this solution, I once used the lscape package and then had my chart as a picture and called in Latex like

\begin{sidewaysfigure}[ht]
\includegraphics[..]
\caption{..}
\label{fig:..}
\end{sidewaysfigure}

Parinaz Momeni ... - Wed, 12/22/2021 - 00:10 :::

Very useful knowledge, Thank you very much !

Moritz Ruoff Holzer - Wed, 12/22/2021 - 07:35 :::

Thanks for this answer. I also have a lot of problems with Latex every time.

Nino Ziegelwanger - Wed, 12/22/2021 - 10:32 :::

Hi, I recommend using "lscape" package.

% lscape.sty
\usepackage{lscape}
...
\begin{landscape}
...
\end{landscape}

Taggings:

Great post, will surely help me with my next Latex project where I have a wide table I want to display. I also researched this problem and found it on stackexchange where it is solved in a similar way. -> Therefore the solution is certainly correct and will help some of us, thanks for sharing!

Taggings: