LaTeX: Optional section in the document title

I have a document in which I want to put an unnumbered section in my heading. I am using the fancyhdr package, and for a numbered section I would do something like this:

\lhead{\leftmark}

But this does not work with unordered partitions. I solve math problems in my document, so I don’t need section sections and numbered sections

Anyone who knows how to do this?

+3
source share
2 answers

Using

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

for your unnumbered section. (You should replace chapterwith what you are actually using.)

You can even try

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

but be careful - this can create some problems with TOC or links.

+5

-

\section*{}
\subsection*{}
\subsubsection*{}
+1

Source: https://habr.com/ru/post/1737946/


All Articles