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

More Options for Text Alignement in Sender Box #10

Open
scavi-github opened this issue Aug 2, 2024 · 2 comments
Open

More Options for Text Alignement in Sender Box #10

scavi-github opened this issue Aug 2, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@scavi-github
Copy link

Hi, this is a very nice template!

It would be really cool to have more options for text alignment in the sender box (but still have the box on the right-hand side of the page), e.g. to have the text left-aligned, or even better, to have right and left alignment like in a two-column table.

So, using the example from the README, to change the sender box from this:

alt

to something like this:

neu

@Sematre Sematre added the enhancement New feature or request label Aug 2, 2024
@Sematre
Copy link
Owner

Sematre commented Aug 2, 2024

Seems like a useful addition, but how would you define the API?

If this is your first example:

#show: letter-simple.with(
  sender: (
    name: "Anja Ahlsen",
    address: "Deutschherrenufer 28, 60528 Frankfurt",
    extra: [
      Telefon: #link("tel:+4915228817386")[+49 152 28817386]\
      E-Mail: #link("mailto:aahlsen@example.com")[aahlsen\@example.com]\
    ],
  ),

  // etc.
)

How would you like your second example to be implemented?

There's an example:

#show: letter-simple.with(
  sender: (
    name: "Anja Ahlsen",
    address: "Deutschherrenufer 28, 60528 Frankfurt",
    extra: (
      ([Telefon], link("tel:+4915228817386")[+49 152 28817386]),
      ([E-Mail], link("mailto:aahlsen@example.com")[aahlsen\@example.com]),
    ),
  ),

  // etc.
)

@scavi-github
Copy link
Author

How about adding an extra option, e.g. textalign, to sender? If unspecified, its default value would be right, but one could set it to left, or, for my second example, it could take an array (right, left).

Then there is a choice to either...

  • ...always put the values for name and address in the second/last column and use arrays for the elements in extra;
  • or, to require arrays as values for name and address as well, to make it more customizable.

For the first version, the syntax could look like this:

#show: letter-simple.with(
  sender: (
    textalign: (right, left),
    name: "Anja Ahlsen",
    address: "Deutschherrenufer 28, 60528 Frankfurt",
    extra: (
      ([Telefon], link("tel:+4915228817386")[+49 152 28817386]),
      ([E-Mail], link("mailto:aahlsen@example.com")[aahlsen\@example.com]),
    ),
  ),

  // etc.
)

By the way, the change in text size I made in my example picture should in my opinion not be caused by any of this and can always be put in by hand, e.g. by manually writing text(0.7em)[Telefon:] instead of [Telefon:].

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

2 participants