Giter Site home page Giter Site logo

[FR] Typst Support about bookdown HOT 3 OPEN

stellarpower avatar stellarpower commented on June 2, 2024 3
[FR] Typst Support

from bookdown.

Comments (3)

cderv avatar cderv commented on June 2, 2024 1

Hi @stellarpower !

thanks for reaching out!

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.

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.
It is called Quarto (https://quarto.org) "An open-source scientific and technical publishing system" based on Pandoc.

Compared to R Markdown ecosystem, it is an evolution and a way to bring all the great feature to outside R ecosystem.
Quarto can do all that R Markdown can do, including documents, website, blogs, books, presentation, and all in one CLI tool with no external dependency (unless you need computation using R & knitr or Jupyter for Julia Python, ..)

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 quarto CLI tool and that is all - Pandoc, Typst, etc... are all bundled, and if you do only Markdown content, with no computation code, you can use without any R or Python installation.

but I feel like Typst would be a more closely-aligned backend for bookdown,

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.
That is a pre-requisite. Then a bookdown format like pdf_book()

but in practice, I expect more work would be needed for a close integration.

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 !

from bookdown.

stellarpower avatar stellarpower commented on June 2, 2024

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.

from bookdown.

cderv avatar cderv commented on June 2, 2024

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,

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 typst. Quarto adds support for computation code block (evaluation and insertion of results), and Markdown syntax improvement for scientific & technical publication related features like cross references of figures, or special layouts. Aim is to have one type of document (.qmd text based file, or .ipynb notebook based file) to create several types of output (like a HTML page for a website, and a PDF document using Typst).

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.

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.

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.

Looks good overall, if I don't need to have R Studio installed just for generating documents.

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)

but if not I'll give it a try

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 !

from bookdown.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.