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

Compile breaks when given a single abstract #3

Open
MitchellAcoustics opened this issue Apr 6, 2024 · 0 comments · May be fixed by #4 or MitchellAcoustics/LaPreprint-typst#1
Open

Compile breaks when given a single abstract #3

MitchellAcoustics opened this issue Apr 6, 2024 · 0 comments · May be fixed by #4 or MitchellAcoustics/LaPreprint-typst#1

Comments

@MitchellAcoustics
Copy link

MitchellAcoustics commented Apr 6, 2024

When providing only a single string as an abstract, e.g.:

#show: template.with(
  abstract: lorem(50),
)

or

#show: template.with(
  abstract: "This is an abstract",
)

the compile breaks with

typst compile examples/pixels/main.typ --root .
error: type dictionary has no method `map`
    ┌─ lapreprint.typ:278:14
    │
278 │     abstracts.map(abs => {
    │               ^^^

The same happens if the abstract text is wrapped as content [This is text] rather than a string.

I think this is happening because line 270-271 of lapreprint.typ returns a dictionary, but the abstracts.mapin line 278 requires an array.

MitchellAcoustics added a commit to MitchellAcoustics/LaPreprint-typst that referenced this issue Apr 6, 2024
This commit aims to fix LaPreprint#3 (comment) by adding a check to catch a string abstract and by ensuring an array is returned when a single abstract is provided.
@MitchellAcoustics MitchellAcoustics linked a pull request Apr 6, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant