1

My latex document is becoming bigger and bigger. Today I no longer can compile it, it takes forever to compile but nothing changes.

I wonder should I write each chapter in a separate independent document?

Or is there an option to write everything in the same document and have it compiled fast, smoothly and easily? How?

PS: I use Texpad. Typesetting into pdf.

 \documentclass[french]{report}
    \renewcommand{\baselinestretch}{1.5} 
    \usepackage{babel}
    \usepackage[utf8]{inputenc}
    \usepackage[LGR,T1]{fontenc}
    \newcommand{\textgreek}[1]{\begingroup\fontencoding{LGR}\selectfont#1\endgroup}
    \usepackage[round]{natbib}
    \usepackage{makeidx}

    \usepackage[nottoc,notlot,notlof]{tocbibind}
    \usepackage{tocbibind}
    \usepackage{graphicx}
    \graphicspath{{my_images/}}
    \usepackage{hhline}
    \usepackage{makecell}
    \usepackage{import}
    \usepackage[section]{placeins}
    \usepackage{tabularx}

    \makeindex
    \setlength{\parskip}{1em}

    \interfootnotelinepenalty=10000

    \begin{document}

    \renewcommand\indexname{New Name Of Index}

    \renewcommand{\tablename}{Tableau}
    \newcolumntype{?}{!{\vrule width 1pt}}

    \input{Chapters/titlepage}

    \tableofcontents

    \chapter*{Introduction}
    \input{Chapters/Introduction}
    \addcontentsline{toc}{chapter}{Introduction}

    \chapter{Supports Théoriques}
    \input{Chapters/Chapter1}

    \chapter{Revue de littérature}
    \input{Chapters/Chapter2}

    \chapter{Méthodologie}
    \input{Chapters/Chapter3}

    \chapter{Méthodes}
    \input{Chapters/Chapter4}

    \chapter{Résultats}
    \input{Chapters/Chapter5}

    \chapter{Discussion}
    \input{Chapters/Chapter6}

    \chapter*{Conclusion}
    \input{Chapters/Conclusion}
    \addcontentsline{toc}{chapter}{Conclusion}

    \bibliographystyle{apalike-fr}
    \bibliography{Mabibliographie}
    \printindex

    \cleardoublepage
    % \phantomsection
    \addcontentsline{toc}{chapter}{\listfigurename}
    \listoffigures

    \cleardoublepage
    % \phantomsection
    \addcontentsline{toc}{chapter}{\listtablename}
    \listoftables


    \end{document}
7
  • 3
    If it no longer compiles you probably have an error and should correct it. Beside this you can use \include / \input to comment the parts you are currently not caring about -- and you certainly don't need to recompile the index and the bib all the time. Commented May 17, 2016 at 9:58
  • Thank you. But how can I avoid recompiling index and bib?
    – user105139
    Commented May 17, 2016 at 10:05
  • 3
    latex doesn't make the index and bibliography they are made by separate programs (makeindex or xindy and bibtex or biber normally) so if you are calling those programs every time just don't do that. Commented May 17, 2016 at 10:30
  • 1
    also what do you mean by "forever"? When I started using tex 15 minutes per page was common, I assume it is not taking that long? if you really mean "forever" and the job is not stopping then as Ulrike says you have an error in your document but impossible to guess what that is given no information. Commented May 17, 2016 at 10:33
  • 1
    You should post your code. Conflicts between packages, incorrect loading order of packages, infinite loops all are possibly slowing you down. But, if nobody sees it, nobody will be able to help. See meta.tex.stackexchange.com/q/3343/90087 for how to post an example.
    – A Feldman
    Commented May 18, 2016 at 2:02

1 Answer 1

4

Separate the document into pieces and put them into separate tex-files. These tex-files you include via \include.

After that, you uncomment only the part, you are working on. i.e.:

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[german]{babel}

\begin{document}
%\include{./chapter1.tex}
%\include{./chapter2.tex}
%\include{./chapter3.tex}
\include{./chapter4.tex} %What should be included

Some stuff, you are writing right now. Lots of text text text text text text.
\end{document}

That should work.

3
  • 9
    instead of commenting out the files you're not compiling in the current run, \includeonly allows you to specify the files you do wish to compile. Commented May 17, 2016 at 12:32
  • Not my taste, but good point. Commented May 19, 2016 at 23:16
  • On a modern machine there should be an error to find. Use the commenting out that @MaestroGlanz demonstrated to find which of your \input files is presenting the problem. After that see if you can find your error, if you then still cannot figure out the problem, make a copy of that file, add \usepackage{lipsum} replace your plain text with \lipsum and post it here for further help. 300 pages is really not a very long document for TeX to handle.
    – A Feldman
    Commented May 20, 2016 at 19:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .