Skip to content

Custom writer block separators #9881

Closed Answered by tarleb
wlupton asked this question in Q&A
Jun 14, 2024 · 3 comments · 1 reply
Discussion options

You must be logged in to vote

I looked into this and it seems that the explanation is that that the default Writer.Blocks always separates blocks with a blank line (in this case the Plain A and the BulletList -B -C. Is this correct?

That's correct.

What should I really be doing here?

That depends, of course. What the built-in Typst writer is doing is to append blank lines to most elements like BulletList, Para, etc, but not to others, e.g. Plain. The final result is then generated by stacking all rendered blocks on top of each other, but without adding an empty line in-between.

Something like this:

local layout = require 'pandoc.layout'

Writer.Block.Para = function (para)
  return {Writer.Inlines(para.content), l…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by wlupton
Comment options

You must be logged in to vote
1 reply
@tarleb
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants