1

Please i am working on a project should provide fast compiling of Latex files in silent mode so the user should not see any process and just preview the final pdf file produced and i need it faster than usual i tried to use pdflatex by hidden command line but it was slow which takes 4-5 seconds to preview pdf then i tried to use TeXWorks it was really fast but i can not hide it so any suggestion guys.

  • 1
    Welcome to TeX.SX! – OSjerick Dec 3 '13 at 12:16
  • How come TeXWorks is faster than pdflatex? I assume TeXWorks is just a front-end that calls pdflatex... – lhf Dec 3 '13 at 12:16
  • TeXworks has an "integrated pdf viewer", so to compare you should use pdflatex coupled to a viewer that automatically updates, e.g. via synctex. – Andrew Swann Dec 3 '13 at 12:27
  • Welcome @OSjerick if you have any idea about that i will be grateful – MohamedSayed Dec 3 '13 at 12:40
  • 1
    Have you considered using \includeonly? – user10274 Dec 3 '13 at 15:51
2

This problem was tackled successfully on NeXTstep where the TeX process would allow access to a .dvi file after a complete page was written to it via IPC (InterProcess Communication).

This feature seems to now be part of pytex and the TeX Daemon --- one can improve TeX performance by:

  • not loading unnecessary packages
  • selectively processing only a portion of a document using \includeonly if it is large enough to be broken up into included files
  • building your macros efficiently (use font instances if using fontspec is one common source of needless re-processing)
  • only accessing graphics once (save them to a box and re-use them as needed)
  • building a format which pre-loads all of your packages (this was much easier on Textures which had a specific menu feature for it) --- ISTR David Carlisle putting a tool for that up on CTAN.

And:

  • keeping the TeX process in memory and leaving it running as a Daemon -- see pytex http://www.pytex.org/ (note AIUI that this is difficult on Windows since it blocks reading a file from stdin if it's still being written to)

Everything else is pretty straight-forward, but it's that last which would be the big pay-off --- I've been disappointed that TeX's IPC hasn't been seen as needful since modern machines have become so fast.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.