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

adding support for creating letters with template #10280

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jasonpearcy
Copy link

@jasonpearcy jasonpearcy commented Oct 9, 2024

adding support for creating letters with template

This change:

  1. Adds the latex.letter template to data/templates
  2. Updates pandoc.cabal to include the new template
  3. Updates MANUAL.txt to include documentation on how to use pandoc to create letters

The latex.letter template supports creating letters with the "letter" class and KOMA-Script classes (both the scrlttr2 class or using the scrletter package).

Detailed examples are published here: https://github.com/jasonpearcy/pandoc_letters

@twsh
Copy link
Contributor

twsh commented Oct 10, 2024

I noticed one thing that I think is a problem, and I have a few other thoughts.

The problem is that the template still has code for \maketitle and an abstract environment. Those don't work with scrlttr2, and don't make sense for a letter anyway, in my view.

My thoughts:

  • I think some people will want to set the author and signature independently, e.g., author is 'Jane Smith' and signature is 'Professor J. Smith'.
  • Should some more things, like email address and phone number, have variables? Maybe the template could also support those two for letter.cls?
  • Is there a way to have the documentclass default to a letter class? I don't know how to do that, but it would be nice.
  • The KOMA letter classes have fold marks and a return address that are based on the assumption that the letter is going in a windowed envelope. Should they be turned off by default? (I think of them as like the navigation symbols in Beamer or the monospaced URLs in LaTeX: not wanted by most people.)

@twsh
Copy link
Contributor

twsh commented Oct 12, 2024

Regarding adding more variables, I think this would allow the user to set any KOMA variable/option in a neat way:

$for(komavar/pairs)$
\setkomavar{$it.key$}{$for(it.value)$$it$$sep$\\$endfor$}
$endfor$

$for(komaoption/pairs)$
\KOMAoption{$it.key$}{$it.value$}
$endfor$

$if(komaoptions)$
\KOMAoptions{$for(komaoptions)$$it$$sep$,$endfor$}
$endif$

$for(letteroption)$
\LoadLetterOption{$it$}
$endfor$

I don't think we need both the KOMAoption and KOMAoptions version (and if so they should have different names). I think that they could be passed as class options anyway, so maybe we need neither?

We could also do things like this for the common things people want in a letter:

$if(email)$
\setkomavar{fromemail}{$email$}
\KOMAoption{fromemail}{true}
$endif$

It also occurred to me that, as well as setting the signature KOMA variable, $author$ could set the 'fromname' KOMA variable.

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

Successfully merging this pull request may close these issues.

2 participants