* ox-koma-letter.el (org-koma-letter-template): Do not output
`fromaddress' when it is a string of white spaces.
(org-koma-letter-use-title): Fix typo in the documentation string.
* ox-koma-letter.el (org-koma-letter-use-title): New variable.
(org-koma-letter-prefer-subject): New variable.
(org-koma-letter-template): Allow separate subject and title.
Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
* contrib/lisp/ox-koma-letter.el (org-koma-letter-opening): Correctly
report conditions to fulfill in order set opening string with
a headline.
(org-koma-letter-headline): Opening can no longer be nil, so look out
for the empty string instead.
* contrib/lisp/ox-koma-letter.el (org-koma-letter-plug-into-ox):
Remove function.
(org-koma-letter-default-class): Change default value.
A default class is installed by default upon loading the library.
* contrib/lisp/ox-koma-letter.el (org-koma-letter-use-foldmarks):
Change value to symbols or list of symbols.
(org-koma-letter--build-settings): Use new value for folding marks.
* contrib/lisp/ox-koma-letter.el (org-koma-letter-subject-format):
Make it clear that lists of symbols are allowed.
(org-koma-letter-template): Refactor subject-related part.
* contrib/lisp/ox-koma-letter.el (koma-letter): Rewrite function.
Global variables are no longer ignored.
(org-koma-letter--build-settings): New function.
* contrib/lisp/ox-koma-letter.el: Change default values to match the scrlttr2
default values. Track which options are set in the file and only output the
corresponding options when they are changed.
* ox-koma-letter.el: Reworded parts of the head of the file.
(org-koma-letter-prefer-special-headings,
org-koma-letter-subject-format, org-koma-letter-default-class,
org-koma-letter-special-tags-in-letter,
org-koma-letter-special-tags-after-closing,
org-koma-letter-special-tags-after-letter,
org-koma-letter-plug-into-ox, org-koma-letter-email,
org-koma-letter--get-tagged-contents,
org-koma-letter-special-contents): Changed docstring to pass checkdoc.
(org-koma-letter--get-value): Renamed `org-koma-letter--get-custom'.
Docstring changed to pass checkdoc.
(org-koma-letter--special-contents-as-macro): Renamed
`org-koma-letter--prepare-special-contents-as-macro'. Docstring
changed to pass checkdoc.
(org-koma-letter--normalize-string): Renamed
org-koma-letter--remove-offending-new-lines. Docstring changed to
pass checkdoc.
(org-koma-letter--determine-to-and-from): Renamed
org-koma-letter--determine-special-value. Docstring changed to pass
checkdoc.
Some functions have been renamed to make the names slightly more
informative.
Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
* ox-koma-letter.el (org-koma-letter-headline-is-opening-maybe): new
variable. If `t' let headlines set subject.
(org-koma-letter-headline): let headline set opening.
(org-koma-letter-template): let opening and closing be empty if nil.
Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
* ox-koma-letter.el (org-koma-letter-default-class): default class for
=ox-koma-letter=. Default is nil.
* ox-koma-letter.el (org-koma-letter-plug-into-ox): add a sparse
letter class to =`org-latex-class'= and set it to default.
By default it will use =`org-latex-default-class'=.
Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
* ox-koma-letter.el: documentation.
(org-koma-letter-special-tags-in-letter): list of tags that
are typeset as part of the letter.
(org-koma-letter--determine-special-value): determine which
value to use (for to and from currentlly) if more than
candidate is available. Which value is selected depends on
`org-koma-letter-prefer-special-headings'.
(org-koma-letter-prefer-special-headings): a boolean stating
whether to prefer headings with to/from or the #+X_ADDRESS.
The following letter now exports "as expected". In particular when
special-headings is t heading values have presedence so the
from address would be ="Rasmus\nEmacs\nOrg-mode"= where the
=\n=s would be escaped. If specia-headings is nil (default)
the from would be my-adr. The same is true for TO address.
Here's the contents
* from :from:
Rasmus
Emacs
Org-mode
On a technical note, note that the default value will be used if
neither #+X_ADDRESS or a heading is given.
Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
* ox-koma-letter.el: updated documentation and improved defcustoms.
(org-koma-letter-special-tags-after-letter)
(org-koma-letter-special-tags-after-closing): now symbol.
(org-koma-letter--get-custom): falls back to value
(org-koma-letter--prepare-special-contents-as-macro): let
newlines be handled outside of the function
(org-koma-letter--remove-offending-new-lines): function to add
new lines.
(org-koma-letter-headline): updated to work with symbols and
made more robust.
(org-koma-letter-export-to-latex): reset
=`org-koma-letter-special-contents'= to nil
Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
* ox-koma-letter.el: =`org-koma-letter-subject-format'= can now be a list. Default is t.
If nil neither subject format nor type is exported.
* ox-koma-letter.el (org-koma-letter-template): better subject handling.
* ox-koma-letter.el (org-koma-letter-template): allow for t value of =#+OPTIONS: subject:VALUE=
* ox-koma-letter.el (org-koma-letter-template): export of subject format is independent
of title, but title is not independent of =:with-subject=.
The issue was with =#+OPTIONS: subject:t= one would get a LaTeX error.
New behavior:
If =#+OPTIONS: subject:(x,y)= then =\KOMAoption{subject}{x, y}=.
If =subject:x= then =\KOMAoption{subject}{x}=.
If =subject:t= then =\KOMAoption{subject}{...}= is not set but
\setkomavar{subject}{...} is set (in the output file)
If =subject:nil= neither are printed.
Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
* ox-koma-letter.el(org-koma-letter-signature): set to nil.
The previoues value corresponds to the default value cf. the the koma
manual pp. 183.
Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
* ox-koma-letter.el (org-koma-letter-special-tags-after-closing):
specials tags inserted after =\end{closing}=.
* ox-koma-letter.el (org-koma-letter-special-tags): collect
the special lists.
* ox-koma-letter.el (org-koma-letter-headline): stores content
in of headline if the first tag is special. Otherwise return content.
* ox-koma-letter.el (org-koma-letter-special-content): holds special
content temporarily.
* ox-koma-letter.el (org-koma-letter--format-string-as-macro): format a string as
a macro or don't.
* ox-koma-letter.el (org-koma-letter-template): added support
for the headings with special tags.
The following example will now export a sensible manner.
* my letter
here's a letter
* PS :ps:
it's requires this patch
* CC :cc:
Nicolas, Viktor and Alan
* ENCL :encl:
many patches
1. this patch
2. another patch.
* include patches :after_letter:
\myspecialmacro
\includepdf{pdf}
Namely, content of ps, encl and cc headings will be exported after
\closing{.} in the order prescribed by
=`org-koma-letter-special-tags-after-closing'= as a (LaTeX) macro
removing trailing and leading newlines. The macro is the same as the
tag, althogh the case is determined by the special list.
The concents of the =after_letter= heading will be inserted after
=\end{letter}= and newlines are preserved.
Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
* ox-koma-letter.el (org-koma-letter-author): defaults to a function
that returns =`user-full-name'=.
Setting the variables `org-koma-letter-author' and
`org-koma-letter-email' to the values of `user-full-name' and
`user-mail-address' respectively, allows the user to skip =#+AUTHOR:=
and =#+EMAIL:= lines when configuring a letter. However, if the user
wishes to set this information in LCO files, these variables need to
be set to nil.
With the old after-init-hook method my user name was always set to "".
Now org-koma-letter will (i) allow for default nil values (good if you
use LCO files); (ii) default to =`user-full-name'= and
=`user-mail-address'= like =ox-latex.el=. These values are obtained
on-the-fly.
The two variables in question can also be strings or functions
returning strings.
Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
* ox-koma-letter.el: changed the unorthodox =SENDER= keyword to
the ordinary =AUTHOR= keyword.
* ox-koma-letter.el: changed email to work as in standard
latex exporter and dropped dedicated ox-koma-letter variable.
Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>