-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FR] Typst Support #1439
Comments
Hi @stellarpower ! thanks for reaching out!
I will first react on this as we have been working on another tool which main difference is that it is not tied to R at all. Compared to R Markdown ecosystem, it is an evolution and a way to bring all the great feature to outside R ecosystem. As it is based on Pandoc too , there is already Typst support for document: https://quarto.org/docs/prerelease/1.4/typst.html If you are starting on this reproducible publishing through Pandoc path, I would suggest to give Quarto a look and a try. To be clear (especially to other reading this), I say that because you said you are not a R user. Using bookdown would required to install R, Pandoc and packages even if you book only contains Markdown content and no R code whatsoever. With Quarto, you just need
Now about the main topic of this issue - I think this is indeed a good feature request. We would need to first bring Typst support into rmarkdown R package. Also maybe into knitr so that output of computation may be tweaked for Typst if necessary.
Indeed I believe there will be more work because bookdown offers some special feature not in Pandoc, and so it would need to work also for Typst. Could be simple or not, it depends also on what Typst supports. Most of the extensions bookdown provides are descbribed at https://bookdown.org/yihui/bookdown/markdown-extensions-by-bookdown.html As a last note, this is almost the same team working on Quarto and on bookdown, so resources are also shared and we tend to invest really new stuff in Quarto. Though, I really thing that bringing typst to R Markdown ecosystem will be useful for all the R Markdown users out there that don't need to switch to Quarto. We'll see when and how we could make this happen. Though PR are always welcomed ! |
Thanks, I saw Quarto mentioned on the typst discord server, so I will have to check it out in more detail. For now, I think typst probably has first-class support (or will do in time) for most of what I need to do, but if not I'll give it a try. I guess Quarto may be useful a bit like a template in that regard, and it seems as I can easily insert Raw Typst code, I can use that for a fine level of control in how those segments get rendered. Looks good overall, if I don't need to have R Studio installed just for generating documents. Beyond that, the rest of what you are saying all sounds good to me! Thanks for getting back so quickly. |
Quarto will be related to Typst like Pandoc is. Input document can be a Markdown based file, which will be converted to Typst and then to PDF using For all the features to work, it needs to be supported by the output document. So Typst need indeed a way to express cross reference, or any other feature we provide.
So main advantage is to use Markdow Markup syntax, but Quarto is indeed quite configurable, by using Raw Typst directly in doc, or extended features by using Lua filters (possibly packaged in extension): Example with this poster template adapted to Quarto from this typst version Quarto also offers Project levels features for all output format, which could be really interesting for more complex project, and more configurable content.
With Quarto you don't need RStudio at all. Not any IDE if you want as this is a CLI tool. Though, there is integrated support with VSCODE (https://quarto.org/docs/tools/vscode.html)
When you give it a try, please to share with us feedback in https://github.com/quarto-dev/quarto-cli/discussions/. Having feedbacks from new users, and especially Typst user, is really valuable to us. This is early stage integration for Typst with Quarto (and Pandoc), so any feedback will help us prioritize and know what is missing and important to provide. Thanks ! |
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!
The text was updated successfully, but these errors were encountered: