Emit LaTeX document from Julia

Tamas_Papp
Thu, 19 Mar 2026 10:11:12 +0000
General Usage

I am generating a lot of plots and tables (in Julia) for a research project, to be shared with coauthors. It used to be that I would dump the tables in a directory and tried to be good with file naming, but it got beyond manageable. The purpose is now to generate a single PDF file for discussion of results, and then select what goes into the paper.

Now, when I dump the plots and tables, I would prefer to simultaneously generate a LaTeX document, with section headings, table/figure captions, and inclusion of the relevant figure. Eg the API I would imagine is something like this:

ltx = start_LaTeX_document("some_path.tex"; packages = ["booktabs"])
    # ^ adds preamble, already includes graphicx
add_section(ltx, "Baseline plots")
add_figure(ltx, "What a nice figure", "some_figure_path.pdf")
add_subsection(ltx, "The robustness checks that will make the editor complain"
    * "that the paper is now too long even though he asked for them")
add_table(ltx, "Some table", "some_table_dump.tex")
end_LaTeX_document(ltx)

I can just mock this up quickly but wanted to ask if there is a package that does this already.

13 posts - 12 participants