[Tex/LaTex] Rotating package + sidewaystable + pagenumbering not rotated expected

page-numberingrotatingtables

This question is similar to: Set up sidewaysfigure to have the bottom of the figure toward the spine but that question doesn't give me the result I'm looking for.

Instead, I want my tables to be rotated such that the top of the figure is always near the spine. But I believe I've run into an incompatibility related to the rotating package and page numbering styles.

There's an example below, which I'm compiling using two passes of pdflatex. The result is that Table 1 is rotated with the top away from the spine. If I comment out "Line A" (see example), then the table is rotated as expected. In other words, changing the page numbering style is also causing my tables to rotate different ways, and that's not what I want.

In my case, all pages will alternate, regardless of the number on the page. That is, the first page in the PDF will be on the right of the spine when the book is open, the second page to the left, etc, regardless of the numbering in the resulting PDF, and I'm not allowed to include blank pages. This format is bad, but it's imposed by another authority and is not negotiable.

How can I continue to include line A and still get the table rotated as desired?
Thanks!

\documentclass[10pt,twoside,letterpaper,oldfontcommands,openany]{memoir}

\usepackage{rotating} % Rotating table
\pagenumbering{roman}  % This makes the page numbers Roman (i, ii, etc)
\title{Test title}
\author{Test author}

\begin{document}
Test title page

\clearpage\pagenumbering{arabic} % Line A.  Toggle this

\chapter{Test chapter}

\begin{sidewaystable}
\centering
\begin{tabular}{|l|}
\hline
A \\
\hline
a \\
\hline
\end{tabular}
\caption{Table 1}
\end{sidewaystable}

\begin{sidewaystable}
\centering
\begin{tabular}{|l|}
\hline
B \\
\hline
b \\
\hline
\end{tabular}
\caption{Table 2}
\end{sidewaystable}

\end{document}

Best Answer

As rotation goes along with page count, I though to change it, so tables are oriented as you want. I hope page numbering was not a mandatory requirement. :)
Your Line A hass been changed.

\documentclass[10pt,twoside,letterpaper,oldfontcommands,openany]{memoir}

\usepackage{rotating}
\pagenumbering{roman}
\title{Test title}
\author{Test author}

\begin{document}
Test title page

\clearpage\pagenumbering{arabic}\setcounter{page}{2}

\chapter{Test chapter}

\begin{sidewaystable}
\centering
\begin{tabular}{|l|}
\hline
A \\
\hline
a \\
\hline
\end{tabular}
\caption{Table 1}
\end{sidewaystable}

\begin{sidewaystable}
\centering
\begin{tabular}{|l|}
\hline
B \\
\hline
b \\
\hline
\end{tabular}
\caption{Table 2}
\end{sidewaystable}

\end{document}