I'm currently compiling a document using xelatex.
I've included a lot of packages that I think slow it down.
Here's my preamble:
\documentclass{article}
\usepackage{cite}
\usepackage{pdfpages}
\usepackage{textcomp}
\usepackage{wasysym}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{ruby}
\title{TITLE}
\author{ME}
\date{TODAY}
\usepackage{ifxetex}
\ifxetex
\usepackage{unicode-math}
\setmainfont[Numbers=OldStyle, Ligatures={Contextual},StylisticSet={1}]{Calluna}
\usepackage{xeCJK}
\setCJKmainfont{EPSON 正楷書体M}
\setCJKsansfont{EPSON 丸ゴシック体M}
\setmainfont{Calluna}
\setsansfont{Calibri}
\else
\usepackage[T1]{fontenc}
\fi
Is my inclusion of so many packages making xelatex take forever? How can I reduce the compile time of my document?
I think the problematic package is unicode-math, as compile time on other documents using this package is also long.
unicode-math. I'm not sure what else somebody might say. In truth, XeTeX is slow no matter what in comparison with traditional TeX or pdfTeX. But for a long document, the vast majority of the compile time is almost certainly due to the content ofdocumentunless you load all the packages there are or something. Do you wanttextcompwhen using XeTeX? What's the point of testing for XeTeX in this case? If the document needsxeCJKthen[T1]{fontenc}won't cut it. So why not eliminate the conditional? – cfr May 25 '16 at 02:21unicode-mathandxeCJKmay overlap); b) a workaround so that I can keep all my packages but don't have to e.g. compile all parts of the file each time, c) a better way of doing things overall because I'm a noob. I had the if statement because sometimes I use my organisation's computers that don't have xetex or some of the fonts I need. Is there a way of making CJK available regardless of compiler/packages? – jamesh625 May 25 '16 at 02:47\includeonlyif you are using\includeor using\includeif you are not. Consider addingdraftto your class/package options. Consider externalising pictures if you use e.g. PGF/TikZ. Don't use your editor's quick build or whatever if it automatically runs additional tools, especially if it isn't very smart about it. – cfr May 25 '16 at 03:03\setmainfonttwice? – cfr May 25 '16 at 03:04\setmainfonttwice. I was under the impression that bothunicode-mathandxeCJKallow me to do this, for different environments. I.e., the first affects how fonts are displayed in maths environments and the second in text. I'm assuming that this is not the case because I commented outunicode-mathsand the fonts appear unaffected. However, compile time was not significantly reduced. Additionally, compiling withoutpdfpagesdid not reduce compile time. – jamesh625 May 25 '16 at 03:12waysysymandtextcompbecause they weren't being used. – jamesh625 May 25 '16 at 03:12(filename.auxwhich is where the aux file is read at\begin{document}obviously the only way to speed up package loading is to load less packages. If you mean the run time for the rest of the document, it depends what is in the document which you have not shown. Also how slow is slow? when I started to use latex 15 minutes per page was quite common. – David Carlisle May 25 '16 at 08:27draftas an option on\includepdfreduces compile time to about 10 seconds. Commenting out the\includepdfreduces it to about 5. – jamesh625 May 26 '16 at 04:36