Skip to content
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

Support abstract-title for Typst format #9724

Open
cderv opened this issue May 6, 2024 · 3 comments
Open

Support abstract-title for Typst format #9724

cderv opened this issue May 6, 2024 · 3 comments

Comments

@cderv
Copy link
Contributor

cderv commented May 6, 2024

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

if abstract != none {
block(inset: 2em)[
#text(weight: "semibold")[Abstract] #h(1em) #abstract
]
}

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

@jgm
Copy link
Owner

jgm commented May 6, 2024

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

@cderv
Copy link
Contributor Author

cderv commented May 6, 2024

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 ?

abstractTitle <- case lookupMeta "abstract-title" meta of
Just (MetaBlocks bs) -> pure $ stringify bs
Just (MetaInlines ils) -> pure $ stringify ils
Just (MetaString s) -> pure s
_ -> translateTerm Abstract

abstractTitle <- translateTerm Abstract

defField "abstract-title" abstractTitle .

@jgm
Copy link
Owner

jgm commented May 6, 2024

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.

gordonwoodhull added a commit to quarto-dev/quarto-cli that referenced this issue May 31, 2024
includes change to typst-template.typ which will need to be
revisited when jgm/pandoc#9724 is fixed
gordonwoodhull added a commit to quarto-dev/quarto-cli that referenced this issue Jun 1, 2024
includes change to typst-template.typ which will need to be
revisited with jgm/pandoc#9724
gordonwoodhull added a commit to quarto-dev/quarto-cli that referenced this issue Jun 3, 2024
includes change to typst-template.typ which should be reverted
when we get a fix for jgm/pandoc#9724

This also fixes #9854 crash for subfigures with no ids
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants