1

I inserted a landscaped page in my document to containing large table. The pagination before, and after the landscape page appear correctly: 13, 15.

However, the page number on the landscaped page did not appear, just continued on following page.

The following code reproduce the issue:

\documentclass{report}
\usepackage[utf8]{inputenc}
\usepackage{booktabs}
\usepackage{pdflscape}
\usepackage{afterpage}
\usepackage{makecell}
\renewcommand{\theadfont}{\normalsize\bfseries}
\usepackage{tabularx}
\usepackage{blindtext}
\renewcommand\tabularxcolumn[1]{m{#1}}

\begin{document}

\chapter{Introduction}
\blindtext

\afterpage{
    \clearpage
    \thispagestyle{empty}
    \begin{landscape}
        \centering 
        \begin{table}
        \caption{A summary of previous studies and methods employed \textit{(*N/A = Not available)}.} 
        \label{distance-duration}
        \begin{tabularx}{\linewidth}{lccXcccr}
            \toprule
            \thead{Author(s)}  & \thead{modes\\ detected} & \thead{Classifier used}  & \thead{Features}   & \thead{Population}  & \thead{External\\ Data used}  & \thead{Period} & \thead{Accuracy} \\
            \midrule
        Author 1 & 4 & DT & distance, velocity \& acceleration statistics & 45 users [GeoLife] & No &6 months & 72.80\%\\
        \midrule
    Author 2 &5 & Fuzzy engine &  speed acceleration statistics &4,882 users &No &6.65 days & N/A\\
        \bottomrule
        \end{tabularx}
         \hfill
        \end{table} 
    \end{landscape}
    \clearpage
}

\chapter{Body}
\blindtext

\end{document}

How do I fix it?

1 Answer 1

1

You have \thispagestyle{empty} as part of your landscape page construction. That removes the headers and footers, so no page number will show up. Remove this and you'll see the page number in the usual spot.

If you wish to adjust the placement of the page number (since the page is in landscape), you could define a new page style or position it elsewhere using eso-pic. Using the latter suggestion, you can still use \thispagestyle{empty} and place the following additional code directly after it:

\AddToShipoutPictureBG*{%
  \AtPageLowerLeft{%
    \raisebox{\dimexpr.5\paperheight-.5\height}{%
      \makebox[.9\paperwidth][r]{%
        \rotatebox{90}{\thepage}
      }% \makebox
    }% \raisebox
  }% \AtPageCenter
}% \AddToShipoutPictureBG*

The above code puts \thepage 90% down the page. You can play around with different options of .9\paperwidth and place the page number to suit your needs.

enter image description here

3
  • Ah, yes it appears now. it need to change its position now.
    – arilwan
    Nov 14, 2019 at 21:21
  • @arilwan: I've added some code that you can use to position and place the page number.
    – Werner
    Nov 14, 2019 at 21:38
  • Thank you for detailed answer.
    – arilwan
    Nov 14, 2019 at 21:43

You must log in to answer this question.

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