inara icon indicating copy to clipboard operation
inara copied to clipboard

PDF generation via Typst

Open rikhuijzer opened this issue 1 year ago • 6 comments

I have published once in The Journal of Open Source Software and remember that it wasn't very easy to get LaTeX working. I'm on an ARM MacOS system and there the docker image required at least 10 GB of RAM and the build was very slow (https://github.com/openjournals/inara/issues/30).

I'm currently working on writing my PhD thesis in typst. It has been a great experience. Compilation takes about 100ms compared to the typical multiple seconds that LaTeX takes. Also, I converted my JOSS paper to typst with little effort. Apart from a few minor things, which could often be easily solved by writing some typst code, I have gotten everything to work. Things that I can confirm that are now working, and related to openjournals, are references via BibTeX, page numbers, code examples with syntax highlighting, inclusion of images, setting alternative headers/footers, and tables. These features all work out-of-the-box. No need to install extra dependencies in typst.

Since openjournals is the most cutting edge publisher that I know, especially with regards to open source software, maybe typst could be included as an (alternative) back end for the publishing system? This could make it easier for authors to submit their papers to openjournals.

rikhuijzer avatar Apr 24 '24 10:04 rikhuijzer

This is currently not on the roadmap: Typst doesn't support PDF/A yet, but we consider conformance to that archiving standard a requirement.

tarleb avatar Apr 25 '24 13:04 tarleb

Typst 0.12 can now "emit files that comply with the PDF/A-2b profile." (source: https://typst.app/blog/2024/typst-0.12/)

rikhuijzer avatar Oct 19 '24 13:10 rikhuijzer

Neat! We'll need a template for Typst, or at least a layout that could be adapted. Then it'll become a real option.

Reopening

tarleb avatar Oct 19 '24 16:10 tarleb

We are going through this for SciPy at the moment, and have switched to typst:

This is an example of @JBorrow's paper (an editor in JOSS!):

image

main (1).pdf

rowanc1 avatar Oct 24 '24 06:10 rowanc1

Wow, that looks really nice! Is the source code available somewhere?

tarleb avatar Oct 24 '24 06:10 tarleb

There is an example in there that is pure typst:

https://github.com/myst-templates/scipy

That is autogenerated from myst markdown though (which also does jats!).

The online article is here:

https://proceedings.scipy.org/articles/HWGA5253

Which has all sorts of nice reading features like hover previews etc.

image

Source for the paper: https://github.com/scipy-conference/scipy_proceedings/blob/2024/papers/josh_borrow/paper.md

In the process of doing PDFs at the moment, and will likely have the full examples in that repo by the end of the week.

basically adding this to the myst.yml if you want to try it out before then:

  exports:
    - format: typst
      template: scipy
      article: main.md      

docs for mystmd are here:

https://mystmd.org/guide/

rowanc1 avatar Oct 24 '24 07:10 rowanc1