没有章节开始的页面上缺少页码

没有章节开始的页面上缺少页码

我目前正在写论文,发现我的pagenumbering。只有在新章节开始的页面上才有页码,后面的页面上缺少页脚。没有页脚的页面仍然会被计算,因为下一页有章节开始的页面有正确的页码。我试过使用解决方案,但对我来说不起作用。请参阅所附代码:

\documentclass[hidelinks, a4paper,12pt]{scrreprt}
\usepackage[left= 2.5cm,right = 2cm, bottom = 2.5cm, top=3cm]{geometry}
\usepackage[onehalfspacing]{setspace}

% ============= Packages =============
\usepackage[hidelinks]{hyperref}
\usepackage{hyperref}

\title{Thesis}
\author{name, name}
date{DD.MM.YYYY}


\hypersetup{
    pdftitle={NAMEOFREPORT},    % title
    pdfauthor={Name, Name},     % author
    pdfcreator={Name, Name},    % creator of the document
        %hidelinks  %somehow doesnt work
        colorlinks=true,
        linkcolor=black,
        citecolor=black,    
        filecolor=black,
}

% Standard Packages
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage{graphicx, subfig}
\graphicspath{{img/}}
\usepackage{fancyhdr}
\usepackage{lmodern}
\usepackage{color}
\usepackage{setspace}
\usepackage{acronym}
\usepackage{listings}
\usepackage{amsfonts}
\usepackage{amsmath,amssymb}

%Arial if wanted
%\usepackage{uarial}
%\renewcommand{\familydefault}{\sfdefault}

%Acronyms
\usepackage{acronym} %[nohyperlinks, printonlyused, withpage, smaller]


% Table of Contents formatting
\usepackage{tocloft}
\renewcommand{\cftpartleader}{\cftdotfill{\cftdotsep}} % for parts
\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}} % for chapters


% Spacing
\onehalfspacing


% Parindent
\setlength{\parindent}{0pt}


% ============= Header / Footer =============
\pagestyle{fancy}
%
\lhead{}
\chead{}
\rhead{Some title here} %Alt:\rhead{\slshape \leftmark}
%
\lfoot{}
\cfoot{\thepage}
\rfoot{}
%%
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0pt}

%Hyphenation
\hyphenation{De-zi-mal-tren-nung}


% ============= Document start =============

\begin{document}
%No header /footer
\pagestyle{empty}

\include{01_title}
\cleardoubleoddpage

% pagestyle
\pagestyle{fancy}
\pagenumbering{Roman}
\sloppy

%TOC ETC

%TOC
\addcontentsline{toc}{chapter}{Table of Contents}
\tableofcontents
\cleardoublepage


%Figures
\cleardoublepage
%\phantomsection
\addcontentsline{toc}{chapter}{\listfigurename}
\listoffigures


%Tables
\cleardoublepage
%\phantomsection
\addcontentsline{toc}{chapter}{\listtablename}
\listoftables
\cleardoublepage


%Abbreviations
\addcontentsline{toc}{chapter}{List of Abbreviations}
\include{acronyms}
\cleardoublepage


%arabic numbering following
\pagenumbering{arabic}

\include{02_some_input}

\end{document}

02_some_input文件:

\chapter{Some chaptername here}
\label{chap:chap_name}
\section{Some section}
\label{sec:section}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy     
eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam 
voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita 
kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem 
ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod 
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. 
At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd 
gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem 
ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod 
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. 
At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd 
gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.   

Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie 
consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et 
accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit 
augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, 
consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut 
laoreet dolore magna aliquam erat volutpat.   

Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit 
lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure 
dolor in hendrerit in vulputate velit esse molestie consequat, vel illum 
dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio 
dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te 
feugait nulla facilisi.   

Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet 
doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, 
consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut 
laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam,                 
quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex 
ea commodo consequat.   

Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie 
consequat, vel illum dolore eu feugiat nulla facilisis.   

At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd 
gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem 
ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod 
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. 
At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd 
gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem 
ipsum dolor sit amet, consetetur sadipscing elitr, At accusam aliquyam diam 
diam dolore dolores duo eirmod eos erat, et nonumy sed tempor et et invidunt 
justo labore Stet clita ea et gubergren, kasd magna no rebum. sanctus sea sed 
takimata ut vero voluptua. est Lorem ipsum dolor sit amet. Lorem ipsum dolor 
sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt 
ut labore et dolore magna aliquyam erat.   

Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore 
et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et 
justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata 
sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, 
consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore 
et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et 
justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata 
sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, 
consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore 
et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et 
justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata 
sanctus.   
Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit 
lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure 
dolor in hendrerit in vulputate velit esse molestie consequat, vel illum 
dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio 
dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te 
feugait nulla facilisi.   

Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet 
doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, 
consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut 
laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam,                 
quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex 
ea commodo consequat.   

Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie 
consequat, vel illum dolore eu feugiat nulla facilisis.   

At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd 
gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem 
ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod 
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. 
At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd 
gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem 
ipsum dolor sit amet, consetetur sadipscing elitr, At accusam aliquyam diam 
diam dolore dolores duo eirmod eos erat, et nonumy sed tempor et et invidunt 
justo labore Stet clita ea et gubergren, kasd magna no rebum. sanctus sea sed 
takimata ut vero voluptua. est Lorem ipsum dolor sit amet. Lorem ipsum dolor 
sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt 
ut labore et dolore magna aliquyam erat.   

Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore 
et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et 
justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata 
sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, 
consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore 
et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et 
justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata 
sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, 
consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore 
et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et 
justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata 
sanctus.   

当我编译这些文件时,我得到以下结果: 在此处输入图片描述

如您所见,第一页有页脚,而第二页没有。有人知道如何解决这个问题吗?

在包含目录和列表的页面上,罗马字体的页码显示效果很好。只是页脚开始显示的部分。

答案1

哦,那真是一团糟。我的建议是:重新开始使用更干净的模板。你的模板问题很多,我认为你不需要里面的所有东西。下面是你的模板,其中删除了我认为你(现在)不需要的所有内容,并添加了你可能想要(但不必担心)的一些其他内容。你现在可以使用它,并在使用过程中扩展它。当你有任何问题时,你会在这个网站上找到帮助具体的问题。

更多说明:

  • 如果你使用KOMA 脚本(您的文档类别是scrreprt),我建议您查看其手册。手册内容非常丰富,您可以找到有关文档布局的大多数更改说明(包括修改页眉和页脚)。手册甚至还有德语版本。
  • 如果需要使用表格,请使用booktabs并查看其手册。
  • 如果需要使用数字和/或单位,请使用siunitx并查看其手册。
  • 如果需要化学公式,请使用mhchem并查看其手册。
  • 如果需要参考书目,请使用biblatex并在网上查找使用范例和介绍。
  • 一般来说,学习 LaTeX 时,大量阅读文档是有益的。

您问到的具体问题只是使用 不当修改页面样式的结果fancyhdr。删除修改后一切正常。使用 KOMA 脚本时,您不应使用fancyhdranyways,而应使用 KOMA 脚本的相应功能。


\documentclass[
        ngerman,
    ]{scrreprt}

\usepackage[T1]{fontenc}
\usepackage{lmodern}
\input{glyphtounicode}
\pdfgentounicode=1

\usepackage{babel}
\usepackage{microtype}
\usepackage[defaultlines=3, all]{nowidow}

\usepackage{graphicx}
\graphicspath{{./img/}}

\usepackage{amsmath,amssymb}

\usepackage[hidelinks]{hyperref}

\title{Thesis}
\author{name, name}
\date{DD.MM.YYYY}

\begin{document}

\maketitle

Hello World!

\end{document}

答案2

为了更加清楚,我在这里重写它。

章节的样式页面与使用样式的普通页面不同plain。当您定义:

\pagestyle{fancy}
%
\lhead{}
\chead{}
\rhead{Some title here} %Alt:\rhead{\slshape \leftmark}
%
\lfoot{}
\cfoot{\thepage}
\rfoot{}
%%
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0pt}

此新样式将用于chapter样式。要将其应用于整个项目,您必须重新定义plain所使用的样式。添加:

\fancypagestyle{plain}{
%
\lhead{}
\chead{}
\rhead{Some title here} %Alt:\rhead{\slshape \leftmark}
%
\lfoot{}
\cfoot{\thepage}
\rfoot{}
%%
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0pt}}

在序言中设置fancyhdr包。

相关内容