pandoc icon indicating copy to clipboard operation
pandoc copied to clipboard

Support `abstract-title` for Typst format

Open cderv opened this issue 1 year ago • 3 comments

I believe this could easily be supported like in HTML and some other formats by tweaking the template here

https://github.com/jgm/pandoc/blob/0f29d8195eeb526c4aa14d5f56818f905d5badb5/data/templates/template.typst#L62-L66

so that Abstract is not hard coded.

Though it probably needs a Writer update to match behavior with Docx or HTML that supports this field

cderv avatar May 06 '24 13:05 cderv

Makes sense. I think it could all be done in the templates. Want to submit a PR?

jgm avatar May 06 '24 16:05 jgm

I think it could all be done in the templates.

Looking at this closer, It seems Writers are currently setting some defaults and handling translation. Should translation of term works for Typst as HTML and Docx ?

https://github.com/jgm/pandoc/blob/ddc66cad0b0e170c48e7fdc01fbecf57f329add4/src/Text/Pandoc/Writers/Docx.hs#L916-L920 https://github.com/jgm/pandoc/blob/ddc66cad0b0e170c48e7fdc01fbecf57f329add4/src/Text/Pandoc/Writers/HTML.hs#L291 https://github.com/jgm/pandoc/blob/ddc66cad0b0e170c48e7fdc01fbecf57f329add4/src/Text/Pandoc/Writers/HTML.hs#L371

cderv avatar May 06 '24 16:05 cderv

Yes, it would be good to use the translation of the Abstract term as the default value for abstract-title (which could be overridden). That's what is doen in the docx writer, as you see.

jgm avatar May 06 '24 17:05 jgm