Am 24.09.21 um 07:58 schrieb Dr Eberhard Lisse:

here is the complete letter with the accompanying Koma Letter Class
Option file, which either needs to be in the same directory or in one
which texhash (which MUST be run after each change) can find.

Look into the document's preamble (at the end). The command
\myISOdate  should be set in your document as a date field and
not in the preamble. I never used scrlettr2 so I do not know how to
 define such a field in LyX. Then you can input a date different from \today

Herbert
%
% Load EITHER the DIN Letter from Koma Script or the US one by commenting
% out the other
% 
\LoadLetterOption{DIN}
%
%\LoadLetterOption{UScommercial9}
%
% Options
% 
\KOMAoptions{%
    addrfield=true%            print an address field?
    ,backaddress=true%         print the back address?
    ,enlargefirstpage=true%
    ,foldmarks=true%           print foldmarks?
    ,footsepline=false%        separate the footer with a line on page >1
    ,fromalign=center%         alignment of the address
    ,fromemail=false%          print sender e-mail address
    ,fromfax=false%            print sender fax number
    ,fromlogo=false%           print a logo (position depends on fromalign)
    ,fromphone=false%          print sender phone number
    ,fromrule=afteraddress%    separate the address with a line?
    ,fromurl=false%            print sender URL
    ,headsepline=false%        separate the header with a line on page >1
    ,pagenumber=botright%      position of the page number (see docu)
    ,parskip=half%             Use indent instead of skip
    ,refline=wide%             layout of the refline
    ,paper=a4%                 pagesize
}

% 
% set some lengths for the letter
% 
\makeatletter
\@setplength{sigindent}{0mm}
\@setplength{specialmailindent}{0truecm}
\@setplength{specialmailrightindent}{\fill}
\@setplength{refvpos}{89mm}
\@setplength{refaftervskip}{10pt}
\@setplength{firstfootvpos}{7cm}
\@addtoplength{firstfootvpos}{\textheight}
%
% NEW
%
\@addtoplength{firstfootvpos}{\footskip}
\makeatother

%
% Load some packages
% 
% If I want to test the letter output
% 
\usepackage{lipsum}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% to get to the URLs with proper breaking, needs some work
% to survive turning this on in LyX
%
\usepackage{hyperref}
\hypersetup{%
   breaklinks=true,
   colorlinks=true,
   linkcolor=black,
   pdfborder={0 0 0},
   pdfborderstyle={},
   urlcolor=blue, 
}
\usepackage{xurl}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\KOMAoptions{DIV=13}
%
% I like the ISO Date
% 
\providecommand*{\LCORequirePackage}[2][]{%
  \if@atdocument
    \scr@ifundefinedorrelax{ver@#2.sty}{%
      \GenericError{%
        (nanicmict.lco)\@spaces\@spaces\@spaces\@spaces
      }{%
        LCO-File nanicmict.lco Error: Package `#2' not loaded%
      }{%
        See the documentation of nanicmict.lco for explanation.%
      }{%
        This lco-file needs serveral packages. But packages can be loaded only
        before\MessageBreak
        \string\begin{document}. You've used the lco-file after
        \string\begin{document} so it cannot\MessageBreak
        load the needed packages.\MessageBreak
        You should either add \string\LoadLetterOption{nanic} before
        \string\begin{document}\MessageBreak
        or load package `#2' using \string\usepackage[#1]{#2}
        before\MessageBreak
        \string\begin{document}.
      }%
    }{}%
  \else
    \RequirePackage[#1]{#2}%
  \fi
}
\LCORequirePackage{scrdate}

%
% page # of ## pages
% 
\usepackage{lastpage}
%
% for the fancy header and footer formatting
% 
\usepackage[automark]{scrlayer-scrpage}

\pagestyle{scrheadings}

\firstfoot{%
   \centering{%
      \hrulefill\newline
      \footnotesize{%
         \textsf{%
            Practice Nr: 016-000-141135\\
            SWAMed Building 2$^{nd}$ Floor $\cdot$ John Meinert
            Street $\cdot$ Windhoek $\cdot$ Namibia\\
            Telephone: +264 61 236403 $\cdot$ Cell: +264 81 124
            6733 $\cdot$ Fax: +264 88 624273 $\cdot$
            Email: \href{mailto:d...@lisse.na}{d...@lisse.na}\\
            GPG Fingerprint: 7399 BE0B AEFB 4AE5 EDB9 4A54 9705 1DA3 7945 3FAB
         }
      }
   }
}
                


\clearscrheadfoot
\lohead[\usekomavar{fromname}]{\usekomavar{fromname}}
\rohead[\usekomavar{subject}]{\usekomavar{subject}}
%\ofoot[Page \pagemark\ of \pageref{LastPage}]
%      {Page \pagemark\ of \pageref{LastPage}}
\ofoot{Page \pagemark\ of \pageref{LastPage}}




%
% Sender's Name, in LARGE font, then practice details, since the 
% address goes into the footer
% 
\setkomavar{fromname}{\textsc{Dr Eberhard W Lisse}}
\setkomafont{fromname}{\LARGE}
\setkomavar{fromaddress}{Obstetrician \& Gynaecologist}
\setkomafont{fromaddress}{\large}

%
% default signature, left justified
%
\setkomavar{signature}{Dr Eberhard W Lisse}
\renewcommand*{\raggedsignature}{\raggedright}

%
% This goes in the Window of the envelope with a cosmetic separator 
% in netween each line
% 
\setkomavar{backaddress}{Dr Eberhard W Lisse\\
    PO Box 8421\\
    Bachbrecht\\10007\\
    Namibia}
\setkomavar{backaddressseparator}{ $\cdot$ }


% 
% redefine the reference line
% 
\AtBeginLetter{%
    \renewcaptionname{english}{\myrefname}{My ref.}
    \renewcaptionname{english}{\yourmailname}{Your letter}}
%
% Per default the captions are empty (and the ISO Date of today is 
% inserted, but this can be easily redefined in the letter
% 

%\setkomavar{date}{\myISOdate}
\setkomavar{myref}{~}
\setkomavar{yourref}{~}
\setkomavar{yourmail}{~}

Attachment: bookoff.pdf
Description: Adobe PDF document

#LyX 2.3 created this file. For more info see http://www.lyx.org/
\lyxformat 544
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass scrlttr2
\begin_preamble
\usepackage{noto}

%% LUA: Winkel des Gesamtstempels -- willk\"{u}rlich 
%% zwischen -5 und +5 Grad -- bei jedem Dokument anders
\usepackage{luacode}
\newcommand\rot{\directlua{tex.sprint(math.random(-5,5))}}

\usepackage{tikz}
\usepackage{xpatch}



%% XCOLOR: Farbdefinitionen
\definecolor{stampink}{RGB}{122 150 165}

%% LATEX: Individuelle Definitionen f\"{u}r den Stempel (Formatierung 
Gr\"{o}{\ss}e und Schriftstil)
\newcommand\myStampName{Dr Eberhard W Lisse}
\newcommand\myStampProf{Obstetrician \& Gynecologist}
\newcommand\myStampPO{PO Box 8421 Bachbrecht}
\newcommand\myStampNo{016-000-0141135}

\newcommand\myStampArrangement{%
   \setsansfont{Linux Biolinum O}
   \parbox{3cm}{%
      \centering\sffamily
      \footnotesize\myStampName\\
      \tiny\myStampProf\\
      \scriptsize\myStampPO\\
      \myStampNo\\
      \footnotesize\myStampDate
   }
   \setsansfont{IBM Plex Sans}
}

%% TIKZ: Laden notwendiger Styles
\usetikzlibrary{fit}

%% Erstellen eines Befehls f\"{u}r den Stempel in einer Gr\"{o}{\ss}e von 6 cm 
x 3 cm skaliert
\newcommand\Stamper{%
\resizebox{8cm}{3cm}{%
\begin{tikzpicture}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% 
%% TIKZ: Setzen der linken unteren und rechten oberen Ecke des Rechtecks
\coordinate (dm1) at (0,0);
\coordinate (dm2) at (2.6,1.4);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% TIKZ: Schleife f\"{u}r drei Winkel
\foreach \r in {-0.9,0,0.9}{%
%% TIKZ: Rahmmen des Stempels: Rechteck, Farbe=stampink, Transparenz=0.4, 
Linienst\"{a}rke des Rahmens=1pt
%%       und einen Knoten namens (bx4) definieren
\node[rectangle,draw,stampink,opacity=.4,line width=1.2pt,rotate=\r, rounded 
corners=1pt][fit=(dm1)(dm2)](bx4){};
%% TIKZ: Stempeltext: Farbe=stampink, gedreht um den Winkel \r mit 
Transparenz=0.4 in Knoten (bx4) gesetzt
\node[stampink,rotate=\r,opacity=.4] at (bx4){\myStampArrangement};
}
\end{tikzpicture}
}}

%% SCRLTTR2 & XPATCH: Erstellen einer neuen Variablen f\"{u}r den Brief zur 
Positionierung des Stempels rechts von \closing
\newkomavar{rightbesidesignature}
\newlength{\normalparskip}
\xapptocmd{\closing}{%
  \setlength{\normalparskip}{\parskip}%
  \noindent\parbox[b][0pt]{\linewidth}{\raggedleft
    \setlength{\parskip}{\normalparskip}%
    \usekomavar{rightbesidesignature}\ifhmode\unskip\strut\fi
    \vspace{-1.8\baselineskip}%
    \vspace{\parskip}%
    \vspace{\lineskip}%
  }%
}{}{}

%% SCRLTTR2: Einf\"{u}gen des Stempels mit der jeweiligen willk\"{u}rlichen 
Gesamtdrehung \rot
\setkomavar{rightbesidesignature}{\rotatebox[origin=c]{\rot}{\Stamper}}


\def\myISOdate#1{\ifx\relax#1\relax
    \setkomavar{date}{\ISOToday}%
    \let\myStampDate\ISOToday
  \else
    \setkomavar{date}{#1}%
    \def\myStampDate{#1}%
  \fi}
\myISOdate{\ISOToday}% default


\myISOdate{2021-09-21}
\end_preamble
\options drlisse
\use_default_options true
\maintain_unincluded_children false
\begin_local_layout
Format 66
PackageOptions fontspec no-math
Requires fontspec
\end_local_layout
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman "default" "default"
\font_sans "default" "default"
\font_typewriter "default" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 85 85
\use_microtype true
\use_dash_ligatures true
\graphics default
\default_output_format pdf5
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize 10
\spacing single
\use_hyperref false
\papersize default
\use_geometry false
\use_package amsmath 0
\use_package amssymb 0
\use_package cancel 0
\use_package esint 0
\use_package mathdots 1
\use_package mathtools 0
\use_package mhchem 1
\use_package stackrel 0
\use_package stmaryrd 0
\use_package undertilde 0
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 0
\use_minted 0
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\is_math_indent 0
\math_numbering_side default
\quotes_style english
\dynamic_quotes 0
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header

\begin_body

\begin_layout Address
\begin_inset space ~
\end_inset


\end_layout

\begin_layout Title
Medical Certificate
\end_layout

\begin_layout Subject
Ms Jane Doe, DoB 1900-12-31
\end_layout

\begin_layout Myref
My Ref
\end_layout

\begin_layout Yourref
Your Ref
\end_layout

\begin_layout Yourmail
2021-08-01
\end_layout

\begin_layout Signature
Dr Eberhard W Lisse
\end_layout

\begin_layout Opening
\begin_inset space ~
\end_inset


\end_layout

\begin_layout Standard
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
lipsum[1-2]
\end_layout

\end_inset


\end_layout

\begin_layout Closing
With Kind Regards
\end_layout

\end_body
\end_document
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users

Reply via email to