\chapter*{Introduction} 带有自定义标题,不带“第 0 章”

\chapter*{Introduction} 带有自定义标题,不带“第 0 章”

我希望第一章*页面“简介”的格式为\pagestyle{plain},同一章的后续页面的标题如下(如果可以选择大写和小写):在此处输入图片描述

当我尝试这样做时出现了问题,我得到了带有此标题的章节页面而不是普通的页面样式:

在此处输入图片描述


梅威瑟:

\documentclass[a4paper,12pt]{report}
\usepackage{fancyhdr}
\usepackage{lipsum}
\usepackage[hidelinks]{hyperref}

\pagestyle{fancy}

\renewcommand{\chaptermark}[1]{%
    \markboth{\MakeUppercase{%
            \chaptername}\ \thechapter.%
        \ #1}{}}

%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%

\begin{document}
    
    
    %%%%%%%%%%%%%%%%%%%%
    %%%%%%%%%%%%%%%%%%%%
    
    \pagenumbering{roman}
    
    \thispagestyle{plain}
    
    \phantomsection
    \section*{Resum}
    \addcontentsline{toc}{section}{Resum}
    \lipsum[1]
    \clearpage
    
    \tableofcontents
    \pagestyle{headings}
    \clearpage
    
    \phantomsection
    \addcontentsline{toc}{chapter}{\listfigurename}
    \listoffigures
    \pagestyle{headings} %for the next pages of the list of figures
    
    \clearpage
    
    %%%%%%%%%%%%%%%%%%%%
    %%%%%%%%%%%%%%%%%%%%
    \fancyhf{}
    \fancyhead[L]{\chaptername}
    \fancyhead[R]{\thepage}
    %%%%%%%%%%%%%%%%%%%%
    %%%%%%%%%%%%%%%%%%%%
    \pagestyle{plain}
    \chapter*{Introducció}
    \addcontentsline{toc}{section}{Introdució}
    \chaptermark{Introducció}
    \thispagestyle{headings}
    \lipsum[1-4]

\end{document}

答案1

好的,我解决了:

\documentclass[a4paper,12pt]{report}
\usepackage{fancyhdr}
\usepackage{lipsum}
\usepackage[hidelinks]{hyperref}

\pagestyle{fancy}

\renewcommand{\chaptermark}[1]{%
    \markboth{\MakeUppercase{%
            \chaptername}\ \thechapter.%
        \ #1}{}}

%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%

\begin{document}
    
    
    %%%%%%%%%%%%%%%%%%%%
    %%%%%%%%%%%%%%%%%%%%
    
    \pagenumbering{roman}
    
    \thispagestyle{plain}
    
    \phantomsection
    \section*{Resum}
    \addcontentsline{toc}{section}{Resum}
    \lipsum[1]
    \clearpage
    
    \tableofcontents
    \pagestyle{headings}
    \clearpage
    
    \phantomsection
    \addcontentsline{toc}{chapter}{\listfigurename}
    \listoffigures
    \pagestyle{headings} %for the next pages of the list of figures
    
    \clearpage
    
    %%%%%%%%%%%%%%%%%%%%
    %%%%%%%%%%%%%%%%%%%%
    \pagestyle{fancy}
    \fancyhf{}
    \fancyhead[L]{\slshape{INTRODUCCIÓ}}
    \fancyhead[R]{\thepage}
    %%%%%%%%%%%%%%%%%%%%
    %%%%%%%%%%%%%%%%%%%%
    \chapter*{Introducció}
    \addcontentsline{toc}{section}{Introdució}
    \chaptermark{Introducció}
    \lipsum[1-4]
    
\end{document}

相关内容