John, all

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.

On MacTeX the file to look for is


on linux something like

        find /usr -name texmf.cnf

might help.

The variable to look for is

        TEXMFLOCAL = /usr/local/texlive/texmf-local

which in my case yields something like

        32      /usr/local/texlive/texmf-local/tex/latex/misc
        1496    /usr/local/texlive/texmf-local/tex/latex/koma-script
        240     /usr/local/texlive/texmf-local/tex/latex/rangen

and I have my own adapted *.lco in there, as homebrew (on the mac) makes
me own the tree below /usr/local and so I don't need sudo.

I think you can set up a similar tree below $HOME somehow, but I don't
use LyX/LaTeX on linux, so I don't know.

The letter is currently set up for DIN A4. In the LyX file as

        Document -? Settings... -> Page Layout (Default)

where for US formats it would need to be adapted, and in the LCO at the
top where you should comment out the DIN and un-comment the

If you want to know where they are

The letter and stamp require a number packages, so at the very least do:

        tlmgr install pgf xpatch lipsum hyperref xurl lastpage koma-script \

packages that are installed already will cause a warning message.

I hope it's a complete list.

I like Google's NOTO fonts but if you don't, just change in the document
preamble (this is required for the stamp to work, but I have never
bothered to try to understand why it doesn't work properly when put
directly into the LyX Font page).

Iso you may need to

        tlmgr install noto

sudo may be required (of course).

I have put two paragraphs worth of lorem ipsum text in there, and if you
really want to play with it, wait for at least a minute, make small
change to the LyX file and regenerate, while the PDF viewer has it open.

You should see that the stamp will slightly rotate and move :-)-O

I also enclose a PDF for comparison, which was generated from the
command line using

        lyx -f -e pdf5 bookoff.lyx

It needs LUATEX (LuaLaTeX), pdflatex does NOT work (it uses LUA
internally to calculate some randomness).

I find really cool, that you can have seriously involved and complicated
LaTeX Voodoo without a single line of it bothering the (casual) user
:-)-O as it is all hidden in the preamble or in the LCO.

I am quite interested in positive comments and improvements to make
it faster, better or both.

I would be EXTREMELY interested in someone doing this over as a LyX
module, i.e. so that you can get additional fields in the LyX window and
that the stamp dimensions are then calculated dynamically, and this
sordid mess could perhaps even join the LyX project properly :-)-O

I have not the faintest clue how to do that, myself :-)-O and as it
works for me, no interested in hopping on that particular learning
curve :-)-O

greetings, el

On 2021-09-23 18:43 , Dr Eberhard W Lisse wrote:

I'll share a complete example

On 23. Sep 2021, 17:43 +0200, John White <>, wrote:
On Thursday, September 23, 2021 4:25:57 AM PDT Dr Eberhard Lisse wrote:
Thanks Doc,

I have marked this email "important" and "action item."  When I get
some time I will try to figure it out.  It prints your letterhead
with some extraneous code.  Do not try to tell me how to fix it.  I
need to figure that out for myself.


#LyX 2.3 created this file. For more info see
\lyxformat 544
\save_transient_properties true
\origin unavailable
\textclass scrlttr2

%% LUA: Winkel des Gesamtstempels -- willk\"{u}rlich 
%% zwischen -5 und +5 Grad -- bei jedem Dokument anders


%% 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}

   \setsansfont{Linux Biolinum O}
   \setsansfont{IBM Plex Sans}

%% TIKZ: Laden notwendiger Styles

%% Erstellen eines Befehls f\"{u}r den Stempel in einer Gr\"{o}{\ss}e von 6 cm 
x 3 cm skaliert
%% 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 
%% 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};

%% SCRLTTR2 & XPATCH: Erstellen einer neuen Variablen f\"{u}r den Brief zur 
Positionierung des Stempels rechts von \closing

%% SCRLTTR2: Einf\"{u}gen des Stempels mit der jeweiligen willk\"{u}rlichen 
Gesamtdrehung \rot
\options drlisse
\use_default_options true
\maintain_unincluded_children false
Format 66
PackageOptions fontspec no-math
Requires fontspec
\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
\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


\begin_layout Address
\begin_inset space ~


\begin_layout Title
Medical Certificate

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

\begin_layout Myref
My Ref

\begin_layout Yourref
Your Ref

\begin_layout Yourmail

\begin_layout Signature
Dr Eberhard W Lisse

\begin_layout Opening
\begin_inset space ~


\begin_layout Standard
\begin_inset ERT
status collapsed

\begin_layout Plain Layout




\begin_layout Closing
With Kind Regards


Attachment: bookoff.pdf
Description: Adobe PDF document

% Load EITHER the DIN Letter from Koma Script or the US one by commenting
% out the other
% Options
    addrfield=true%            print an address field?
    ,backaddress=true%         print the back address?
    ,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

% Load some packages
% If I want to test the letter output
% to get to the URLs with proper breaking, needs some work
% to survive turning this on in LyX
   pdfborder={0 0 0},
% I like the ISO Date
        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
        \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
        or load package `#2' using \string\usepackage[#1]{#2}

% page # of ## pages
% for the fancy header and footer formatting


            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{}{}\\
            GPG Fingerprint: 7399 BE0B AEFB 4AE5 EDB9 4A54 9705 1DA3 7945 3FAB

%\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}}
\setkomavar{fromaddress}{Obstetrician \& Gynaecologist}

% default signature, left justified
\setkomavar{signature}{Dr Eberhard W Lisse}

% 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\\
\setkomavar{backaddressseparator}{ $\cdot$ }

% redefine the reference line
    \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


lyx-users mailing list

Reply via email to