2

could someone help me here. I am compiling a Latex document with pdflatex. The Process Exit normally. The Latex gives a pdf document of 4 Pages. But it takes around 2 min it. For a document of 20 pages, the program mostly crashes. I have to compile a document of 150 pages. Here is my preamble. Please could someone answer me?

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[margin=1in]{geometry}
%\usepackage[demo]{graphicx}

\usepackage{graphicx}
\usepackage{subfig}
%\graphicspath{Bilder-Promotion}
\usepackage{fancyhdr}
\usepackage{pdfpages}
\usepackage{caption}
\usepackage{float}
\usepackage{amssymb}
\usepackage{mathdots}
\usepackage[classicReIm]{kpfonts}
\usepackage{enumitem}
%\usepackage[dvips]{graphicx} %%% use 'pdftex' instead of 'dvips' for PDF output
%\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
%\addbibresource{mybib.bib}
\usepackage[english]{babel}
\usepackage{lmodern}
\usepackage{textcomp}
\pagestyle{fancy}
%\fancyhead[]
%\fancyfoot[]
\usepackage{amsmath}
%\includeonly{fundamental}
\usepackage{chemist}
%\includeonly{Intro,filename2,...}
\usepackage[colorlinks=true, breaklinks=true,citecolor=black,linkcolor=blue,
menucolor=black,urlcolor=blue]{hyperref}
%\usepackage{siunitx}
\usepackage{txfonts}
\usepackage[classicReIm]{kpfonts}
\usepackage{array,booktabs}
\usepackage{calc}
\numberwithin{table}{section}
\numberwithin{figure}{section}
\numberwithin{equation}{section}

\setlength{\parindent}{4em}
\setlength{\parskip}{1em}
\renewcommand{\baselinestretch}{1.5}
\usepackage{titling}

\makeatletter
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
            {-2.5ex\@plus -1ex \@minus -.25ex}%
            {1.25ex \@plus .25ex}%
            {\normalfont\normalsize\bfseries}}
\makeatother
\setcounter{secnumdepth}{4} % how many sectioning levels to assign numbers to
\setcounter{tocdepth}{4}    % how many sectioning levels to show in ToC
\usepackage{glossaries}
\makeglossaries         
%%%%%%%%%%%%%%%%%%%%%%%%%%%%liste des abréviations%%%%%%%%%%%%%%               
\usepackage[english]{nomencl}
\makenomenclature
\renewcommand{\nomname}{Liste des abréviations, des sigles et des symboles}
\tracingall
Carole
  • 21
  • 1
    Just joking, but perhaps you posted your question in the wrong location? https://tex.stackexchange.com/questions/122116/how-to-prolong-compilation-time-while-engaging-in-leisure-activities Welcome to the site. – Steven B. Segletes Oct 26 '17 at 18:55
  • 1
    (1) Please post a complete compilable document which exhibits the problem, not just a preamble. (Something taking 10 seconds is already a problem IMO and will suffice as an example.) (2) Are you sure you need \tracingall? Just printing out all that output should impose a nontrivial delay (though I doubt it explains your 30 seconds per page). – ShreevatsaR Oct 26 '17 at 19:03
  • 2
    \tracingall is not a good idea if you have no problem with your code –  Oct 26 '17 at 19:08

2 Answers2

9

From TeXbook, p. 121:

Plain TEX provides a macro ‘\tracingall’ that turns on every possible mode of interaction, including \tracingonline. The author used these features to check the answers to several of the exercises above.

It gives and writes so big amount of information, that it must take much time. Please compare the size of your *.log file with and without `\tracingall'.

7

Some numbers that may serve as a benchmark, on the overhead caused by \tracingall in different situations. These are just numbers from my laptop, but the relative numbers (the ratios) may be meaningful.

The source files used for testing are those of A Gentle Introduction to TeX, The Not So Short Introduction to LaTeX2ε and TeX by Topic.

  • Engine tex, format plain TeX (tex gentle.tex):

    • Without \tracingall (time tex '\input gentle' > out): ~0.14 seconds.
    • With \tracingall: (time tex '\tracingall \input gentle' > out): ~0.75 seconds.
    • Overhead of \tracingall: ~5.
  • Engine pdftex, format plain TeX (pdftex gentle.tex):

    • Without \tracingall (time pdftex '\input gentle' > out): ~0.36 seconds
    • With \tracingall): (time pdftex '\tracingall \input gentle' > out): ~1.15 seconds
    • Overhead of \tracingall: ~3.2.
  • Engine pdftex, format LaTeX (pdflatex lshort.tex):

    • Without \tracingall (time pdflatex '\input lshort' > out): ~4.5 seconds.
    • With \tracingall (time pdflatex '\tracingall \input lshort' > out): ~145 seconds.
    • Overhead of \tracingall: ~32.
  • Engine pdftex, format LaTeX (pdflatex TeXbyTopic.tex):

    • Without \tracingall (time pdflatex '\input TeXbyTopic' > out): ~1.3 seconds.
    • With \tracingall (time pdflatex '\tracingall \input TeXbyTopic' > out): ~33 seconds.
    • Overhead of \tracingall: ~25.

Overall, for LaTeX documents, it appears that using \tracingall can lead to a slowdown of a factor of about 25 to 30. This is because LaTeX does more of the kind of work that \tracingall shows (LaTeX has much more complicated macros, etc). [Note in my tests I used \tracingall before any of the packages were imported, which will surely skew the results relative to using it at the very end of the preamble.]

In your case, if we extrapolate from this 25–30 factor, then removing \tracingall may cut down your "around 2 min" to say around 4–5 seconds, for your 4-page document. I think this is still way too high, given that the entire 311-page TeXbyTopic book gets typeset in just over a second. So this is probably not the full explanation of the slowness (which is why I asked in a comment for a full compilable example). Still, simply removing \tracingall may go a long way.

ShreevatsaR
  • 45,428
  • 10
  • 117
  • 149