GeneralFaster Compiling in Multifile Documents

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
LaTexLearner
Posts: 139
Joined: Tue Mar 10, 2015 11:06 am

Faster Compiling in Multifile Documents

Post by LaTexLearner »

I've figured out how to use the \include and \input commands to organize a large project.

I'm used to doing all of my LaTeX in a single file, though, and compiling after every few lines of typing so I catch errors quickly.

That's a bit harder and slower now.

Any tips on compiling my work more quickly? Is there any way to not have to switch files to check that my code is working?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: Faster Compiling in Multifile Documents

Post by Johannes_B »

Splitting the code in multiple files shouldn't make a noticable effect on compiling time.

What you can do to minimize compile time is commenting out the files you are not currently working on. Externalize your tikz-pictures (which are really slowing things down). Or work on a standalone document and copy ready parts to the big project.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10319
Joined: Mon Mar 10, 2008 9:44 pm

Faster Compiling in Multifile Documents

Post by Stefan Kottwitz »

You could use \includeonly, as written in Structuring Large Documents.

Stefan
LaTeX.org admin
LaTexLearner
Posts: 139
Joined: Tue Mar 10, 2015 11:06 am

Faster Compiling in Multifile Documents

Post by LaTexLearner »

Johannes_B wrote:... Externalize your tikz-pictures (which are really slowing things down)...
What does this mean?
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: Faster Compiling in Multifile Documents

Post by Johannes_B »

Have a look at section 50 (Externalization library) of the TikZ manual.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Faster Compiling in Multifile Documents

Post by cgnieder »

LaTexLearner wrote:I'm used to doing all of my LaTeX in a single file, though, and compiling after every few lines of typing so I catch errors quickly.

That's a bit harder and slower now.
To me this sounds as if your workflow slowed down (and not compilation time)…
LaTexLearner wrote:Any tips on compiling my work more quickly? Is there any way to not have to switch files to check that my code is working?
Some editors know about master files…

I work with emacs/AUCTeX and if I have a large projects containing of several files I always mark the main file as master file and set said file as master of the files which are included. I then can compile without switching between files.

I know that TeXmaker and TeXStudio have similar concepts…

Regards
site moderator & package author
Abstraction Mage
Posts: 1
Joined: Fri Apr 21, 2023 9:20 pm

Faster Compiling in Multifile Documents

Post by Abstraction Mage »

For anyone joining in late, you may wanna try the subfiles package. It offers an alternative way to input or include .tex files that allows you to compile the included files on their own without the need to specify and change \includeonly all the time
Post Reply