0

I am writing a long letter with sections, adressed to a public Institution in Mexico. I have to use letter sized paper and 12 pt. So I put the section.lco extra code in the place where I am writing the letter. But when I compile the letter I have various issues. The "From" address and name, supposed to be at the right upper corner, doesn't appear. If I put the opening the letter doesn't compile. If I put the "To Blablabla" right after the \begin{letter} as shown in the examples, that text also doesn't appear. The first and third problems do not produce any complain from pdflatex, it just silently ignores them. Here is my code simplified.

\documentclass[
fontsize=12pt,
  paper=letter,
  parskip=half,
  enlargefirstpage=on,    % More space on first page
 % fromalign=right,        % PLacement of name in letter head
 % fromphone=on,           % Turn on phone number of sender
 % fromrule=aftername,     % Rule after sender name in letter head
  addrfield=on,           % Adress field for envelope with window
  backaddress=on,         % Sender address in this window
  subject=beforeopening,  % Placement of subject
  locfield=narrow,        % Additional field for sender
%  foldmarks=on, % Print foldmarks
  sections 
]{scrlttr2}

\usepackage[spanish]{babel}

\setkomavar{fromaddress}{Ciudad de México}
\setkomavar{place}{From City}
\setkomavar{date}{\today}

\setkomavar{signature}{
Yo Merolas\\
}

\begin{document}

\setkomavar{fromaddress}{Ciudad de México, Marzo del 2023}
\setkomavar{place}{Ciudad de México}
\setkomavar{date}{\today}


\begin{letter}
% If I put this right above this, it doesn't appear on the pdf
{Hospital Infantil de Mexico}

Bla bla bla

\section

Bla bla bla

\section

bla bla bla bla



\closing{Atentamente,
}
\end{letter}

\end{document}
4
  • 1
    Please tell us where you got the section.lco, it isn't part of a standard TeXLive installation. Without that file your example isn't compilable for anyone else.
    – Skillmon
    Commented Mar 28, 2023 at 18:41
  • I got it from the author of scrltt2, namely, here: komascript.de/sections.lco. But, As a matter of fact, I can delete the sections and the "sections option" and the problem persists.
    – wpkzz
    Commented Mar 28, 2023 at 19:10
  • don't understand me wrong, it's not about me not being able to find it, but it is about making your question self-contained, so if your issue doesn't depend on section.lco and your usage of the \section macro it shouldn't be part of your question.
    – Skillmon
    Commented Mar 28, 2023 at 19:23
  • Oh, do not worry. I have always problems phrasing the questions right. TeX is so huge that for me is impossible to know what is standard and what is extra.
    – wpkzz
    Commented Apr 5, 2023 at 21:25

1 Answer 1

2

Important: useage of section.lco is outdated. See komascript.de/sections.lco

If you need sections in a letter, use class scrartcl and load package scrletter or use the wrapper class scrletter.

Class scrlttr2 and package scrletter load file DIN.lco by default. This file provides parameters for letters on A4 paper, complying with German standards. If you use letter sized paper with an envelope of an other country, it could be that you have to adjust the position of the address field, so that it fits the window of your envelope.

If you need an other lco file, use \LoadLetterOption or \LoadLetterOptions.


To get the letter elements on the first page add

\opening{salutation}

in the letter environment.

Which fromaddress do you want to use? The last definition wins. In your code this would be »Ciudad de México, Marzo del 2023«.

There is no fromname given in your MWE.

If the senders address and name should be positioned right, enable fromalign=right.

\section requires an argument.

Example:

\documentclass[
  fontsize=12pt,
  paper=letter,
  parskip=half
]{scrartcl}

\usepackage[
  enlargefirstpage=on,    % More space on first page
  fromalign=right,        % PLacement of name in letter head
 %fromphone=on,           % Turn on phone number of sender
 %fromrule=aftername,     % Rule after sender name in letter head
  addrfield=on,           % Adress field for envelope with window
  backaddress=on,         % Sender address in this window
  subject=beforeopening,  % Placement of subject
  %locfield=narrow,       % Size of additional field for sender (default: narrow)
  %foldmarks=on           % Print foldmarks (default: on)
  ]{scrletter}

\usepackage[spanish]{babel}

\setkomavar{fromname}{Yo Merolas}
\setkomavar{fromaddress}{Ciudad de México\\streetname}
\setkomavar{place}{Ciudad de México}
%\setkomavar{date}{\today}% <- default
%% or do yo want
%\setkomavar{date}{Marzo del 2023}

\begin{document}
\begin{letter}{Hospital Infantil de Mexico}
\opening{Estimados señores y señoras,}% or at least \opening{}
Bla bla bla
\section{First section}
Bla bla bla
\section{Second section}
bla bla bla bla
\closing{Atentamente,}
\end{letter}
\end{document}

enter image description here

2
  • Thanks thanks. Now, how do I suppress the redundant fromname that is underlined?!!
    – wpkzz
    Commented Apr 17, 2023 at 18:24
  • 1
    Change backaddress=on (this is the default setting) to backaddress=off. Then the underlined backaddress will be suppressed.
    – esdd
    Commented May 13, 2023 at 14:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .