sisl / tufte_algorithms_book

A template for textbooks in the same style as Algorithms for Optimization
350 stars 66 forks source link

Compiling only chapters #5

Closed BeastyBlacksmith closed 4 years ago

BeastyBlacksmith commented 5 years ago

you mentioned in the juliacon-talk that it is possible to compile chapters separately. How is this done?

tawheeler commented 5 years ago

Good question. You can simply comment out the sections in book.tex you don't want to compile.

IE something like:

\begin{document}
% \frontmatter
% \input{titlepage}
% \include{copyrightpage}
% \include{dedication}
% \forceheader{Contents}
% \tableofcontents
% \include{chapter/preface}
% \include{chapter/acknowledgments}

\mainmatter
\begin{jlcode}
    include("../support_code.jl")
\end{jlcode}
\include{chapter/introduction}

% Add additional include statements for your other chapters.
% \appendix
% \include{chapter/appendix}
% \solutions
% \backmatter
% \chapter*{References}
% \addcontentsline{toc}{chapter}{References}
% \forceheader{References}
% \printbibliography[heading=none]

% \forceheader{Index}
% \printindex

\end{document}

In Alg4Opt we had a separate .tex file for compiling standalone chapters, but we still used this simple comment-out technique.

johnnychen94 commented 5 years ago

What about pull_section.jl? I thought that's written for this purpose but I didn't had a chance to dig into it.

tawheeler commented 5 years ago

Oh, I forgot that I pushed that. I wrote that but never ended up using it. I find it much easier to just consistently compile the book and comment / uncomment.

BeastyBlacksmith commented 4 years ago

Closed by #14