2

I am writing a thesis using a template similar to this template. The main file (dissertation.tex) uses \include{} to include each chapter. I have a large chapter (over 60 pages with 70 images) that takes over thirty seconds to compile and view. I want to split this chapter into two files, chapter4part1 and chapter4part2, so that I can compile and view just the part I am working on.

I have tried using \includeonly{}, \input{} and the subfiles package but have not been able to compile and view quicker than the original. Is there a way to structure my files and commands to quickly compile and view just chapter4part1?

Edit: clarified question to state I want to split one chapter into two files.

lockstep
  • 250,273
  • If it takes so long because you use TiKZ figures which are everytime compiled, try external tikzlibrary to just compile them when needed. Another solution could be to use standalone. – Ignasi Apr 17 '15 at 11:05
  • I think everyone has missed the point of my question. I want to split a chapter into two .tex files without a large compilation speed penalty. – Mowing Bar Apr 28 '15 at 10:07
  • Create a chapter4.tex which contains \chapter{Name of chapter} \input{chapter4part1} \input{chapter4part2} and comment or no one of these \input according what you want to see. – Ignasi Apr 28 '15 at 10:13
  • @Ignasi I have tried this but have suffered a large increase in the compilation time, even with all the answers provided to this question and others. Is there any other alternative? – Mowing Bar Apr 28 '15 at 16:06

2 Answers2

2

You don't mention what kind of thesis you have, pictures and so on, so I'm just going to go with what I got. I'd put the two parts in environments and \excludecomment them using the comment package.

enter image description here

\documentclass{article}

\newenvironment{partone}{}{}
\newenvironment{parttwo}{}{}

\usepackage{comment}
%\excludecomment{partone}
\excludecomment{parttwo}


\usepackage{filecontents}
\begin{filecontents*}{mychapter.tex}
\begin{partone}
Part one of your thesis
\end{partone}
\begin{parttwo}
Part two
\end{parttwo}
\end{filecontents*}

\begin{document}
Tableofcontents
\input mychapter.tex
Chapter 2,3,4,5

\end{document}

For completeness, I will also include something to externalize images (as mentioned in comments to the question). The image below doesn't mean anything. I just wanted to use something with at least some compilation time. You will need to run pdflatex (or whatever engine you require for your thesis) with the shell escape option to make use of this method.

\documentclass{article}

\usepackage{tikz}
\usepackage{tikz-3dplot}
\usetikzlibrary{external}
\tikzexternalize

\begin{document}
\tdplotsetmaincoords{65}{155}
\begin{tikzpicture}
    [scale=5,
        tdplot_main_coords,
        axis/.style={->,black,very thin},
        vector/.style={-stealth,black,thick },
        curve/.style={black,thin}]
    \coordinate (O) at (0,0,0);
    \draw[axis] (0,0,0) -- (1.2,0,0) node[anchor=north east]{$x$};
    \draw[axis] (0,0,0) -- (0,1.2,0) node[anchor=north west]{$y$};
    \draw[axis] (0,0,0) -- (0,0,1.2) node[anchor=south]{$z$};
    \draw[axis,dashed] (0,0,0) -- (-1.2,0,0) node[anchor=south west]{};
    \draw[axis,dashed] (0,0,0) -- (0,-1.2,0) node[anchor=south east]{};
    \tdplotsinandcos{\sintheta}{\costheta}{45}
    \draw[vector,green!80!black] (0,0,0) -- (.62*\costheta,.62*\sintheta,0) node[above=.27in,right=.03in] {\Large $\rho$};
    \tdplotsetthetaplanecoords{0}
    \tdplotdrawarc[curve,tdplot_rotated_coords,thick,magenta!80,<-]{(O)}{1}{0}{90}{}{}
    \node[magenta!80] at (.8,0,.8) {\Large$\phi$};
    \foreach \angle in {0,30,...,180}
    {
        \tdplotsinandcos{\sintheta}{\costheta}{\angle}%
        \coordinate (P) at (0,0,.62*\sintheta);
        \tdplotdrawarc[curve,very thin]{(P)}{.62*\costheta}{0}{180}{}{}
    }
    \tdplotsinandcos{\sintheta}{\costheta}{180}
    \tdplotdrawarc[curve,thick,cyan!80,->]{(P)}{.8*\costheta}{-90}{260}{}{}
    \node[cyan!80] at (.7,.7,0) {\Large$\theta$};
    \foreach \angle in {0,30,...,360}
    {
        \tdplotsetthetaplanecoords{\angle}
        \tdplotdrawarc[curve,tdplot_rotated_coords,very thin]{(O)}{.62}{0}{90}{}{}
    }
\end{tikzpicture}

\end{document}
1010011010
  • 6,357
0

did you have a look at http://www.howtotex.com/tag/faster-latex/

I think you already tried everything from "Part I", so you should look at "Part IV".

I guess that the compile speed depends a lot on the included packages. By compiling parts of the document you also include the all your needed packages. So making them static could improve the compile speed of your documents.

EDIT: If it's ok for you, you could also use draftmode - \documentclass[draft] to get rid of the pictures. see: What does the draft mode change?

aronadaal
  • 553