Simple question here: how to make section headings invisible, but still get the correct list of sections in the TOC and headers ? e.g. on page 10, if I do a \section{New section}, I must not see the text "X. New section", but I still want the section to be in the TOC and in the \rightmark of the following pages, until a new section of course.

I'm using a minimalistic document (class article, with no package that are used to adjust section headings style)

  • Welcome to TeX.SE! Which document class do you use: book, report, ...? Also, do you already use a package (such as titlesec and sectsty) that may be used affect the appearance of sectioning headers. Finally, do you want to suppress the appearance of all sectioning headers (including subsections, subsubsections, etc) or "just" section-level headers? – Mico Aug 22 '12 at 15:33
  • Just section-level will be fine. – BigDawg Aug 22 '12 at 15:40
  • Will you use some sort of separator, other than the actual section name, to mark where one section ends and the next one begins? – Ricardo Aug 22 '12 at 16:19
  • No. The thing is that new sections will necessary be at the beginning of new pages, I just want to remove the "X. Section name", as it will already be written in the header (via fancyhdr) – BigDawg Aug 22 '12 at 16:45

Something like this:


  • Perfect ! I was missing the \sectionmark in what I tried before coming here. Thanks for the help. – BigDawg Aug 22 '12 at 17:18
  • 2
    Don't you have an issue that several \invisiblesection{} in row are linked to the same (wrong) pages in the TOC or don't appear there at all? – Anton Tarasenko Dec 11 '13 at 6:55
  • 1
    Just use \addcontentsline{toc}{section}{#1} – Boris Jan 15 '14 at 19:57
  • 1
    Then use \markboth{#1}{#1} – Boris Jan 16 '14 at 19:46
  • 2
    I got a separate subsection command to work simply by replacing section with subsection, but I am open to more elegant solutions. Here's the command: \newcommand\invisiblesubsection[1]{\refstepcounter{subsection} \addcontentsline{toc}{subsection}{\protect\numberline{\thesubsection}#1} \sectionmark{#1}} – Nagel Dec 19 '19 at 17:59

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.