【问题标题】:Page numbers show up in table of contents, but NOT on pages页码显示在目录中,但不在页面上
【发布时间】:2019-04-24 00:30:51
【问题描述】:

页码正确显示在目录中,但不在页面上。如何让 LaTex 将它们显示在文档的页面上?

我尝试将文档类从报告更改为文章并添加 hyperref 包。

\documentclass[12pt]{report}
\usepackage[top=1in, bottom=1in, left=1in, right=1in]{geometry}
\usepackage{setspace}
\usepackage{hyperref}
\usepackage[usenames, dvipsnames]{color}
\usepackage{titling}
\usepackage{mathtools}
\usepackage{times}
\usepackage{graphicx}
\usepackage{amsfonts}
\usepackage{booktabs}
\usepackage{hyperref}
\setlength{\droptitle}{-5em}
\setlength{\parindent}{1cm}
\renewcommand{\thesection}{\arabic{section}}
\begin{document}
\thispagestyle{empty}
\newpage
\tableofcontents
\thispagestyle{empty}


\newpage
\doublespacing
\setcounter{page}{1}

【问题讨论】:

标签: latex tex


【解决方案1】:

在这个最小的例子中,我确实得到了页码,都用于文档类文章作为报告:

\documentclass{report}
% \documentclass{article}
\begin{document}
\tableofcontents

\section{one}
\newpage
\section{two}
\newpage
\section{three}
\newpage
\end{document}

您可能无法获得页码,因为您使用\thispagestyle{empty} 明确说明了这一点。报告还可以将(一章的)第一页定义为没有规则的头和脚的页面,因此也没有编号。

Hyperref 与(打印的)页码无关。

【讨论】:

  • 当我删除 \thispagestyle{empty} 时,页码显示在目录页的底部,但仍然不在文档的其余部分
  • @serpentina 很难说。请edit您的问题并包括minimal reproducible example。或者试试我上面的代码,如果可行,调整你的匹配。
  • 当删除更多\thispagestyle{empty} 并插入\pagenumbering{gobble} 时,它起作用了。谢谢!
猜你喜欢
  • 2016-09-18
  • 2017-02-23
  • 2012-09-21
  • 1970-01-01
  • 2014-05-25
  • 2016-04-15
  • 1970-01-01
  • 1970-01-01
  • 2013-09-02
相关资源
最近更新 更多