一张桌子旋转正确,另一张桌子有问题

一张桌子旋转正确,另一张桌子有问题

在一个文件中,我有 2 个表。第一个旋转正确。第二个旋转了错误的 180 度。请查看代码:

第一桌

\newcolumntype{L}{>{\arraybackslash}X}

\begin{sidewaystable} % switch to landscape mode and start a 'table'

\begin{tabularx}{\textwidth}{@{} 
        >{\bfseries}l % automatic bold in first column, no line breaks
        *{5}{L} 
        @{}}

    \toprule
    \textbf{Protocol name} & \textbf{PA} & \textbf{SA} & 
    \textbf{FSA} & \textbf{DFSA} & \textbf{Q} \\  
    \midrule

    Protocol feature
    & Tags transmit after random time to the reader. In the case of a collision tags will retransmit after a random delay. 
    & Tags transmit their ID in synchronous time slots. In case of a collision, tags retransmit after a random delay.
    & Each tag responds only once per frame. 
    & Tags transmit once per frame. The reader uses a tag estimation function to vary  the frame size.
    & The reader dynamically adjust critical parameter~(Q)  based on the type of replies from tags.
    \\ \addlinespace
    Disadvantages
    & In a dense tag environment the the number of collision increases significantly.
    & In a dense tag environment the the number of collision increases significantly. The reader requires synchronization with tags.
    & It uses a fixed frame size and does not change the size during the identification process. 
    & It cannot move into the next frame at any time based on the situation of collision without finishing the current frame.
    & This protocol may encounter some problems (lower throughput) on adjusting~Q, especially when the frame size is larger than the number of tags.
    \\ \addlinespace
    RTF/TTF 
    & TTF & RTF & RTF & RTF & RTF
    \\
    Throughput 
    & 18.4\% & 36.8\% & 42.6\% & 42.6\% & 
    \\
    System cost 
    & Very low & Low & Expensive & Very expensive & Very expensive
    \\
    Complexity 
    & Very simple & Simple & High & Very high & Very high 
    \\
    \bottomrule                                                                     
\end{tabularx}
\caption{A comparison of Aloha protocols}
\label{tab:ComparisonAloha}
\end{sidewaystable}

第二张表:

\newcolumntype{L}{>{\arraybackslash}X}
\begin{sidewaystable} % switch to landscape mode and start a 'table'
\begin{tabularx}{\textwidth}{@{} 
        >{\bfseries}l % automatic bold in first column, no line breaks
        *{5}{L} 
        @{}}

    \toprule
    \textbf{Criterion} & \textbf{Aloha protocols} & \textbf{Tree-based protocols} & 
    \textbf{Hybrid protocols}  \\  
    \midrule

    Protocol feature
    & They use random multi-access way to identify tags. In case of collision, the tags will be asked to send data later with a random time relay. 
    & They identify the total number of tags in the interrogation zone. The reader controls every step of the protocol, using commands or queries to split colliding tags into subsets, and further repeatedly split those subsets until identifies all the tags.
    & They are mixture of Aloha and Tree-based protocols. They use two methods. The first is using randomized divisions in tree-based algorithms, and another is using tree strategies after a collision  in Aloha algorithms.
    \\ \addlinespace
    Number of tags to reader commands
    & Low
    & High
    & Medium
    \\ \addlinespace
    Usage 
    & Aloha protocols are commonly used in LF and HF RFID systems.
    & Tree-based protocols are commonly used in UHF and microwave RFID systems
    & Hybrid protocols are commonly used in UHF and microwave RFID systems.

    \\
    Method 
    & Probabilistic
    & Deterministic
    & Mixture (Aloha and Tree-based)

    \\
    Tag starvation

    & Yes & No & No
    \\

    \bottomrule                                                                     
\end{tabularx}
\caption{A comparison of Aloha, Tree-based and Hybrid protocols}
\label{tab:ComparationAll}
\end{sidewaystable}

这个很好

这应该旋转

答案1

使用rotating包和twosidedocumentclass 选项,sidewaysfigures 和sidewaystables 会根据其所在的页码进行旋转。浮动元素会进行旋转,以便图像(表格)的底部位于外边距,这意味着偶数页上的浮动元素会顺时针旋转(底部在左侧),而奇数页上的浮动元素会逆时针旋转(底部在右侧)。

以下 MWE 演示了默认行为:

\documentclass[twoside]{article}
\usepackage[]{rotating}
\usepackage{graphicx}

\begin{document}
\begin{sidewaysfigure}
\includegraphics{example-image}
\caption{odd page figure}
\end{sidewaysfigure}
\clearpage

\begin{sidewaysfigure}
\includegraphics{example-image}
\caption{even page figure}
\end{sidewaysfigure}

\clearpage
\begin{sidewaysfigure}
\includegraphics{example-image}
\caption{odd page figure}
\end{sidewaysfigure}
\end{document}

以下屏幕截图显示了使用上述 MWE 生成的第 2 页和第 3 页。

在此处输入图片描述


figuresright可以使用或关闭此默认行为figuresleft。前者将所有浮动元素独立于其页码进行旋转,使图形(表格)的底部位于右侧,而后者则以相反方向旋转。

以下 MWE 显示了如何使用figuresright包选项:

\documentclass[twoside]{article}
\usepackage[figuresright]{rotating}
\usepackage{graphicx}

\begin{document}
\begin{sidewaysfigure}
\includegraphics{example-image}
\caption{odd page figure}
\end{sidewaysfigure}
\clearpage

\begin{sidewaysfigure}
\includegraphics{example-image}
\caption{even page figure}
\end{sidewaysfigure}

\clearpage
\begin{sidewaysfigure}
\includegraphics{example-image}
\caption{odd page figure}
\end{sidewaysfigure}
\end{document}

以下屏幕截图显示了使用上述 MWE 生成的第 2 页和第 3 页。

在此处输入图片描述


在单面文档中,浮动元素默认旋转,底部指向右边距。可以使用包选项clockwise或更改此行为counterclockwise

相关内容