3

I have a sidewaysfigure, however I'd like to rotate the pdf page containing this table, avoiding the use of pdflscape package. How can I do this?

\documentclass[12pt,a4paper]{article}
\usepackage{blindtext}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{rotating}
\begin{document}
\blindtext\par
%
\begin{sidewaysfigure}
\centering
I'd like to rotate this page
\caption{An example}
\end{sidewaysfigure}
\Blindtext
\end{document}

enter image description here

2
  • As I discovered while trying to place the figure... there are problems with the above answer and it needs some expansion. I gave a try and got a good result but did not really used sideways figure... Just used tikz package and placed everything in a rotated minipage as a hack. I also had to get rid of the pagenumber.
    – koleygr
    Sep 23, 2017 at 0:27
  • I think this is not a duplicate. sidewaysfigure/table will rotate the page where the figure will be placed, while the answers in the other thread create a rotated page where to place the content. Moreover, sideways will rotate differently twoside documents; the other thread does not cover it. To fully answer this, you need to combine this to patch the rotation, this or this to avoid interrupting the text (with afterpage). Jun 3, 2022 at 17:00

1 Answer 1

0

Edit:

\documentclass{article}
\usepackage{blindtext}
\usepackage{rotating}
\usepackage{caption}
\usepackage{tikz}
\begin{document}
\blindtext\par

\pagebreak


\global\pdfpageattr\expandafter{\the\pdfpageattr/Rotate 90}

\thispagestyle{empty}

\begin{tikzpicture}
\node[rotate=90] at (0,0) {\begin{minipage}{\textheight}
                   \begin{center}
                   I'd like to rotate this page
                   \end{center}
                   \blindtext

                   \centering
                   \includegraphics[width=0.3\textwidth]{example-image-a}
                      \captionof{figure}{Test caption}
                \end{minipage}};
\end{tikzpicture}
\pagebreak

\global\pdfpageattr\expandafter{\the\pdfpageattr/Rotate 0}
\Blindtext


\end{document}

From the answer here: https://tex.stackexchange.com/a/40692/120578

\documentclass{article}
\begin{document}
  text

  \pagebreak[4]
  \global\pdfpageattr\expandafter{\the\pdfpageattr/Rotate 90}
  text
  \pagebreak

  \global\pdfpageattr\expandafter{\the\pdfpageattr/Rotate 0}
  text
\end{document}

I didn't want to change the original answer, so I wrote this here as an answer to a duplicate question (I am going to flag it but I will reffer to it in the comments in the original answer).

4
  • It didn't work in my example Sep 23, 2017 at 0:28
  • Did you tried my edit?
    – koleygr
    Sep 23, 2017 at 0:29
  • I tryed, however I didn't like the result, because the text in the last page was centered Sep 23, 2017 at 0:32
  • Sorry for that... my mistake ... fixed (just remove the \centering after \thispagestyle)
    – koleygr
    Sep 23, 2017 at 0:34

Not the answer you're looking for? Browse other questions tagged .