跳到主要内容

Way to rotatepage in LaTex

· 阅读需 1 分钟

Instruction

This post helps to set the rotate page style for latex. The answer is provided by DigNative.

I short the code and it is only availbel for XeLaTex. It has been tested with XeLaTex and documentclass report.

This method is useful for the digital version of a pdf file with horizontal tables or figures. you do not need to rotate the pages with side table or figures that these will be rotated automatically only with the environment \begin{sidewaystable} \end{sidewaystable} or \begin{sidewaysfigure} \end{sidewaysfigure}.

Code

You only need to copy the code to the presetting part before \begin{document}

\makeatletter
\def\@PDFrot#1{\special{pdf: put @thispage <</Rotate #1>>}}
\patchcmd{\@xrotfloat}
{\begin{minipage}\textheight}
{\begin{minipage}\textheight\@PDFrot{90}}
{}{}
\makeatother