1

How to make section numbering of preface in document but NOT display in table of contents

enter image description here enter image description here

closed as unclear what you're asking by egreg, TeXnician, Mensch, Zarko, Troy Sep 24 '17 at 15:01

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • This might depend on the used class, so please add a complete MWE to your question. Also IMHO it is a bad idea to remove the numbering from ToC, as it helps orienting in a document a lot. – Skillmon Jul 26 '17 at 11:39
  • Did the solution work ? – PTRK Jul 27 '17 at 7:49
0

Maybe not the best way: put in your preamble

  \newcommand{\shadowsection}[1]{
    \stepcounter{section}
    \section*{\thesection\quad #1}
    \addcontentsline{toc}{section}{#1}
  }

Then when typing your document

\frontmatter
\chapter{Preface}
\shadowsection{Section in preface 1}
\shadowsection{Section in preface 2}

will give you the output : table of contents preface

  • 1
    This would require to change a complete document. There might be better ways, but as long as the OP doesn't say which packages and which class he uses, there is no way one could provide a clean solution, imho. – Skillmon Jul 26 '17 at 14:00
  • I agree. But since he was only asking for preface, maybe he wouldn't have to write the whole document again. – PTRK Jul 26 '17 at 14:03

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