1

First of all I would like to thank everyone here for being so helpful this website is doing a really great job helping new people fall in love with latex. I have another question. I have to put a few tables in landscape mode since they are to big to look nice in normal portrait mode. I would also like to have my header and page numbering on that page as well. Can anyone guide me in how to do this. With a simple code. I am actually scared of ruing my current document so I am going to make it on a separate file and then add it with a PDF tool later into my original document. So i would probably need to add custom numbering to those page. I am providing the code I used from a user here for my header and number can you guys tell me how to add a custom number in here for example if the landscape table is on 23rd page. Also I am adding an image of how I want my page to look with a table in landscape. Thanks alot

How I want my page to look

and here is the code where I want to put custom numbers

\usepackage{fancyhdr}
\usepackage[margin=0.75in,head=2cm,top=1.5cm,bottom=2.5cm,includehead]{geometry}
\usepackage{lastpage}
\usepackage{graphicx}
\renewcommand{\headrule}{}% to remove the line
\lhead{\includegraphics[width=6cm]{lol.png}}% use your logo
\rhead{%
\begin{minipage}[b]{5cm}
\flushright
\today\\
IND/Q-85/15 \\
Page \thepage{} of \pageref{LastPage}
\vspace{6mm}
\end{minipage}}
\cfoot{}

I think I would need to change the '\thepage{}' with a normal 23 if it was the 23rd page I am not sure though =/. Sorry if I am asking a very easy question.

3

See, if the following example can help you:

\documentclass{book}
\usepackage{fancyhdr}
\usepackage[margin=0.75in,head=2cm,top=1.5cm,bottom=2.5cm,includehead]{geometry}
\usepackage{lastpage}
\usepackage{graphicx}
\renewcommand{\headrule}{}% to remove the line
\lhead{\includegraphics[width=6cm,height=2cm]{example-image.png}}% use your logo
\rhead{%
\begin{minipage}[b]{5cm}
\flushright
\today\\
IND/Q-85/15 \\
Page \thepage{} of \pageref{LastPage}
\vspace{6mm}
\end{minipage}}
\cfoot{}

    \usepackage{rotating}
    \usepackage{afterpage}
    \usepackage{lipsum}

\begin{document}
\chapter{Forst chapter}
\pagestyle{fancy}
\lipsum[1]

\section{First section}
\lipsum[2-4]

\afterpage{\clearpage}
    \begin{sidewaystable}
\caption{my biggggggggggggggggggggg table}
    \begin{tabular}{|c|c|c|}
    \hline
this table is to wide to be fit in text width
    &   this table is to wide to be fit in text width
        &   this table is to wide to be fit in text width\\
    \hline
    \end{tabular}
\end{sidewaystable}
\lipsum[5-13]

    \section{Second section}
    Second section follows immediately  after end of the first section! 
As you can see, the first page, where is the begin of chapter, 
there is no heading as on the other pages. This is defined 
by \verb+\chapter+ style (as it is default defined in document class "book".


\lipsum[12-13]

    \end{document}

For "landscape" table I use package rotating and its environment sidewaystable. Package afterpage serves for move text on new page after sidewaystable.

Upgrade: In above MWE I added document division (chapter and two section) with intention to show how division of document on section looks.

  • after I finish the tables I start with a new page and a new section heading. But it goes all the way to the top like 3 pages back. How do I stop it from doing that? – Bakhtawar Khattak Jan 23 '16 at 18:13
  • Hm, I do not understand you. If you start with new page (with \newpage or \clearpage, then of course the section is on the top of page. For continuing text, you shouldn't star new page. It is difficult to me give an advice when I haven't relevant information, what you like to have. On basis of my further guessing, I will upgrade may answer. – Zarko Jan 23 '16 at 20:30
  • ok so in the page before where I add the tables it has a little bit of space... when I am done with the table section which is 3 pages..and start my new section heading.. it goes back 3 pages to where that empty space is... i want it to start after the table not go before the table.. i tried holding the [H] with the float package but it does not seem to work with tables or sections... – Bakhtawar Khattak Jan 23 '16 at 22:23
  • I'm afraid, that through your comments I'm not able to figure out, what is your problem. So I suggest you to formulate a new question with Minimal Working Example (MWE), for example based on MWE in my answer, which will show, what you like to achieve or expect to be desired result. – Zarko Jan 23 '16 at 23:44

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.