我找到了以下编写账单的模板:
\documentclass
[fontsize=11pt,
paper=a4,
headsepline=off,
parskip=half,
fromalign=right,
fromphone=on,
fromrule=aftername,
fromfax=off,
fromemail=on,
fromurl=off,
fromlogo=on,
addrfield=on,
backaddress=on,
subject=beforeopening,
locfield=narrow,
foldmarks=on,
numericaldate=off,
refline=narrow,
firstfoot=on,
% Formatierung
draft=off
]{scrlttr2}
%---------------------------------------------------------------------------
\usepackage[english, ngerman]{babel}
\usepackage{url}
\usepackage{lmodern}
\usepackage[utf8]{inputenc}
\usepackage{tabularx}
\usepackage{colortbl}
% symbols: (cell)phone, email
\RequirePackage{marvosym} % for gray color in header
%\RequirePackage{color} % for gray color in header
\usepackage[T1]{fontenc}
\renewcommand*\familydefault{\sfdefault} % Latin Modern Sans
\setkomafont{fromname}{\sffamily\color{mygray}\LARGE}
%\setkomafont{pagenumber}{\sffamily}
\setkomafont{subject}{\mdseries}
\setkomafont{backaddress}{\mdseries}
\setkomafont{fromaddress}{\small\sffamily\mdseries\color{mygray}}
%---------------------------------------------------------------------------
\begin{document}
\LoadLetterOption{DIN}
\makeatletter
\@setplength{sigbeforevskip}{17mm}
\@setplength{firstheadvpos}{17mm}
\@setplength{firstfootvpos}{275mm}
\@setplength{firstheadwidth}{\paperwidth}
\@setplength{locwidth}{70mm}
\@setplength{locvpos}{65mm}
\ifdim \useplength{toaddrhpos}>\z@
\@addtoplength[-2]{firstheadwidth}{\useplength{toaddrhpos}}
\else
\@addtoplength[2]{firstheadwidth}{\useplength{toaddrhpos}}
\fi
\@setplength{foldmarkhpos}{6.5mm}
\makeatother
%---------------------------------------------------------------------------
% Farben werden hier definiert
% define gray for header
\definecolor{mygray}{gray}{.55}
% define blue for address
\definecolor{myblue}{rgb}{0.25,0.45,0.75}
%---------------------------------------------------------------------------
% Absender Daten
\setkomavar{fromname}{MAX MUSTERMANN}
\setkomavar{fromaddress}{Musterstad \\ 12345}
\setkomavar{fromphone}[\Mobilefone~]{+49\,(0)\,123\,456\,789\,0}
%\setkomavar{fromfax}[\FAX~]{+49\,(0)\,123\,456\,789\,0}
\setkomavar{fromemail}[\Letter~]{[email protected]}
\setkomavar{fromurl}[]{https://max-mustermann.com}
%\setkomafont{fromaddress}{\small\rmfamily\mdseries\slshape\color{myblue}}
\setkomavar{backaddressseparator}{ - }
%\setkomavar{backaddress}{Max Mustermann, alternative Straße, alternative Stadt}
\setkomavar{signature}{Max MUSTERMANN}
% signature same indention level as rest
\renewcommand*{\raggedsignature}{\raggedright}
\setkomavar{location}{\raggedleft
}
% Anlage neu definieren
\renewcommand{\enclname}{Anlagen}
\setkomavar{enclseparator}{: }
%pagenumber=footmiddle
\pagestyle{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[\Mobilefone~]{fromphone}\\
\usekomavar[\Letter~]{fromemail}\\
\usekomavar{fromurl}\\
\end{tabular}%
\ifkomavarempty{frombank}{}{%
\hfill
\begin{tabular}[t]{l@{}}%
Bankverbindung: \\
\usekomavar{frombank}
\end{tabular}%
}%
}%
%---------------------------------------------------------------------------
% Bankverbindung
\setkomavar{frombank}{Kto. 123456789\\
BLZ 123\,123\,12\\
Musterbank}
%---------------------------------------------------------------------------
%\setkomavar{yourref}{}
%\setkomavar{yourmail}{}
%\setkomavar{myref}{}
%\setkomavar{customer}{}
\setkomavar{invoice}{012010}
%---------------------------------------------------------------------------
% Datum und Ort werden hier eingetragen
\setkomavar{date}{\today}
\setkomavar{place}{Musterstadt}
%---------------------------------------------------------------------------
%---------------------------------------------------------------------------
% Hier beginnt der Brief, mit der Anschrift des Empfängers
\begin{letter}
{
Maxi Musterfrau\\
Nebenstraße 1\\
12345 Musterhausen\\
}
\setkomavar{subject}{\textbf{RECHNUNG}}
%---------------------------------------------------------------------------
\opening{Sehr geehrte Frau Musterfrau,}
Bitte überweisen Sie den folgenden Rechnungsbeitrag innerhalb von 14 Tagen auf das unten angegebene Konto.
\vspace{5pt}
\begin{tabularx}{\textwidth}{ccXrr}
\hline
%\rowcolor[gray]{.95}
\tiny {Menge} & \tiny {Einheit} & \tiny {Beschreibung} & \tiny {Einzelpreis (netto)} & \tiny {Gesamtpreis (netto)} \\ \hline
10 & Std. & Musterbrief erstellt & \multicolumn{1}{r}{30,00 EUR} & \multicolumn{1}{r}{300,00 EUR} \\ \hline \hline
\multicolumn{ 4}{l}{\small{Summe ohne MwSt.}} & 300,00 EUR \\ \hline
\multicolumn{ 4}{l}{\small{MwSt. 19\% }} & 57,00 EUR \\ \hline \hline
\multicolumn{ 4}{l}{ \textbf{Gesamtsumme inkl. MwSt.} } & \textbf{357,00 EUR} \\ \hline
\end{tabularx}
\closing{Mit freundlichen Grüßen,}
%---------------------------------------------------------------------------
%\ps{PS:}
%\cc{}
%---------------------------------------------------------------------------
\end{letter}
%---------------------------------------------------------------------------
\end{document}
%---------------------------------
现在,我真的想在右上角添加一个徽标。我不想在那里放地址、姓名等。我只想要反向地址行。有办法实现吗?
答案1
您想要类似以下图片的东西吗?
对于标题中的徽标,您必须添加:
\usepackage{graphicx}
\setkomavar{firsthead}{\hfill\includegraphics[height=2cm]{example-image}}
梅威瑟:
\documentclass[
fontsize=11pt,
parskip=half
]{scrlttr2}
\usepackage[english,ngerman]{babel}
\usepackage{url}
\usepackage{lmodern}
%\usepackage[utf8]{inputenc}% needed for older TeX distributions
\usepackage{tabularx}
\usepackage[table]{xcolor}% replaced
\usepackage{marvosym}
\usepackage[T1]{fontenc}
\usepackage{graphicx}% needed for the inclusion of the logo
\renewcommand*\familydefault{\sfdefault}
\setplength{sigbeforevskip}{17mm}
\setplength{firstheadvpos}{17mm}
\setplength{firstfootvpos}{275mm}
\setplength{locwidth}{70mm}
\setplength{locvpos}{65mm}
\setplength{foldmarkhpos}{6.5mm}
\definecolor{mygray}{gray}{.55}% define gray for header
\definecolor{myblue}{rgb}{0.25,0.45,0.75}% define blue for address
% Absender Daten
\setkomavar{fromname}{MAX MUSTERMANN}
\setkomavar{fromaddress}{Musterstad \\ 12345}
\setkomavar{fromphone}[\Mobilefone~]{+49\,(0)\,123\,456\,789\,0}
\setkomavar{fromemail}[\Letter~]{[email protected]}
\setkomavar{fromurl}[]{https://max-mustermann.com}
\setkomavar{backaddressseparator}{ - }
\setkomavar{signature}{Max MUSTERMANN}
\setkomavar{frombank}{Kto. 123456789\\BLZ 123\,123\,12\\Musterbank}
\renewcommand*{\raggedsignature}{\raggedright}
\renewcaptionname{ngerman}{\enclname}{Anlagen}% renew enclosing name for ngerman
\setkomavar{firsthead}{\hfill\includegraphics[height=2cm]{example-image}}% logo in header
\setkomavar{firstfoot}{\footnotesize% deprecated command replaced
\rule[3pt]{\textwidth}{.4pt} \\
\begin{tabular}[t]{l@{}}%
\usekomavar{fromname}\\
\usekomavar{fromaddress}\\
\end{tabular}%
\hfill
\begin{tabular}[t]{l@{}}%
\usekomavar[\Mobilefone~]{fromphone}\\
\usekomavar[\Letter~]{fromemail}\\
\usekomavar{fromurl}\\
\end{tabular}%
\ifkomavarempty{frombank}{}{%
\hfill
\begin{tabular}[t]{l@{}}%
Bankverbindung: \\
\usekomavar{frombank}
\end{tabular}%
}%
}%
\begin{document}
\begin{letter}{Maxi Musterfrau\\Nebenstraße 1\\12345 Musterhausen}
\setkomavar{subject}{RECHNUNG}
\setkomavar{invoice}{012010}
\opening{Sehr geehrte Frau Musterfrau,}
Bitte überweisen Sie den folgenden Rechnungsbeitrag innerhalb von 14~Tagen auf das unten angegebene Konto.
\begingroup
\par
\medskip
\setlength{\parfillskip}{0pt plus 1fil}
\begin{tabularx}{\linewidth}{ccXrr}
\hline
\tiny Menge & \tiny Einheit & \tiny Beschreibung & \tiny Einzelpreis (netto) & \tiny Gesamtpreis (netto) \\ \hline
10 & Std. & Musterbrief erstellt & \multicolumn{1}{r}{30,00 EUR} & 300,00 EUR \\ \hline \hline
\multicolumn{4}{l}{\small Summe ohne MwSt.} & 300,00 EUR \\ \hline
\multicolumn{4}{l}{\small MwSt. 19\% } & 57,00 EUR \\ \hline \hline
\multicolumn{4}{l}{ \textbf{Gesamtsumme inkl. MwSt.} } & \textbf{357,00 EUR} \\ \hline
\end{tabularx}
\par
\endgroup
\closing{Mit freundlichen Grüßen,}
\end{letter}
\end{document}
我已删除所有未使用的选项和具有默认值的选项以及其他不需要的代码。最新的 KOMA-Script 版本提供\setplength
和\addtoplength
。自动scrlttr2
加载字母类别选项。和是字体开关,它们不接受参数。应替换为。DIN
\tiny
\small
\firstfoot{...}
\setkomavar{firstfoot}{...}