將論文章節拆分為單獨的檔案以提高編譯速度

將論文章節拆分為單獨的檔案以提高編譯速度

我正在使用類似的模板寫一篇論文這個模板。主文件(dissertation.tex)用於\include{}包含每一章。我有一個很大的章節(60 多頁,70 張圖片),需要 30 秒以上的時間來編譯和檢視。我想將本章分成兩個文件,chapter4part1 和chapter4part2,以便我可以編譯和查看我正在處理的部分。

我嘗試過使用\includeonly{},\input{}subfiles包,但無法比原始版本更快地編譯和查看。有沒有辦法建立我的文件和命令以快速編譯和查看 Chapter4part1?

編輯:澄清問題以說明我想將一章分成兩份文件。

答案1

你沒有提到你有什麼樣的論文、圖片等等,所以我就用我得到的。我將這兩個部分放入環境中並\excludecomment使用該comment包。

在此輸入影像描述

\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}

為了完整起見,我還將包含一些外部化圖像的內容(如問題評論中所述)。下面這張圖沒有任何意義。我只是想使用至少有一些編譯時間的東西。您需要pdflatex使用 shell 轉義選項運行(或論文所需的任何引擎)才能使用此方法。

\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}

答案2

你看過嗎http://www.howtotex.com/tag/faster-latex/

我認為您已經嘗試了“第一部分”中的所有內容,因此您應該看看“第四部分”。

我想編譯速度很大程度取決於所包含的軟體包。透過編譯文件的部分內容,您還可以包含所有需要的套件。因此,製作它們static可以提高文件的編譯速度。

編輯:如果可以的話,您也可以使用draftmode-\documentclass[draft]來刪除圖片。看:草稿模式有何變化?

相關內容