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

Why is there a Comma Behind the sender.name? #14

Open
ondohotola opened this issue Oct 20, 2024 · 7 comments
Open

Why is there a Comma Behind the sender.name? #14

ondohotola opened this issue Oct 20, 2024 · 7 comments
Labels
enhancement New feature or request

Comments

@ondohotola
Copy link

I like to have · or sometimes a hyphen - between the Name, Street and Town in the small return address line above the recipient.

I notice however, that

   sender: (
      name: "EW Lisse",
      address: [ . PO Box · Windhoek ],
   ),

results in

EW Lisse, . PO Box · Windhoek

which looks awkward.

@Sematre Sematre added the enhancement New feature or request label Oct 23, 2024
@ondohotola
Copy link
Author

I have no idea how to do a Pull Request, but the the diff that fixes this look slile

*** lib.typ	Wed Oct 30 23:17:19 2024
--- lib.typ.ori	Wed Oct 30 23:17:14 2024
***************
*** 288,294 ****
      }
  
      if (name != none) and (address != none) {
!       " "
      }
  
      if address != none {
--- 288,294 ----
      }
  
      if (name != none) and (address != none) {
!       ", "
      }
  
      if address != none {

@Sematre
Copy link
Owner

Sematre commented Oct 30, 2024

The reason why a comma is inserted here is, that it generates the default address line. Your patch would remove this comma.
Screenshot From 2024-10-30 22-35-42

Commas are also used as separators in the sender.address field that will be replaced by line breaks in the default header. This code will be turned into this default header.

#show: letter-simple.with(
  sender: (
    name: "Jane Smith",
    address: "Universal Exports, 1 Heavy Plaza, Morristown, NJ 07964",
  ),
  // ...
)

Screenshot From 2024-10-30 22-41-40

@Sematre
Copy link
Owner

Sematre commented Oct 30, 2024

But I have an alternative idea. There could be a new sender.address-line option that, if set, will overwrite the default value. Here's an example of how this would look like:

#show: letter-simple.with(
  sender: (
    name: "Jane Smith",
    address: "Universal Exports, 1 Heavy Plaza, Morristown, NJ 07964",
    address-line: "Jane Smith · Universal Exports · 1 Heavy Plaza · Morristown · NJ 07964"
  ),
  // ...
)

Screenshot From 2024-10-30 22-51-01

Would this work for you?

@ondohotola
Copy link
Author

That would work very much.

As the sender rarely changes the "duplication" would not matter.

I don't use an address block but put the sender address into the footer, so I never noticed.

@Sematre
Copy link
Owner

Sematre commented Oct 30, 2024

Great. Thanks for providing feedback on this library. I'll implement this feature in the next release. Can't give an ETA tho.

@ondohotola
Copy link
Author

Thank you.

As I don't use the sender block I'll use use the 'patched' version until 3.0.1 comes out :-)-O

@Stern1710
Copy link

This sounds pretty good. Does this enable us to "delete" the address-line by just setting the content to an empty string? And could this, per chance, then result in the space being freed? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants