2

MWE:

\documentclass[lang=en,11pt]{elegantbook}
\usepackage{lipsum}


\title{Book Title}
\subtitle{Chapter and section at header alternatively}

\author{No author name given}
\institute{ABC}
\date{February 10, 2020}

\begin{document}

\maketitle

\frontmatter
\tableofcontents

\mainmatter
\chapter{First Chapter}
\lipsum[1]

\section{First Ection}
\lipsum[1-20]

\subsection{First Ection}
\lipsum[1]
\lipsum[1]

\end{document}

How can I get chapter name and section alternatively in elegantbook?

2
  • 1
    +1 For the nice MWE! Apr 10, 2021 at 4:42
  • 1
    @Dr.ManuelKuehner I like very much your comment for the "nice MWE": ihhihihihihiihhih :-) +1
    – Sebastiano
    Apr 10, 2021 at 19:50

1 Answer 1

3
  • Maybe this helps, I just used the option twoside in the document class.
  • According to the manual, the template is "[...] based on the Standard LATEX book class, so the options of book class work as well".

enter image description here


\documentclass[lang=en,11pt, twoside]{elegantbook} % <-- Modified
\usepackage{lipsum}

\title{Book Title}
\subtitle{Chapter and section at header alternatively}

\author{No author name given}
\institute{ABC}
\date{February 10, 2020}

\begin{document}

\maketitle

\frontmatter
\tableofcontents

\mainmatter
\chapter{First Chapter}
\lipsum[1]

\section{First Ection}
\lipsum[1-20]

\subsection{First Ection}
\lipsum[1]
\lipsum[1]

\end{document}

enter image description here enter image description here

3
  • @ Dr.ManuelKuehner Thank you very much for your answer. If I would like to get chapter name with chapter number like "1 First Chapter" not like "Chapter 1 First Chapter", what to do? Section at header is good.
    – Sofia
    Apr 10, 2021 at 5:01
  • Please ask a new question. But before you do that, do a Google search regarding the book class in Latex. Apr 10, 2021 at 5:23
  • @user239457 In case you were not pinged with my previous comment. BTW, I go offline now, it's 10:40 PM local time for me :). Just a guess, you are probably interested in tex.stackexchange.com/questions/120740. Apr 10, 2021 at 5:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .