Comments (15)
An interesting idea. I never before tried to create sections in a letter. The naive way # section one
does not work
! Undefined control sequence.
<argument> \section
{section one}\label {section-one}
l.95 \section{section one}\label{section-one}}
I will research where that error occurs and report back.
from komaletter.
It seems to be more complicated.
This package employs the KOMA-Script class scrlttr2
, which does not support sections. There was a "hack" to add sections after the fact (by the author of KOMA-Script), which is now deprecated.The way recommended now is to combine KOMA-Script classes such als scrartl
with the package scrletter
(example).
Switching to scrletter
would cause a major overhaul of the plumbing of komaletter. So, not my favorite solution. For now I will have a look at the old hack and see if I can use some of its parts.
Just to better understand your use case, are you trying to write legal letters such as this KOMA-Script dummy example?
from komaletter.
Hi,
not for a legal letter, but for an academic letter of motivation.
I just wanted to divide the information in sections. For now, I did it with
\vspace{.5cm}
Section
\vspace{.5cm}
But it's not the nicest approach, and sometimes spacing goes crazy.
from komaletter.
Hi Bruno,
I couldn't resist and added sections to the default letter layout loosely following Markus Kohm's hack. I reduced the before and after section title vertical space to something more letter friendly.
Please test my changes in branch sections
and let me know what you think about the implementation and the spacing. This is a first experiment and I'm open to adjustments and better ideas ;-)
remotes::install_github("rnuske/komaletter", ref="sections")
Here some samples:
- Rmd: test_sections.Rmd.txt
- PDF: test_sections.pdf
- PDF: test_sections_nr.pdf
from komaletter.
That's great! I'll check it soon!
from komaletter.
Nope, it didn't work:
---
author: Bruno Nicenboim
return-address:
- xxxx
- xxx
address:
- xxxx
subject:
opening: Dear
closing: Best regards,
signature: Dr. Bruno Nicenboim
lco: NF
output: komaletter::komaletter
---
text text text
## Section
blah blah
from komaletter.
ahh, you built your own lco. The changes are in the komaletter default lco
and thus only kick in if you do not specify a custom lco
. Have a look at the changed default lco
and copy the last part starting with "% Hack to provide sections -------" to your lco
then you should have sections in your lco as well.
Please let me know if this works.
It would be gorgeous if you could test the branch without your lco, just to check whether the changes work as intended on a different machine.
from komaletter.
ha, I just uninstalled R because I keep having "segfault/core dump" errors (unrelated to this package, of course). So it'll take me some time.
BTW, I didn't built the lco, I used one of the ones that come with komaletter
from komaletter.
ups,
I didn't spot that the lco
you used is the standard french letter layout. NF
is provided by KOMA-Script. On my computer (Ubuntu Linux 20.04) it is under /usr/share/texlive/texmf-dist/tex/latex/koma-script/NF.lco
. NF
doesn't either have the sections. So, I copied NF.lco
renamed it to NF.w.sections.lco
(underscores get mangeled by pandoc/LaTeX) in my working directory and added the sections-hack. See attached files (remove txt extension, it's only to get the files into github)
puh, I guess I will start working on the switch to "scrartl + scrletter" sooner rather than later
from komaletter.
@bnicenboim
I would like to merge the branch to master.
Were you able to test the default-lco with sections or the NF.w.sections.lco
? Do you approve of the vertical spacing around the sections?
Thanks Robert
from komaletter.
I copied this file "NF.w.sections.lco" and it didn't work. (I got an error when I tried to knit the doc.) Should I overwrite the original file?
from komaletter.
You do not need to overwrite the original NF.lco
.
The easiest case is NF.w.sections.lco
and BrunosTest.Rmd
in the same directory. BrunosTest.Rmd
should than knit without problems. At least it works for me in RStudio with the the CRAN version and section-Branch of the Github version.
from komaletter.
Yes, it worked! Sorry for the delay.
I would prefer to have a little bit more space below the section, but besides that it looks great. Even the numbering works.
(It doesn't distinguish between #,##, and ###, but I guess it's fine like that).
And notice that it doesn't accept paragraphs ####.
from komaletter.
good to know, thanks for testing.
I followed the example of Markus Kohm and chose \normalsize\bfseries\sffamily
for the sections. So all section level have the same styling. The only difference is the amount of space before and after the sections (see test_sections.pdf).
Would you like to have the fourth level of sectioning? I thought maybe three level would be enough in a letter. If the pargraph is needed I could add it, maybe just \normalsize\sffamily
without making it bold.
Would you like more space after section
, subsection
and subsubsection
or only after subsubsection
?
from komaletter.
I think the spacing looks fine in your example.
And adding the paragraph is a good idea.
from komaletter.
Related Issues (16)
- broken table in intro vignette
- wrapping long return-adresses HOT 2
- Double sender address HOT 3
- hyperlinked text print the url as a footnote HOT 3
- Adding references does not seem to work. HOT 4
- Adding letterhead/logo on top of letter HOT 4
- Error linked to polyglossia’s `\setmainlanguage` – Switch to babel recommended HOT 3
- Wide tables don't render HOT 4
- Avoid number of pages (from page 2)
- address as parameter HOT 8
- default for YAML parameter `opening` HOT 1
- komaletter w/o address? HOT 1
- Font HOT 5
- Not able to knit documents with Rmarkdown anymore HOT 5
- komaletter output cannot be rendered on Windows HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from komaletter.