关于如何强制旋转sidewaystable
或的问题已被问过好几次,答案始终是“使用带有选项或或等的sidewaysfigure
包”。rotating
figuresleft
figuresright
clockwise
这是很好的做法,因为它强制整本书都遵循相同的行为。
但我需要一个例外。我有一张两页长的横向表格,所以我将它分成偶数页和奇数页。但当然,要做到这一点,我需要两个表格的方向相同。但我也不想改变sideways
环境的全局行为,这应该是例外。
如何sidewaystable
在不使用包选项的情况下更改单个环境的旋转?
(我尝试将其用作counterclockwise
环境选项,但没有作用……)
根据 Ulrike 的建议,这里有一个简单的例子:
\documentclass{book}
\usepackage{rotating}
\begin{document}
\setcounter{page}{48}
\begin{sidewaystable}
\caption{This is the first part of the table on the even page}
\bigskip
Stuff that needs to be written from bottom to top.
\end{sidewaystable}
\newpage
\begin{sidewaystable}
\caption{This is the second part of the table on the odd page}
\bigskip
Stuff that also needs to be written from bottom to top.
\end{sidewaystable}
\end{document}
目标是让偶数页横向表格(第 48 页)从下到上显示文本,就像奇数页横向表格一样,而无需更改全局包选项。
答案1
\documentclass{book}
\usepackage{rotating}
\begin{document}
\setcounter{page}{48}
\makeatletter \@rot@twosidefalse \makeatother
\begin{sidewaystable}
\caption{This is the first part of the table on the even page}
\bigskip
Stuff that needs to be written from bottom to top.
\end{sidewaystable}
\newpage
\begin{sidewaystable}
\caption{This is the second part of the table on the odd page}
\bigskip
Stuff that also needs to be written from bottom to top.
\end{sidewaystable}
\makeatletter \@rot@twosidetrue \makeatother
\end{document}
答案2
一种可能性是使用landscape
封装在 中的页面,\afterpage{...}
而不是两个连续的页面sidewaystable
:
\documentclass{book}
\usepackage{rotating}
\usepackage{lscape}
\usepackage{afterpage}
\usepackage{lipsum}
\setcounter{page}{46}
\begin{document}
\lipsum
\afterpage{%
\begin{landscape}
\begin{table}
\caption{This is the first part of the table on the even page}
\bigskip
\lipsum[1-2]
\end{table}
\clearpage
\begin{table}
\caption{This is the second part of the table on the odd page}
\bigskip
\lipsum[3-4]
\end{table}
\end{landscape}
}
\lipsum
\end{document}