Plugin only renders first page on PDF export
The plugin doesn't seem to be able to render multi-page documents. I'm rendering as SVG in the example, but it's the same with images!
Preamble
// typography
#set page(paper: "a4", fill: rgb("f7f9ff"), margin: 2.5cm, numbering: "1")
#set text(
font: "Halant",
size: 10pt,
fill: rgb("5c6166")
)
#set par(justify: true, leading: 15pt)
#show heading: set text(
font: "Montserrat",
weight: "semibold"
)
#show heading: set block(
spacing: 15pt
)
// citations
#set cite(style: "chicago-notes", brackets: false)
#set bibliography(style: "chicago-author-date")
#show "“": "‘"
#show "”": "’"
Codeblock
= h1
== h2
#lorem(100)
== h2
#lorem(200)
== h2
#lorem(300)
= h1
#lorem(100)
Intended result Test.pdf
Actual Result
As this plugin is intended to only render code blocks and math blocks, it only makes sense to render the first page. Once a custom editor has been added multiple pages could be supported.
Ah, I see. Understandable! Is there a planned implementation for the custom editor? I would love to contribute but am unfamiliar with Rust. The work you've put into this plugin is much appreciated!
An implementation is planned but its waiting on HTML export from typst as that would remove a lot of the headache. I think @SekoiaTree started looking into the impl. then switched to looking into the html export and then I lost track :)
Haha yeah I've been relatively busy since sadly
hi! so just to clarify, I have a bunch of math blocks interspersed with standard Obsidian text. when I export to PDF, my content is longer than 1 page, and so only the math blocks on the first page are rendered, the rest are not. this is currently expected behavior, right? thank you!
@aczw I think your problem is closer to #29 than this one.
when I export to PDF, my content is longer than 1 page, and so only the math blocks on the first page are rendered, the rest are not. this is currently expected behavior, right?
In a way it is expected behaviour but it is still a problem that should be fixed. Its most likely because Obsidian expects the renderMath function to be blocking (when it returns it is completely done). However, the plugin overrides this and the function is async/nonblocking so it returns before it is "done rendering". I'm not entirely sure how to fix this and honestly I need to find a better way to override the default math blocks.
As a work around you try using pandoc to convert the markdown into Typst...
ah that issue more closely describes what I'm experiencing. I'm not in a hurry to export my notes or anything, but I'll try using pandoc, thanks!