rstudio / bookdown

Authoring Books and Technical Documents with R Markdown
https://pkgs.rstudio.com/bookdown/
GNU General Public License v3.0
3.71k stars 1.27k forks source link

[FR] Typst Support #1439

Open stellarpower opened 9 months ago

stellarpower commented 9 months ago

For some background information, I've only started with the basics of Bookdown today, I'm not an R user, and I don't write that many documents. So can't speak from much experience.

But, I have spent a few years looking for a tool that sits betwen LaTex (too old and complicated, I don't want to waste time learning it) and LibreOffice (too manual, not reproducible, etc.). I have the exact same frustration with the lack of software for tabular data, that isn't just LO Calc or writing your own script in e.g. Ruby. LyX was reasonably nice to use for some time, but, it was too tied to LaTex, bringing me back to the original problem. I ended up writing a complicated pipeline converting to ODT and then styling it when I ran out of options, and abandoned this, so I was pleased when I learned of bookdown.

Bookdown seems to be much closer, because from what I have gleaned, it talks directly to Pandoc - whereas LyX basically wraps around LaTex and talks directly to a a rendered to spit that out as PDF. However, the fact that Pandoc then converts to LaTex and uses this to generate PDF concerns me a bit after my previous experiences with Lyx. When I learned that to add colour in bookdown, essentially I need to include a lua extension for Pandoc, that will then switch on the output format and insert the relevant LaTex, I started searching again.

I have felt for some time that PanDoc ought to have its own file format, so that we have an alternative between an old WYSIWYM format that is overkill in the modern world, and the WYSIWYG MS Word-like editors that are friendly as GUIS but bad for structured text, and plain markdown, which is designed for the web and just doesn;t have enough features for typesetting a full document.

Enter Typst. I have just learned of its existence today, and if anyone out there shares my own frustrations, I reckon it could take off and be very popular. Pandoc is already working on support for reading and has support for writing Typst, which itself can then render to a PDF - I would bet with fewer hiccoughs for general documents than when using LaTex. Admittedly this pipeline is as many steps as using LaTex, but I feel like Typst would be a more closely-aligned backend for bookdown, being more modern, simpler, closer to Markdown, and benefitting from 40 years of evolution since.

In theory, Pandoc support would provide all that is needed, to use Typst in lieu of LaTex before rendering as a PDF - but in practice, I expect more work would be needed for a close integration. As I see no mention so far in the issue list, thought I would raise it as something to have on the horizon - but as I'm not an active or experienced user, I'll leave it open for someone else to make a more detailed/over-arching/fine analysis of if and how/if this integration into bookdown ought to be accomplished.

Cheers!