我想从标题中删除“第 n 章”一词。我希望标题中只有章节标题,例如“简介”,而不是“第 1 章简介”。文档类别是报告。这是我的文档的完整代码;
\documentclass[a4paper,12pt,twoside]{report}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[nottoc]{tocbibind}
\usepackage[nottoc]{tocbibind}
\usepackage{titlesec}
\titleformat{\chapter}{\normalfont\huge\bf}{\thechapter}{20pt}{\huge\bf}
\renewcommand{\baselinestretch}{1.5}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{amsmath}
\usepackage{ccaption}
\usepackage{subcaption}
\graphicspath{{images/}}
\usepackage[a4paper, width=150mm, top=25mm, bottom=45mm, bindingoffset=6mm]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyhead[RO]{\leftmark}
\fancyhead[LE]{\rightmark}
\renewcommand{\chaptername}{}
\fancyhead[LO,RE]{\thepage}
\fancyfoot{}
\setcounter{secnumdepth}{4}
\pagenumbering{Roman}
\usepackage{cite}
答案1
如果要将章节名称保留在标题行中,请插入指令
\def\chaptermark#1{\markboth{\MakeUppercase{#1}}{}}
在序言中。
如果你不是想要将章节名称全部大写,请使用指令
\def\chaptermark#1{\markboth{#1}{}}
答案2
如果我很清楚你想要什么,那么很容易就能做到titleps
,下面是一个伴侣titlesec
:
\documentclass[a4paper,12pt,twoside]{report}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[nottoc]{tocbibind}
\usepackage[pagestyles]{titlesec}
\titleformat{\chapter}{\normalfont\huge\bfseries}{\thechapter}{20pt}{}
\renewcommand{\baselinestretch}{1.5}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{amsmath}
\usepackage{ccaption}
\usepackage{subcaption}
\graphicspath{{images/}}
\usepackage[a4paper, width=150mm, top=25mm, bottom=45mm, bindingoffset=6mm]{geometry}
\setcounter{secnumdepth}{4}
\pagenumbering{Roman}
\usepackage{cite}
\usepackage{lipsum}
\newpagestyle{ownstyle}{%
\sethead[\thesection. ~\MakeUppercase{\sectiontitle}][][\thepage]{\thepage}{}{\MakeUppercase{\chaptertitle}}
\setfoot{}{}{}
\headrule
}
\pagestyle{ownstyle}
\begin{document}
\chapter{Test chapter}
\section{A first section}
\lipsum
\end{document}