0

I am using memoir to produce a book. I have many chapter files, which I can compile either standalone or with the entire book. (I did not manage to get minitoc to work with my markdown.sty authoring, but this is a different problem.)

There are times when I do not want to typeset my entire book but see only the outline---the chapters, sections, subsections, etc. I know I cannot know the page numbers, unless I fully typeset everything, but in those cases, I really don't care much about this. (Actually, some hint about how much text there is in the source of each subdivision [e.g., just count words], would be helpful.)

Right now, I have a perl script that does scans through my tex files and writes a standalone tex document that shows me the outline. But I wonder if there is a within tex solution (so that my coauthors [who are not perl and Dropbox savy] could use it on Overleaf, too).

Is there a latex package that can do this?

ivo Welch
  • 3,766

1 Answers1

2

I don't know of a package for this but have you considered the LaTeX \nofiles command which can tell LaTeX to not output (e.g., overwite) a file.

Here is a full document.

% synopsisprob.tex  SE 577076
\documentclass{book}
\usepackage{lipsum}
\begin{document}
\tableofcontents
\chapter{First chapter}
\lipsum[1]
\section{A section}
\lipsum[2]
\chapter{Second chapter}
\lipsum[1]
\section{Another section}
\lipsum[2]
\end{document}

Having processed the above MWE, this version only outputs the ToC.

% synopsisprob.tex  (revised) SE 577076
\documentclass{book}
\usepackage{lipsum}
\nofiles
\begin{document}
\tableofcontents
\end{document}
\chapter{First chapter}
\lipsum[1]
\section{A section}
\lipsum[2]
\chapter{Second chapter}
\lipsum[1]
\section{Another section}
\lipsum[2]
\end{document}
Peter Wilson
  • 28,066