thomasjo / atom-latex

Compile LaTeX or knitr documents from within Atom
https://atom.io/packages/latex
MIT License
223 stars 42 forks source link

Add step to build process #545

Closed SamThilmany closed 2 years ago

SamThilmany commented 4 years ago

Currently, atom-latex includes multiple steps in the build process, which results in a complete document after one call of the atom-latex build script. When building a file manually, you would have to build the document first, then build the bibliography and rebuild the document. Things like references and citations and the lastpage package require several build steps, which is logical if you think about it. All this works like a charm in atom-latex and one could forget about the need for multiple build steps. However, I had the need to use the pythontex package in a project in which you also need to run pythontex <jobname>.

The pythontex package allows python code to be included in a LaTeX document. This is especially convenient if one has to handle large datasets or alike were a programming language better suited for the needs is to be used. Upon the first document build step, a temporary file <jobname>.pytxcode is generated. It contains all the Python code of the document. With the build command pythontex <jobname> this file is interpreted, and the results are saved in a temporary file, which is then again included in the document in the third build step.

I didn't find a possibility to add the pythontex build command into my atom-latex build process. Is there a possibility to do so? If not, I think this would be a nice feature to have in the future.

thomasjo commented 4 years ago

Hi @SamThilmany,

This should be possible via the use of latexmkrc files. In other words, by adding support for pythontex to latexmk on your system, this package will automatically inherit that support as well.

With a bit of luck, this config should work as expected: https://rcweb.dartmouth.edu/doc/texmf-dist/doc/support/latexmk/example_rcfiles/pythontex-latexmkrc

For full details on where to place the latexmkrc file (and other relevant details), please refer to the manpage for latexmk: https://man.cx/latexmk#heading8

stale[bot] commented 3 years ago

This issue has been marked as stale because due to inactivity. It will be closed in 14 days if no further activity occurs.