开发者

LaTeX: Unnumbered section in header of document

开发者 https://www.devze.com 2022-12-23 12:11 出处:网络
I have a document where I want to place an unnumbered section in my header. I use the fancyhdr package, and for a numbered section, I would had done something like this:

I have a document where I want to place an unnumbered section in my header. I use the fancyhdr package, and for a numbered section, I would had done something like this:

\lhead{\leftmark}

But this don't work with unnumbered sections. I'm solving math-problems开发者_运维百科 in my document, so I don't want part-sections and numbered sections

Anyone, who knows, how this is done?


Use

      \chapter*{Preface\markboth{Preface}{}}

for your unnumbered section. (You should replace chapter with whatever you are actually using.)

You can even try

\newcommand{\mysection}[1]{\section*{{#1}\protect\markboth{#1}{}}}

but be careful -- it may create some problems with TOC or references.


Is there anything wrong with

\section*{}
\subsection*{}
\subsubsection*{}
0

精彩评论

暂无评论...
验证码 换一张
取 消