Recently, I am writing a really long book. It spends almost several minutes to complie this tex file. So I have to find some methods to speed up compilation. I've tried some possible ways to speed up compilation, but the results don't seem obvious. For example, \usetikzlibrary{external} help me to reduce some time of compilation. Unchanged tikz figures do not need to be compiled repeatedly.
As far as I know, using precompilation seems to save compilation time even further, especially with some large packages.
Ultrafast PDFLaTeX with precompiling
My question:
I'm using vscode right now. How do I implement latex precompilation in Visual Studio code? (i.e. set up the settings.json)
Maybe some settings are, but I'm not sure:
"latex-workshop.latex.tools": [
{
"name": "etex",
"command": "etex",
"args": [
"-initialize",
"-interaction=nonstopmode",
"-jobname=\"pre\"",
"\"&pdflatex\"",
"mylatexformat.ltx",
"\"\"\"%DOC%\"\"\""
],
"env": {}
},
]
It come from the issue in LaTeX-Workshop. How to run a custom command? . But I don't know how it relates to precompilation. This may be related to the mylatexformat package.
Any help would be greatly appreciated.
\include + \includeonlyas that helps by only compiling selected parts of the code. – daleif May 03 '22 at 14:10\includeonlyto confirm the modification result. But eventually I had to run all the files at once, which took a few minutes. For some large packages (i.e.tikz), using precompilation may save a lot of time. – Huanyu Shi May 03 '22 at 14:16\usetikzlibrary{external}. Thanks agian for your reply. The best wishes for your. – Huanyu Shi May 03 '22 at 15:51