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

Sender name is mandatory in letter-simple #21

Closed
Morwdan opened this issue Dec 28, 2024 · 1 comment · Fixed by #22
Closed

Sender name is mandatory in letter-simple #21

Morwdan opened this issue Dec 28, 2024 · 1 comment · Fixed by #22
Labels
bug Something isn't working

Comments

@Morwdan
Copy link
Contributor

Morwdan commented Dec 28, 2024

Creating a letter without a sender name via letter-simple results in the following error…:

error: expected string or array, found none
    ┌─ @preview/letter-pro:3.0.0/src/lib.typ:539:12
    │
539 │     author: sender.name,
    │             ^^^^^^^^^^^

…as the sender name is also used to specify the document author (which doesn’t seem to accept none):

// Configure page and text properties.
set document(
title: subject,
author: sender.name,
)

According to the documentation of letter-simple, the sender name can be none, so I assume this behavior is not intended. I worked around the issue with this change, but being new to Typst, there is probably a cleaner fix:

  // Configure page and text properties.
  if sender.name != none {
    set document(
      title: subject,
      author: sender.name
    )
  }
  else {
    set document(
      title: subject,
    )
  }

And thanks for this project!

Morwdan added a commit to Morwdan/typst-letter-pro that referenced this issue Dec 28, 2024
@Sematre Sematre added the bug Something isn't working label Dec 30, 2024
@Sematre
Copy link
Owner

Sematre commented Dec 30, 2024

Thanks for reaching out. This is indeed a bug. I'll open a pull request.

Sematre added a commit that referenced this issue Dec 30, 2024
#21

Co-authored-by: Morwdan <5207513+Morwdan@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants