0

I am writing my PhD thesis and the pages have their headings set with \chaptertitle and \sectiontitle. However, I have included a special chapter on which I don’t want to include any numbering so I am using \section*{} and \addcontentsline{toc}{section}{} commands but my problem is that the headings in the pages keep the last numbered section.

Does anybody know how to manually redefine the command \sectiontitle?

If it is of help I have found this topic but I do not get any difference. https://stackoverflow.com/questions/39238993/latex-get-the-name-of-an-unnumbered-subsection

Thank you in advance to everybody.

2
  • What page style do you use? Have you looked at \sectionmark?
    – user94293
    Commented Dec 5, 2019 at 12:14
  • Thank You for your answer! I am using my institution latex format which uses \newpagestye and \sethead, so switching to another style seems a lot of work, but if I don't get to solve this issue you have pointed me to a great alternative! Commented Dec 5, 2019 at 12:53

1 Answer 1

0

At the end I solve the issue by myself, and I think it is fair to share what I learned. I didn’t get to change the value of \sectiontitle but I did the following work around which is a valid solution for me. I created a new variable which would take the value of the section title, and I also created a Boolean variable that would tell the header which \sectiontitle to use, so the solution has this form:

\newcommand{\sectiontitleA}{ }  % define the new section title command and leave it at blank
\newif\ifsectiontitleA          % Boolean variable
\sectiontitleAfalse             % Initialized to zero. 
\makeatletter                   % I don’t know why I do it this way but I think it is correct
\newenvironment{myseccc}[1]{    % I define the new enviroment
\renewcommand{\sectiontitleA}{#1}   % Modify the section title
\section*{#1}                   % Create section without numbering
    \sectiontitleAtrue          % Set the Boolean variable to use the new section title
    \addcontentsline{toc}{section}{#1}  % Add content to TOC
}
\makeatother

And the header of the pages is defined as:

\newpagestyle{esitscCD} % Page style of my institution
{
    \esirulehead        % whatever
    \sethead[\numpagpar % If the page is an even number print chapter title
     \;\ chaptertitle ][][]
    {}{}{               % If not print the \sectiontitle or \sectiontitleA depending on ifsectiontitleA
        \ifsectiontitleA \sectiontitleA \else \sectiontitle \fi \numpagodd
}

At the end of the special chapter is needed the command \sectiontitleAfalse so it keeps printing the \sectiontitle of the following chapters. I understand that this is not the optimal solution but I hope it helps someone else. However if you read this post and know a better way to do this please share it, and I hope I am still in time to use it in PhD thesis.

You must log in to answer this question.

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