3

I have written a letter in LaTeX, see code below (there are some german comments which do not matter).

Now I want to include my scanned signature as a jpg above the closing name (that means between "Mit freundlichen Grüssen" and my name).

How can this be done?

%---------------------------------------------------------------------------
\documentclass%%
%---------------------------------------------------------------------------
  [fontsize=11pt,%%          Schriftgroesse
%---------------------------------------------------------------------------
% Satzspiegel
   paper=a4,%%               Papierformat
   %enlargefirstpage=on,%%    Erste Seite anders
   %pagenumber=headright,%%   Seitenzahl oben mittig  
%---------------------------------------------------------------------------
% Layout
   headsepline=off,%%         Linie unter der Seitenzahl
   parskip=half,%%           Abstand zwischen Absaetzen
%---------------------------------------------------------------------------
% Briefkopf und Anschrift
   fromalign=right,%%        Plazierung des Briefkopfs
   fromphone=on,%%           Telefonnummer im Absender
   fromrule=aftername,%%     Linie im Absender (aftername, afteraddress)
   fromfax=off,%%            Faxnummer
   fromemail=on,%%           Emailadresse
   fromurl=off,%%            Homepage
   fromlogo=on,%%            Firmenlogo
   addrfield=on,%%           Adressfeld fuer Fensterkuverts
   backaddress=on,%%         ...und Absender im Fenster
   subject=beforeopening,%%  Plazierung der Betreffzeile
   locfield=narrow,%%        zusaetzliches Feld fuer Absender
   foldmarks=on,%%           Faltmarken setzen
   numericaldate=off,%%      Datum numerisch ausgeben
   refline=narrow,%%         Geschaeftszeile im Satzspiegel
   firstfoot=on,%%           Footerbereich
%---------------------------------------------------------------------------
% Formatierung
   draft=off%%                Entwurfsmodus
]{scrlttr2}
%---------------------------------------------------------------------------
\usepackage[T1]{fontenc}
\usepackage[english, ngerman]{babel}  
\usepackage{url}
\usepackage{lipsum}
\usepackage[utf8]{inputenc}
%---------------------------------------------------------------------------
% Fonts
\setkomafont{fromname}{\scshape \LARGE}
%\setkomafont{fromaddress}{\sffamily}%% statt \small
%\setkomafont{pagenumber}{\sffamily}
\setkomafont{subject}{\mdseries}
\setkomafont{backaddress}{\mdseries}
\usepackage{newcent}
%---------------------------------------------------------------------------
\begin{document}
%---------------------------------------------------------------------------
% Briefstil und Position des Briefkopfs
\LoadLetterOption{DIN} %% oder: DINmtext, SN, SNleft, KOMAold.
\makeatletter
\@setplength{firstheadvpos}{17mm}
\@setplength{firstfootvpos}{275mm} % Abstand des Footers von oben
\@setplength{firstheadwidth}{\paperwidth}
\@setplength{locwidth}{70mm}   % Breite des Locationfeldes
\@setplength{locvpos}{55mm}    % Abstand des Locationfeldes von oben
\ifdim \useplength{toaddrhpos}>\z@
  \@addtoplength[-2]{firstheadwidth}{\useplength{toaddrhpos}}
\else
  \@addtoplength[2]{firstheadwidth}{\useplength{toaddrhpos}}
\fi
\@setplength{foldmarkhpos}{6.5mm}
\makeatother
%---------------------------------------------------------------------------
% Absender
\setkomavar{fromname}{Max Mustermann}
\setkomavar{fromaddress}{Hauptstraße 1\\12345 Musterhausen}
\setkomavar{fromphone}{+49\,(0)\,123\,123\,123\,1}%
%\renewcommand{\phonename}{Telefon}
\setkomavar{fromemail}{maxmustermann@mst.de}
\setkomavar{backaddressseparator}{ - }
\setkomavar{signature}{(Max Mustermann)}
\setkomavar{location}{\raggedleft

Kundennummer: 12345678 \\}

%---------------------------------------------------------------------------
\setkomavar{date}{\today}
\setkomavar{place}{Musterhausen}
%---------------------------------------------------------------------------
% Anlage neu definieren
\renewcommand{\enclname}{Anlagen}
\setkomavar{enclseparator}{: }
%---------------------------------------------------------------------------
% Seitenstil
%pagenumber=footmiddle
\pagestyle{plain}%% keine Header in der Kopfzeile bzw. plain
\pagenumbering{arabic}
%---------------------------------------------------------------------------
%---------------------------------------------------------------------------
\firstfoot{\footnotesize%
\rule[3pt]{\textwidth}{.4pt} \\
\begin{tabular}[t]{l@{}}% 
\usekomavar{fromname}\\
\usekomavar{fromaddress}\\
\end{tabular}%
\hfill
\begin{tabular}[t]{l@{}}%
  \usekomavar{fromphone}\\
   \usekomavar{fromemail}\\
\end{tabular}%
\ifkomavarempty{frombank}{}{%
\hfill
\begin{tabular}[t]{l@{}}%
\usekomavar{frombank}
\end{tabular}%
}%
}% 
%---------------------------------------------------------------------------
\setkomavar{frombank}{Kto. 123\,123\,123\\
BLZ 123\,123\,12\\
Musterbank}
%---------------------------------------------------------------------------
\begin{letter}{Maxi Musterfrau\\Nebenstraße 1\\12345 Musterstadt\\}
%---------------------------------------------------------------------------
\setkomavar{subject}{\bf{Betreff}}
%---------------------------------------------------------------------------
%\setkomavar{yourref}{}
%\setkomavar{yourmail}{}
%\setkomavar{myref}{}
%\setkomavar{customer}{}
%\setkomavar{invoice}{}
%---------------------------------------------------------------------------
\opening{Sehr geehrte Damen und Herren,}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean aliquet varius blandit. Suspendisse ligula tortor, feugiat in dapibus a, dictum vel risus. Nulla at justo vitae velit sodales dignissim. Curabitur volutpat porttitor pulvinar. Quisque vulputate massa vitae dui sagittis at ultrices lorem sagittis. Nullam lobortis tincidunt libero, et tincidunt urna consectetur ac. Proin laoreet commodo auctor. Nullam nec eros enim. Maecenas commodo sem consectetur neque ullamcorper vel iaculis massa hendrerit. Integer et sem et justo pharetra mattis ut id ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec elementum pulvinar diam in accumsan. Nam laoreet tincidunt tincidunt. Nam hendrerit, lorem vel gravida fringilla, tellus augue vulputate neque, eu laoreet magna metus eu ante. Nullam auctor arcu augue, sed fringilla velit. Nunc auctor mattis nisl, sed iaculis dolor auctor faucibus. Cras libero ligula, dapibus vel egestas non, porta et ante. Nulla dolor sapien, mollis sed sodales a, posuere vitae ante. 

\closing{Mit freundlichen Grüßen,}
%---------------------------------------------------------------------------
%\ps{PS:}
%\encl{Lebenslauf\\ Zeugnisse}
%\cc{}
%---------------------------------------------------------------------------
\end{letter}
%---------------------------------------------------------------------------
\end{document}
%---------------------------------------------------------------------------
  • 3
    \includegraphics{} ? – cfr Nov 27 '15 at 0:24
  • I've deleted the latex3 tag since this is not connected to that topic – user31729 Nov 27 '15 at 1:02
  • Then everybody with the PDF will be able to sign letters with your signature. – egreg Nov 27 '15 at 10:09
  • Scanners do exist! ;-) Not signing letters at all? – Josef Nov 27 '15 at 12:28
5

You could use something like

\newsavebox\signaturebox
\sbox\signaturebox{%
  \begin{tabular}{@{}c@{}}
    \smash{\includegraphics[height=2.25em]{example-image.pdf}}\\[5pt]
    (\usekomavar{fromname})
  \end{tabular}}
\setkomavar{signature}{\usebox{\signaturebox}}%

and maybe

\renewcommand*\raggedsignature{\raggedright}

enter image description here

Code:

\documentclass%%
  [fontsize=11pt,
   parskip=half,%%           Abstand zwischen Absaetzen
   fromalign=right,%%        Plazierung des Briefkopfs
   fromphone=on,%%           Telefonnummer im Absender
   fromrule=aftername,%%     Linie im Absender (aftername, afteraddress)
   fromemail=on,%%           Emailadresse
]{scrlttr2}
\usepackage[T1]{fontenc}
\usepackage[english, ngerman]{babel}
\usepackage{url}
\usepackage{lipsum}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}

\usepackage{newcent}
\setkomafont{fromname}{\scshape \LARGE}
\setkomafont{backaddress}{\mdseries}

\makeatletter
\@setplength{firstheadvpos}{17mm}
\@setplength{firstfootvpos}{275mm} % Abstand des Footers von oben
\@setplength{locwidth}{70mm} % Breite des Locationfeldes
\@setplength{locvpos}{55mm} % Abstand des Locationfeldes von oben
\@setplength{foldmarkhpos}{6.5mm}
\makeatother

\begin{document}
\setkomavar{fromname}{Max Mustermann}
\setkomavar{fromaddress}{Hauptstraße 1\\12345 Musterhausen}
\setkomavar{fromphone}{+49\,(0)\,123\,123\,123\,1}%
\setkomavar{fromemail}{maxmustermann@mst.de}
\setkomavar{backaddressseparator}{ - }
\setkomavar{location}{\raggedleft Kundennummer: 12345678}
\setkomavar{place}{Musterhausen}
\setkomavar{firstfoot}{\footnotesize%
  \rule[3pt]{\textwidth}{.4pt}\\
  \begin{tabular}[t]{l@{}}% 
    \usekomavar{fromname}\\
    \usekomavar{fromaddress}\\
  \end{tabular}%
  \hfill
  \begin{tabular}[t]{l@{}}%
    \usekomavar{fromphone}\\
    \usekomavar{fromemail}\\
  \end{tabular}%
  \ifkomavarempty{frombank}{}{%
    \hfill
    \begin{tabular}[t]{l@{}}%
      \usekomavar{frombank}
    \end{tabular}%
    }%
}% 
\setkomavar{frombank}{Kto. 123\,123\,123\\
  BLZ 123\,123\,12\\
  Musterbank}

\newsavebox\signaturebox
\sbox\signaturebox{%
  \begin{tabular}{@{}c@{}}
    \smash{\includegraphics[height=2.25em]{example-image.pdf}}\\[5pt]
    (\usekomavar{fromname})
  \end{tabular}}
\setkomavar{signature}{\usebox{\signaturebox}}%
\renewcommand*\raggedsignature{\raggedright}

\renewcaptionname{ngerman}{\enclname}{Anlagen}

\begin{letter}{Maxi Musterfrau\\Nebenstraße 1\\12345 Musterstadt}
\setkomavar{subject}{Betreff}
\opening{Sehr geehrte Damen und Herren,}
\lipsum[1]
\closing{Mit freundlichen Grüßen,}
\end{letter}
\end{document}

Note that the Letter-Class-Option file DIN is loaded by the class automatically. You have to use \setkomavar{firstfoot}{...} instead the outdated\firstfoot{...}. And do not use \bf!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.