0

I am finding it difficult to organise the content after using the {rotating} package along with \begin{sidewaysfigure}. The images jump over to the next section while the table gets displayed before the image. What should I be doing to control the sequence of the content. I 've tried adjusting the width to even 0.5\textwidth. that doesn't work. Here is the minimal working code sample

\documentclass[hidelinks,a4paper,12pt]{article}
\usepackage[left=2in, right=1in, top=1in, bottom=1in]{geometry}
\usepackage[table]{xcolor}
\usepackage{graphicx}
\usepackage{sectsty} %to customise headings
\usepackage{times} %this is for the selection of font
\usepackage{float}
\usepackage{fancyhdr}   
\usepackage[ampersand]{easylist}
\usepackage{amssymb}
\usepackage{enumitem}   
\usepackage{caption} \captionsetup[table]{singlelinecheck=false, margin=1em}
%\usepackage{tabu}
\usepackage{longtable}
\usepackage{booktabs}
\usepackage{eso-pic}
%\usepackage{transparent}
\usepackage{pdfpages}
\usepackage{tocloft}

%\usepackage{ltablex}
\setlength{\LTpre}{0pt}
\setlength{\LTpost}{-15pt}

\usepackage{array}
\usepackage{tabularx}

\usepackage{rotating}
\usepackage{tikz}


\begin{document}

\section{Section 1}

\begin{sidewaysfigure}
    \centering
        \begin{figure}[H]
        \centering
        \includegraphics[ width=\textwidth , keepaspectratio ]{MainScreen.png}\\[-1em]
        \caption{Customer Login Screen}
        \vspace{0.25cm}
        \label{fig:2}
        \end{figure}        
\end{sidewaysfigure}

\begin{center}
    {
    \setlength{\extrarowheight}{2pt}

    \newcolumntype{b}{X}
    \newcolumntype{s}{>{\hsize=.4\hsize}X}
    \newcolumntype{t}{>{\hsize=1.3\hsize}X}

    \renewcommand\thetable{2}                   
    \captionof{table}{ \textbf {\small {Customer Login Screen}}} \label{table:2}
    \vspace{0.25cm}

    \begin{tabularx}{\textwidth}{ | >{\ttfamily\raggedright\arraybackslash} s 
    | >{\ttfamily\raggedright\arraybackslash} t 
    | >{\ttfamily\raggedright\arraybackslash} t | }

    \hline

    {\textbf{\textcolor{black}{{Sr. No.} \newline}}} & {\textbf{\textcolor{black}{{Input Element}}}} & \textbf{\textcolor{black}{{Description \& Behaviour}}} \\

    \hline
    1.0 & Username Input Field & Textbox to accept registered username. Email ID or any other unique attribute shall not be accepted \\
    \hline      
    2.0 & Password Input Field & Textbox to accept password associated with the Username  \\
    \hline       
    3.0 & Submit Button & To post the Username and password entered by the user to the server  \\
    \hline  
    4.0 & Alert & To notify User of incorrect or empty Username and / or password or an expired User session  \\
    \hline                                                              
    \end{tabularx}
    }
\end{center}

\begin{sidewaysfigure}
    \centering
        \begin{figure}[H]
        \centering
        \includegraphics[ width=\textwidth , keepaspectratio ]{LoginValidation.png}\\[-1em]
        \vspace{0.25cm}
        \caption{Customer Login Screen - Alert}
        \label{fig:2}
        \end{figure}
\end{sidewaysfigure}

\section{Section 2}

\end{document}

I am using PDFLatex to compile using Texstudio. Would appreciate suggestions. Thanks!

  • Hello. Its depends on the size of the graphics(its alwasy not easy with many images and less test). Can you add the graphics? You can tr: The \cleardoublepage command ends the current page and causes all figures and tables that have so far appeared in the input to be printed. Maybe this command is too hard here... – Bobyandbob Feb 25 '17 at 11:23
0

As you define it in your text, the figures are floating elements (since you use the figure environment), whereas the tabular is a regular text element. Moreover, the images might have a size different from what you intend: setting the width (which will be the vertical extension) to \textwidth makes the images quite big, so they probably exceed the allowed percentage of a text that may be occupied by floats. Instead of fiddling with the placement parameters you can make the images also text elements, like that:

\begin{sideways}
  \begin{minipage}{0.5\textwidth}
  \includegraphics[ width=\textwidth , keepaspectratio ]{example-image-a}\\
  \captionof{figure}{Customer Login Screen\label{fig:1}}
  \end{minipage}
\end{sideways}

Note that the first \textwidth in the argument of minipage refers to the text width of the whole text, whereas the second one refers to the textwidth within the minipage.

  • Thanks a lot!. And I used width=\textheight instead of \textwidth to fit the images to the page. – user3809560 Feb 25 '17 at 11:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.