论文标题

论文标题

我使用带有 documentclass{book} 的模板来编写我的论文,但不知何故页码编号混乱了,在某些页面中,页码位于页面中间(理应如此),而在某些页面中,页码位于页面顶部。因此,我使用 \usepackage{fancyhdr} 和 \pagestyle{fancy} 修复了这个问题,但现在页眉混乱了,例如: 在此处输入图片描述 这是一个“main.tex”代码示例:

\documentclass[12pt,a4paper,oneside,onecolumn]{book}
\usepackage[letterpaper, portrait]{geometry}
\usepackage{lipsum}
%SET AVERAGE MARGIN
\geometry{
left={4cm},
right={2cm},
top={1.5cm},
bottom={2.5cm},
}
\usepackage{layout}
\usepackage{fancyhdr}
\usepackage{libertine}
\usepackage{courier}
\usepackage[utf8x]{inputenc}
\usepackage[hebrew,english]{babel}
\usepackage[longnamesfirst,square,numbers,comma,sort&compress]{natbib}
\usepackage{titlesec}
\usepackage{float}
\usepackage{graphicx,caption}
\usepackage{amsmath}
\usepackage{mathpazo}
\usepackage{datetime}
\usepackage{hyperref}
\usepackage{bookmark}
%
\usepackage{float}
\usepackage{xcolor}
\usepackage{amssymb}
\usepackage{eufrak} 
\usepackage{accents} 
\usepackage{mathtools}
\usepackage{nicematrix}



\newcommand*{\bfrac}[2]{\genfrac{\lbrace}{\rbrace}{0pt}{}{#1}{#2}} %bar free fraction
\usepackage{romannum} %Roman numerals
\usepackage{bm}
%\addbibresource{ref.bib} %Imports bibliography file

\setlength{\parindent}{0pt}
\setlength{\parskip}{5pt}

\titleformat{\chapter}[hang]{\bf\huge}{\thechapter}{2pc}{}
\title{Thesis Template}

\begin{document}
%\layout


\include{cover}
\include{cover_heb}
\include{cover_sig}

\frontmatter
\pagestyle{fancy}

\include{Chapters/abstract_heb}
\include{Chapters/abstract}
\include{Chapters/table_of_abb}
\include{Chapters/acknowledgements}

\tableofcontents
\include{Chapters/table_of_symbols}
\listoffigures
\listoftables


\mainmatter
\pagestyle{fancy}

\input{Chapters/introduction}
\input{Chapters/previous_work}
\input{Chapters/Metasurface_analysis}
\input{Chapters/research_question}
\input{Chapters/methods}
\input{Chapters/results}
\input{Chapters/conclusion}

\section{}
\bibliographystyle{IEEEtran}
\bibliography{ref}

\end{document}

任何帮助都将受到赞赏。

答案1

像这样的东西(添加的代码是用命令命令的%here)可以解决你的问题(关于标题)。

\documentclass[12pt,a4paper,oneside,onecolumn]{book}
\usepackage[letterpaper, portrait]{geometry}
\usepackage{lipsum}
%SET AVERAGE MARGIN
\geometry{
left={4cm},
right={2cm},
top={1.75cm}, %here
bottom={2.5cm},
head={1.5cm}, %here
includehead %here
}
\usepackage{layout}
\usepackage{fancyhdr}
\usepackage{libertine}
\usepackage{courier}
\usepackage[utf8x]{inputenc}
\usepackage[hebrew,english]{babel}
\usepackage[longnamesfirst,square,numbers,comma,sort&compress]{natbib}
\usepackage{titlesec}
\usepackage{float}
\usepackage{graphicx,caption}
\usepackage{amsmath}
\usepackage{mathpazo}
\usepackage{datetime}
\usepackage{hyperref}
\usepackage{bookmark}
%
\usepackage{float}
\usepackage{xcolor}
\usepackage{amssymb}
\usepackage{eufrak} 
\usepackage{accents} 
\usepackage{mathtools}
%\usepackage{nicematrix}
\fancyhead[l]{} %here
\fancyhead[r]{} %here
\fancyhead[c]{\parbox[b]{\textwidth}{\parbox[b]{0.45\linewidth}{\rightmark}\hspace{\fill}\parbox[b]{0.45\linewidth}{\null\hfill\leftmark}}} %here

\newcommand*{\bfrac}[2]{\genfrac{\lbrace}{\rbrace}{0pt}{}{#1}{#2}} %bar free fraction
\usepackage{romannum} %Roman numerals
\usepackage{bm}
%\addbibresource{ref.bib} %Imports bibliography file

\setlength{\parindent}{0pt}
\setlength{\parskip}{5pt}

\titleformat{\chapter}[hang]{\bf\huge}{\thechapter}{2pc}{}
\title{Thesis Template}

\begin{document}
%\layout


\include{cover}
\include{cover_heb}
\include{cover_sig}

\frontmatter
\pagestyle{fancy}


\tableofcontents

\listoffigures
\listoftables


\mainmatter
\pagestyle{fancy}

\chapter{A Chapter}
\section{A section with a big name}
\newpage
\section{Another section with a much bigger name}


\end{document}

编辑

为了删除章节标题并仅保留章节,请尝试这样做:(一些不需要的代码,但这样您就可以灵活地进行更改)

\fancyhead[c]{\parbox[b]{\textwidth}{\leftmark}} %here

相关内容