0

Anybody know of any LaTeX/TeX package or GUI that allows LaTeX script to be run in sections? I'm after a feature similar to MATLAB's "run section" feature.

My LaTeX documents tend to take ages to compile because it has to "re-plot" every single figure and graphic and item on previous pages, meanwhile I will have only actually changed something on say, the final page. I appreciate that if I were to change something say mid-document it would need to shift everything downwards and that's why it's good to do a whole compile.

However, upon splitting pages (\newpage or \clearpage), surely there's some way to run only the LaTeX script relating to stuff that's after a certain page and before another page using a made-up command like "\runcheckpoint" or something.

I have tried searching other user questions relating to this, such as this one but I don't think I am after the subfiles package because if I understand it correctly, it will compile the sections you add too.

I have also read this when trying to learn about "\include" and as far as I understand that, it looks like I would have to edit whatever document I include in a separate window. Is there no way to just do this all in one script?

I apologise if the answer is obvious, this is my first question on this stackexchange.

  • There are a couple of traditional approaches to this such as using draft mode to not load images but then the drafts may not shift included blocks like final so page splits not representative this also holds true for \include{subfile.tex}Thus one way is to have if then \includes which have a vert box equal to the known result of the include and can shift counters to allow for the non inclusion of figure references etc etc. (not a trivial task) but there are several packagesthat attempt to assist e.g. Frankenstein Includex classed as subdocs see https://ctan.org/topic/subdocs –  Mar 27 '19 at 14:22

1 Answers1

0

WinEdt has a function where you can compile and preview sections separately, for example. But that's editor specific, and not a (La)TeX functionality.

You can also have different .tex files for the different sections (usually useful with chapters in books), and then have a main file \includeing all files in one.

Superuser27
  • 1,312
  • 3
    You might also mention the use of \includeonly to selectively process only the changed section/chapter/file. – barbara beeton Mar 27 '19 at 12:30
  • an use \includeonly and \include also if it is the plots that are taking time there is no need to plot them every time, you can generate pdf of each and include them as pdf – David Carlisle Mar 27 '19 at 13:25