Menu

#26 DIN5008A.lco and DIN5008B.lco: outer and inner position of backaddr

Never ever
wont-fix
nobody
2022-05-28
2022-05-28
Ben
No

In scrlttr2 using DIN5008A.lco or DIN5008B.lco

I'm trying to correctly set a backaddr. The bug gets visible if backaddrheight is enlarged. (I don't have access to the DIN 5008 norm, but basing on online research, the backaddr-field should be filled from bottom to top.) In the two mentioned .lco's the outer and inner position of the backaddr-parbox is set to top instead of bottom.

For illustration purposes I added \setlength\fboxsep{0cm}% and \fbox{ ... }.

MWE:

\documentclass{scrlttr2}
\LoadLetterOption{DIN5008B-new}

\LoadLetterOption{visualize}
\showfields{address}

\setplength{backaddrheight}{22.5mm}

\begin{document}
\begin{letter}{}
\setkomavar{fromname}{a}
\setkomavar{fromaddress}{b}

\setkomavar{toname}{c}
\setkomavar{toaddress}{d}

\setkomavar{subject}{e}

\opening{f}

g

\closing{h}

\end{letter}

\end{document}

.lco

%%
%% This is file `DIN5008B-new.lco` derived from `DIN5008B.lco',
%% generated with the docstrip utility, extended by scrdocstrip.
%%
%% The original source files of `DIN5880B.lco` were:
%%
%% scrkernel-version.dtx  (with options: `trace')
%% scrkernel-letterclassoptions.dtx  (with options: `lco,5008,B,head')
%% scrkernel-letterclassoptions.dtx  (with options: `lco,5008,B,body')
%% 
%% Copyright (c) of `DIN5008B.lco` was 1994-2019 Markus Kohm [komascript at gmx info]
%% But Markus Kohm is not repsonsible for this file `DIN5008B-new.lco.
%% 
%% The original file `DIN5008B.lco` was generated from file(s) of the KOMA-Script bundle.
%% ---------------------------------------------------------------
%% 
%% It may be distributed under the conditions of the
%% LaTeX Project Public License in the version distributed together
%% with KOMA-Script, see file `lppl.txt' or `lppl-de.txt'.
%% 
%% This file may only be distributed together with a copy of the
%% KOMA-Script bundle.  You may however distribute the
%% KOMA-Script bundle without all such generated files.  See also
%% `lppl.txt' or `lppl-de.txt' for additional information.
%% 
%% The list of files belonging to KOMA-Script distribution is given in
%% the file `manifest.txt'.  See also `lppl.txt' or `lppl-de.txt' for
%% additional information.
%% 
%% If this file is a beta version, you may not be allowed to distribute
%% it.  Look at the comments below to see if this is the case.
%% 
%% English and German manuals are part of KOMA-Script bundle.
%% ----------------------------------------------------------
%% 
%% See `README'.
%% 
%% The KOMA-Script bundle (but maybe not this file) was based upon the
%% LaTeX 2.09 Script family created by Frank Neukam 1993 and the LaTeX2e
%% standard classes created by The LaTeX3 Project 1994-1996.  You can
%% find a complete unmodified copy of LaTeX2e at
%% <http://mirror.ctan.org/tex-archive/macros/latex/base/>.
%% 
%%% From File: $Id: scrkernel-version.dtx 3586 2021-03-17 13:57:48Z kohm $
\begingroup
  \catcode`\@11\relax
  \ifx\KOMAScriptVersion\undefined
    \newcommand*{\@CheckKOMAScriptVersion}[1]{%
      \gdef\KOMAScriptVersion{#1}%
    }%
  \else
    \newcommand*{\@CheckKOMAScriptVersion}[1]{%
      \def\@tempa{#1}%
      \ifx\KOMAScriptVersion\@tempa\else
        \@latex@warning@no@line{%
          \noexpand\KOMAScriptVersion\space is
          `\KOMAScriptVersion',\MessageBreak
          but `#1' was expected!\MessageBreak
          You should not use classes, packages or files
          from\MessageBreak
          different KOMA-Script versions%
        }%
      \fi
    }
  \fi
  \@CheckKOMAScriptVersion{2021/03/17 v3.33 KOMA-Script}%
\endgroup
%%% From File: $Id: scrkernel-letterclassoptions.dtx 3453 2020-02-25 07:33:30Z kohm $
%%%            (run: head)
\ProvidesFile{%
 5008%
    B%
  -new.lco}[\KOMAScriptVersion\space letter-class-option]
\LoadLetterOption{%
  DIN%
}
%%% From File: $Id: scrkernel-letterclassoptions.dtx 3453 2020-02-25 07:33:30Z kohm $
%%%            (run: body)
\@setplength{toaddrindent}{%
  5mm}
\@setplength{locvpos}{%
  \dimexpr\useplength{toaddrvpos}+\useplength{backaddrheight}}
\@setplength{specialmailindent}{\useplength{toaddrindent}}
\@setplength{specialmailrightindent}{\z@}
\@setplength{locwidth}{%
  75mm}
\@setplength{lochpos}{10mm}
\@setplength{firstheadhpos}{%
  \dimexpr \useplength{toaddrhpos}+\useplength{toaddrindent}}
\@setplength{firstheadwidth}{%
  \dimexpr 125mm-\useplength{firstheadhpos}}
\@setplength{firstfoothpos}{%
  \dimexpr\useplength{toaddrhpos}+\useplength{toaddrindent}}%
\@setplength{firstfootwidth}{%
  \dimexpr \paperwidth-\useplength{toaddrhpos}-\useplength{firstfoothpos}}%
\ifnum \scr@compatibility >\@nameuse{scr@v@2.9t}\relax
  \@setplength{firstfootvpos}{\paperheight}
  \@addtoplength{firstfootvpos}{-16mm}
\else
  \@setplength{firstfootvpos}{1in}
  \@addtoplength{firstfootvpos}{\topmargin}
  \@addtoplength{firstfootvpos}{\headheight}
  \@addtoplength{firstfootvpos}{\headsep}
  \@addtoplength{firstfootvpos}{\textheight}
  \@addtoplength{firstfootvpos}{\footskip}
\fi
\@setplength{refaftervskip}{%
  8.46mm}
\@newplength{specialmailheight}
\@setplength{specialmailheight}{12.7mm}
\areaset[5mm]{165mm}{233mm}
\KOMAoptions{%
  fromalign=locationleft,
  addrfield=topaligned,
  refline=narrow,
  parskip=full
}
\l@addto@macro\@PapersizeWarning{%
  \begingroup
    \@tempswafalse
    \ifdim\oddsidemargin<\dimexpr 25mm-1in-1pt\relax\@tempswatrue\else
      \ifdim\oddsidemargin>\dimexpr 25mm-1in+1pt\relax\@tempswatrue\fi\fi
    \ifdim\textwidth<\dimexpr \paperwidth-45mm-1pt\relax\@tempswatrue\else
      \ifdim\textwidth>\dimexpr \paperwidth-45mm+1pt\relax\@tempswatrue\fi\fi
    \if@tempswa
      \LCOWarning{DIN5008%
        B%
      -new}{%
        DIN5008 orders exact margins and text\MessageBreak
        width. Without following these values,\MessageBreak
        your document does not conform DIN5008.\MessageBreak
        You should use, e.g.,\MessageBreak
        \space\string\areaset[5mm]{%
          \the\dimexpr \paperwidth-45mm\relax}{%
          \the\dimexpr 1.414\dimexpr \paperwidth-45mm\relax\relax}\MessageBreak
        to follow the norm%
      }%
    \fi
    \ifdim \dimexpr\parskip\relax=\dimexpr\baselineskip\relax\else
      \LCOWarning{DIN5008%
        B%
      -new}{%
        DIN5008 orders paragraph separation by\MessageBreak
        exactly one line. Without this, your\MessageBreak
        document does not conform DIN5008.\MessageBreak
        You shoud use, e.g.,\MessageBreak
        \space\string\KOMAoption{parskip}{full}\MessageBreak
        to follow the norm%
      }%
    \fi
  \endgroup
}
\renewcommand{\backaddr@format}[1]{\hspace*{\useplength{toaddrindent}}%
  \setlength\fboxsep{0cm}% <==================================================================================================================================
  \fbox{\parbox[b][\useplength{backaddrheight}][b]% <=========================================================================================================
         {\dimexpr\useplength{toaddrwidth}-\useplength{toaddrindent}}%
         {\strut\ignorespaces #1\ifhmode\scr@endstrut\fi}}% <=================================================================================================
}
\renewcommand{\specialmail@format}[1]{%
  \parbox[t][\useplength{specialmailheight}][t]%
         {\dimexpr\useplength{toaddrwidth}
                 -\useplength{specialmailindent}
                 -\useplength{specialmailrightindent}}%
         {\strut\ignorespaces #1\ifhmode\scr@endstrut\fi}%
}
\setkomafont{specialmail}{\sffamily\fontsize{10pt}{12pt}\selectfont}
\setkomafont{backaddress}{\sffamily\fontsize{8pt}{10pt}\selectfont}
\setkomafont{addressee}{\sffamily\fontsize{10pt}{12pt}\selectfont}
\setkomafont{fromname}{\sffamily\fontsize{10pt}{12pt}\selectfont}
\setkomafont{fromaddress}{\sffamily\fontsize{10pt}{12pt}\selectfont}
\setkomafont{refvalue}{\sffamily\fontsize{10pt}{12pt}\selectfont}
\let\raggedsignature\raggedright
\endinput
%%
%% End of file `DIN5008B-new.lco'.

Related

Issues: #68

Discussion

  • Markus Kohm

    Markus Kohm - 2022-05-28

    KOMA-Script has two fields for two lines above the address lines backaddr and specialmail.

    BTW: Changing the height of the backaddr would also break the norm and therefore makes no sense for reporting norm bugs. Moreover, the German user guide states:

    Zu den lco-Dateien DIN5008A und DIN5008B sei angemerkt, dass die entsprechenden Vor-
    schriften gewisse Spielräume aufweisen und, wie diversen Anfragen beim Autor zu entnehmen
    ist, viele Anwender diese nicht nur auszureizen wünschen, sondern auch die eine oder andere
    Abweichung von der Norm bevorzugen. Die beiden Dateien implementieren jedoch jeweils nur
    eine einzige Interpretation der Norm. Der Leser sei daher daran erinnert, dass diese Dateien
    lediglich als Vorlagen zu begreifen sind, um das Erstellen eigener angepasster lco-Dateien zu
    erleichtern.

    Documentation of DIN5008A.lco and DIN5008B.lco seem to miss in the English user manual (maybe because they should not be relevant for other languages, but fixed in [r3848] for the new documentation source structure only).

    However, if you want another interpretation, you can use, e.g., a top aligned \parbox of height \useplength{backaddr} with bottom aligned content inside your backaddr . You may also change the \parbox for specialmail to use bottom aligned content instead of top aligned.

     

    Related

    Commit: [r3848]


    Last edit: Markus Kohm 2022-05-28
  • Markus Kohm

    Markus Kohm - 2022-05-28
    • labels: --> feature request
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -38,18 +38,19 @@
     .lco
     ~~~
     %%
    -%% This is file `DIN5008B.lco&#39;,
    +%% This is file `DIN5008B-new.lco` derived from `DIN5008B.lco&#39;,
     %% generated with the docstrip utility, extended by scrdocstrip.
     %%
    -%% The original source files were:
    +%% The original source files of `DIN5880B.lco` were:
     %%
     %% scrkernel-version.dtx  (with options: `trace&#39;)
     %% scrkernel-letterclassoptions.dtx  (with options: `lco,5008,B,head&#39;)
     %% scrkernel-letterclassoptions.dtx  (with options: `lco,5008,B,body&#39;)
     %% 
    -%% Copyright (c) 1994-2019 Markus Kohm [komascript at gmx info]
    -%% 
    -%% This file was generated from file(s) of the KOMA-Script bundle.
    +%% Copyright (c) of `DIN5008B.lco` was 1994-2019 Markus Kohm [komascript at gmx info]
    +%% But Markus Kohm is not repsonsible for this file `DIN5008B-new.lco.
    +%% 
    +%% The original file `DIN5008B.lco` was generated from file(s) of the KOMA-Script bundle.
     %% ---------------------------------------------------------------
     %% 
     %% It may be distributed under the conditions of the
    @@ -108,7 +109,7 @@
     \ProvidesFile{%
      5008%
         B%
    -  .lco}[\KOMAScriptVersion\space letter-class-option]
    +  -new.lco}[\KOMAScriptVersion\space letter-class-option]
     \LoadLetterOption{%
       DIN%
     }
    @@ -163,7 +164,7 @@
         \if@tempswa
           \LCOWarning{DIN5008%
             B%
    -      }{%
    +      -new}{%
             DIN5008 orders exact margins and text\MessageBreak
             width. Without following these values,\MessageBreak
             your document does not conform DIN5008.\MessageBreak
    @@ -177,7 +178,7 @@
         \ifdim \dimexpr\parskip\relax=\dimexpr\baselineskip\relax\else
           \LCOWarning{DIN5008%
             B%
    -      }{%
    +      -new}{%
             DIN5008 orders paragraph separation by\MessageBreak
             exactly one line. Without this, your\MessageBreak
             document does not conform DIN5008.\MessageBreak
    @@ -210,5 +211,5 @@
     \let\raggedsignature\raggedright
     \endinput
     %%
    -%% End of file `DIN5008B.lco&#39;.
    -~~~
    +%% End of file `DIN5008B-new.lco&#39;.
    +~~~
    
    • status: open --> wont-fix
    • Milestone: KOMA-Script 3.37 --> Never ever
     
  • Markus Kohm

    Markus Kohm - 2022-05-28

    Please don't identify a derived file as the original file from KOMA-Script.

     
  • Markus Kohm

    Markus Kohm - 2022-05-28

    BTW: Users are always welcome to distribute their own lco files (but please respect the LPPL of the original files), e.g., via SourceForge , github, gitlab etc. and also via CTAN. There is already an additional CTAN package of mine and another one of Hannu Väisänen.

     

Log in to post a comment.