# Compile only outline and comments/ Synopsis view

Since I am about to quit using orgmode for my PHD I am wondering whether something like a synopsis package exists (google didn't give me an answer about that).

What I need: I have a short synopsis of every chapter, section subsection... for myself to structure the dosument. Normally I do not want to export these. From time to time I'd like to read my document in it's full structure with only the synopses in it.

How it could be achieved (I am not into creating styles and doing wierd things in latex): - write the synopsis as comments and only process headings and comments during - have some special environment synopsis and porcess only outline and synopsis environment.

Any packages out there? Ideas of yours?

-

(See earlier edits if needed, but this is my cleanest version yet. References: Polyglot note-keeping?, comment package, TeX FAQ: Conditional compilation and “comments”)

This can be solved with a combination of the verbatim and extract packages. While building the PDF, the extract package will simultaneously create a synopsis.tex file with just the synopses and document divisions extracted. Build this synopsis.tex file, and you'll have your outline.

Original document source:

\documentclass{article}
% In this file, make a new comment-like environment named 'synopsis':
\usepackage{verbatim}
\let\synopsis\comment
\let\endsynopsis\endcomment
% Extract synopsis environments, \section commands, and \tableofcontents
% commands into a separate synopsis.tex file. In that file, a synopsis
% environment will be a simple semantic environment with no extra decoration.
\usepackage[active,
generate=synopsis,
extract-env={synopsis},
extract-cmd={section},
extract-cmdline={tableofcontents}]{extract}
\begin{extract}
\newenvironment{synopsis}{}{}
\end{extract}

% Here is the real document, with inline synopses:
\begin{document}
\tableofcontents
\section{Fourier Series}
\begin{synopsis}
A Fourier series is periodic, and made up of orthogonal $\sin$ and $\cos$ functions.
\end{synopsis}
The Fourier series has the form:
$\frac{a_0}{2} + \sum_{n=1}^{\infty} \left[ a_n \cos {\frac{2 n \pi}{T} t} + b_n \sin {\frac{2 n \pi}{T} t} \right]$
where $a_n$ and $b_n$ are called Fourier coefficients of the Fourier series
of the function $f(x)$.
\end{document}

Resulting PDF:

Generated synopsis.tex:

%%
%% This is file, `synopsis.tex',
%% generated with the extract package.
%%
%% Generated on :  2012/04/02,18:26
%% From source  :  50099.tex
%% Using options:  active,generate=synopsis,extract-env={synopsis},extract-cmd={section},extract-cmdline={tableofcontents}
%%
\documentclass{article}
\newenvironment{synopsis}{}{}

\begin{document}

\tableofcontents

\section{Fourier Series}

\begin{synopsis}
A Fourier series is periodic, and made up of orthogonal $\sin$ and $\cos$ functions.
\end{synopsis}

\end{document}

and PDF:

-
Sounds good to me. Do I need to define a "full" environment or is it enough to define the excludecomment? If I have to define environments of such length I will for sure run into trouble. I'll dowload the documentation anyway. Tanks a lot! – louis cypher Mar 30 '12 at 17:09
If you really want either synopses or the rest of the material, but never both, then the comment package would require a full environment as shown. Anything not in a comment-style environment would be included in both versions of the document. In the polyglot example, the math stayed outside the comment environment and was present in both documents, but the explanations were in one or the other comment types. – Mike Renfro Mar 30 '12 at 18:12
Hmm, that is what I found in the docu also. That does not look like a usable solution for me. I for sure will forget the \end{full} after several pages and mess the document up. If \begin{synopsis}would automatically close the full environment (it isn't an environment according to the docu.) BTW that package and it's docu seems to be ancient ;-/ – louis cypher Mar 30 '12 at 18:57
It is an environment, the extra \comment and \endcomment type of commands are how environments work on a lower level. Try \itemize \item Foo \enditemize in a regular document to see. Regardless, I don't know if there's any way of convincing LaTeX to suppress otherwise untagged content by default. – Mike Renfro Mar 31 '12 at 0:54