-1

In one file I have 2 tables. The first one is rotated correctly. The second is rotated in wrong 180 degrees. Please look code:

FIRST TABLE

\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}

SECOND TABLE:

\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}

This one is good

This should be rotated

6
  • 8
    I'd assume that you are using a twosided documentclass. The rotating package by default rotates tables depending on the page they are on (odd vs. even, right, vs. left). You can influence this behaviour by one of the following options: figuresright, figuresleft, counterclockwise and clockwise. See section '2.1 Package options' of the rotating manual.
    – leandriis
    Commented May 7, 2018 at 18:43
  • @leandriis Where do I need to insert that options(in preamble or where I declared table) . You are right, it is 2 sided doc. Could you give me which code I need to insert
    – John988
    Commented May 7, 2018 at 21:53
  • 2
    As these are package options that globally change the behaviour of the package they are used in the preamble as follows: \usepackage[figuresright]{rotating}
    – leandriis
    Commented May 8, 2018 at 5:45
  • 1
    @leandriis I think that you should post your comment as an answer since it is the solution to the OP problem. Maybe just include an example to make the OP understand better where to put what. I would anwer myself but I don't want to steal your glory
    – gvgramazio
    Commented May 8, 2018 at 13:30
  • 2
    @John988 please, even if the comment by leandriis or any answer in the future resolve your problem, edit your question including a MWE for future readers.
    – gvgramazio
    Commented May 8, 2018 at 13:33

1 Answer 1

3

With the rotating package and the twoside option of a documentclass, sidewaysfigures and sidewaystables are by default rotated depending on the page number they are on. Floats are rotated so that the bottom of the image(table) is at the outer margin, meaning that floats on even pages are rotated clockwise (bottom on the left) and floats on odd pages are rotated counterclockwise (bottom on the right).

The following MWE demonstrates the default behaviour:

\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}

The following screenshot shows page 2 and 3 that are produced with the above MWE.

enter image description here


This default behaviour can be turned off by using either the figuresright or figuresleft package option. The former rotates all floats independent from their page number in a way that the bottom of the figure (table) is at the right, while the latter rotates in the opposite direction.

The following MWE shows how to use the figuresright package option:

\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}

The following screenshot shows page 2 and 3 that are produced with the above MWE.

enter image description here


In single-sided documents, floats are by default rotated with their bottom pointing to the right margin. This behaviour can be altered by using the package options clockwise or counterclockwise.

You must log in to answer this question.

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