I'm doing a book-class doc which is a collection of problems offered through some years.

So each chapter is a year, and it always has two sections: Problems, and Solutions. And I need them to NOT be numbered, BUT added to ToC (without number), and be present in the running head on the odd page.

secnumdepth doesn't do it, because subsections (the problems) are numbered

I've tried using \renewcommand{\thesection}{} but this only makes the numbers disappear, while the space that was between the section number and the header is preserved, so the section titles appear off in the ToC. The same space is present in the running head, and additionally, a full stop appears before the space in the running head.

I've also tried


which makes for an ok-looking ToC, but doesn't give me the running heads.

I understand that packages like titlesec and titletoc might help me, but I'd rather make it as standalone-ish as possible.

  • Welcome to TeX.SE! have you tried \markboth?
    – cmhughes
    Apr 21, 2013 at 15:35
  • 1
    Which document class do you use? If you use scrbook you can use \addchap Apr 21, 2013 at 15:41
  • @MarcoDaniel, I use \documentclass{book}. @cmhughes, you did it! \markright with \addcontentsline inserted into \section* does the trick! I somehow got the impression that only fancyhdr could change the running heads, totally forgot about the mark commands. Apr 21, 2013 at 16:45
  • ok, that's great :) - I'll flag it for a moderator as we have resolved it in the comments. Note that you can only 'ping' one person per message using the @ symbol :)
    – cmhughes
    Apr 21, 2013 at 20:14
  • @cmhughes Below I proposed a solution that doesn't require any manual intervention and that might be useful for the OP, so I would like to ask you not to flag the question. Apr 21, 2013 at 21:35

1 Answer 1


No need to use manually issue \markright and \addcontentsline commands after each section. Let LaTeX do all the work for you: redefine \thesection (and \thesubsection) appropriately; for example:


redefine \l@section to suppress the indentation for entries in the ToC; redefine \section to suppress the indent in the titles, and finally (re)define \sectionmark to give you the desired header:


\renewcommand\section{\@startsection {section}{1}{-1em}%
  {-3.5ex \@plus -1ex \@minus -.2ex}%
  {2.3ex \@plus.2ex}%
      \markright {\MakeUppercase{#1}}}



\subsection{First problem}


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.