为什么没有页码?

为什么没有页码?

简单来说,我不明白为什么这份文件没有页码。我一开始确实有“gobble”命令,但后来我切换到“arabic”。有什么想法吗?

\documentclass[12pt]{book}
\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
\usepackage{xltxtra}
\setmainfont{Junicode}
\usepackage[top=0.25in, bottom=0.25in, left=0.25in, right=0.5in]{geometry}
\geometry{papersize={4in, 6in}}
\usepackage{multirow,array,booktabs}
\usepackage[utf8]{inputenc}

\usepackage{titlesec}

\title{\Huge The Books of Day}
\author{D.R.F. Knackstedt}
\date{}

\begin{document}
\pagenumbering{gobble}
\maketitle
\newpage
\null
\vfill
\begingroup
\footnotesize
\parindent 0pt
\parskip  \baselineskip
Copyright \textcopyright{} 2016 by D.R.F. Knackstedt \par
All rights reserved. 

\hspace*{2cm} ISBN: 1523486988 \par
\hspace*{2cm} ISBN-13: 978-1523486984\par
\newpage
\pagenumbering{arabic}
\begin{center}
\begin{tabular}{|p{1.1in}|p{.15in}|p{1.45in}|}
\hline
\multicolumn{3}{|c|}{\multirow{2}{*}{\large  \textsc{Sunday.}}} \\
\multicolumn{3}{|c|}{ } \\
\multicolumn{3}{|c|}{\small Hours. for \underline{\hspace{0.5cm}}} \\
\textsc{Morning.} & 6 &  \\
\scriptsize{The \textit{Question.}} & 7 & \\
\scriptsize What good shall I do this day? & 8 & \\
 & 9 & \\
 & 10 & \\
 & 11 & \\
\textsc{Noon.} & 12 & \\
 & 1 & \\
\textsc{Afternoon.} & 2 & \\
 & 3 & \\
 & 4 & \\
 & 5 & \\
\textsc{Evening.} & 6 & \\
\scriptsize The \textit{Question.} & 7 & \\
\scriptsize What good have I done to-day? & 8 & \\
 & 9 & \\
 & 10 & \\
\textsc{Night.} & 11 & \\
 & 12 & \\
 & 1 & \\
 & 2 & \\
 & 3 & \\
 & 4 & \\
 & 5 & \\
 \hline
\emph{Notes} & \multicolumn{2}{|l|}{\tiny 1.}\\
\cline{2-3}
 & \multicolumn{2}{|l|}{\tiny 2.}\\
\cline{2-3}
 & \multicolumn{2}{|l|}{\tiny 3.}\\
\cline{2-3}
 & \multicolumn{2}{|l|}{\tiny 4.}\\
\hline
\end{tabular}
\end{center}
\newpage
\begin{center}
\begin{tabular}{|p{1.1in}|p{.15in}|p{1.45in}|}
\hline
\multicolumn{3}{|c|}{\multirow{2}{*}{\large  \textsc{Sunday.}}} \\
\multicolumn{3}{|c|}{ } \\
\multicolumn{3}{|c|}{\small Hours. for \underline{\hspace{0.5cm}}} \\
\textsc{Morning.} & 6 &  \\
\scriptsize{The \textit{Question.}} & 7 & \\
\scriptsize What good shall I do this day? & 8 & \\
 & 9 & \\
 & 10 & \\
 & 11 & \\
\textsc{Noon.} & 12 & \\
 & 1 & \\
\textsc{Afternoon.} & 2 & \\
 & 3 & \\
 & 4 & \\
 & 5 & \\
\textsc{Evening.} & 6 & \\
\scriptsize The \textit{Question.} & 7 & \\
\scriptsize What good have I done to-day? & 8 & \\
 & 9 & \\
 & 10 & \\
\textsc{Night.} & 11 & \\
 & 12 & \\
 & 1 & \\
 & 2 & \\
 & 3 & \\
 & 4 & \\
 & 5 & \\
 \hline
\emph{Notes} & \multicolumn{2}{|l|}{\tiny 1.}\\
\cline{2-3}
 & \multicolumn{2}{|l|}{\tiny 2.}\\
\cline{2-3}
 & \multicolumn{2}{|l|}{\tiny 3.}\\
\cline{2-3}
 & \multicolumn{2}{|l|}{\tiny 4.}\\
\hline
\end{tabular}
\end{center}

\end{document}

答案1

book班级用作headings默认页面样式。此页面样式仅提供页眉,不提供页脚(不使用twoside,如您的情况):

\def\ps@headings{%
  \let\@oddfoot\@empty
  \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
  \let\@mkboth\markboth
  \def\chaptermark##1{%
    \markright {\MakeUppercase{%
      \ifnum \c@secnumdepth >\m@ne
        \if@mainmatter
          \@chapapp\ \thechapter. \ %
        \fi
      \fi
      ##1}}}}

请注意,\@oddfoot设置为\@empty

这意味着页码应该显示在页眉中。之所以没有显示,是因为页眉超出了纸张/页面边界。如果您更改了geometry设置,您会看到它重新出现。例如,

\usepackage{geometry}
\geometry{papersize={4in, 6in}, margin=0.25in, right=0.5in, headsep=0pt}

消除标题和文本块之间的间隙

在此处输入图片描述

相关内容