将 frommobilephone 添加到 scrlttr2

将 frommobilephone 添加到 scrlttr2

我希望我的文档中有fromphonefrommobilephone,但是 \KOMAoptions 不支持frommobilephone……

当我在互联网上搜索解决方案时,我找到了 Michael Ebner 博士提供的 lco 文件,我仍然觉得它非常好,但他也没有解决这个问题。

有人可以帮我告诉我如何更改 lco 文件以使其也能支持移动电话吗?

问候

Vorlagen/ebner.lco 
% $Id$
% Author: Dr. Michael Ebner, [email protected]
% Date: May 2005
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  Letter Class Option of Michael Ebner
%

% briefkopf fuer Dr auch machen (geht das vererbend)??

\ProvidesFile{ebner.lco}[%
       2002/07/24 LaTeX2e unsupported letter-class-option]

\RequirePackage{marvosym}       % Fuer Telefon-, Handy- und Briefsymbol
\RequirePackage{relsize}% fuer groesseren fromname

\LoadLetterOption{DINmtext}
\@setplength{toaddrvpos}{39mm}
\@addtoplength{toaddrhpos}{10mm}% BCOR correction

\KOMAoptions{fromalign=right,fromrule=aftername,fromphone,%
         fromemail,enlargefirstpage,foldmarks}
%,headsepline,footsepline

\setkomavar{emailseparator}{~}
\setkomavar{phoneseparator}{~}

\addtokomafont{fromname}{\bfseries\larger}
\setkomavar{fromname}{Michael~Ebner}
\setkomavar{signature}{Michael~Ebner}
\setkomavar{fromaddress}{Strasse~1\\37000~G\"ottingen}
\setkomavar{backaddress}{Michael~Ebner,~Strasse~1,~37000~G\"ottingen}
\setkomavar{place}{G\"ottingen}

\setkomavar{fromphone}[\Telefon~]{(05\,51)~1\,23\,45\,67}
\newkomavar{frommobilephone}
\setkomavar{frommobilephone}{(01\,79)~1\,23\,45\,67}

\setkomavar{fromemail}[\Email~]{[email protected]}
\setkomavar{fromurl}{www.MichaelEbner.net}

\firstfoot{\parbox[b]{\textwidth}{%
  \centering\usekomafont{footnote}
  \@ifundefined{footrulewidth}{%
  \let\footrulewidth\textwidth}{}
  \null\rule{\footrulewidth}{.4pt}\\\relax
  \def\\{\ \textperiodcentered\ \ignorespaces}
  \usekomavar*{frombank}: \usekomavar{frombank}
}}

\endinput

我的乳胶文档:

\documentclass[ ebner,%
                paper=a4,%
                fontsize=10pt,%
                ngerman,%
                pdftex,%
                BCOR=10mm%
              ]{scrlttr2}% 

\KOMAoptions{ fromalign=right,%
              paper=a4,%
              fromrule=aftername,%
              foldmarks=false,%
              parskip=full,%
              addrfield=true,%
              backaddress=false,%
              numericaldate=false,%
              enlargefirstpage,%
              foldmarks=false,%
          fromphone=true,%
              fromemail=true}

  \usepackage[latin1]{inputenc}
  \usepackage[ngerman]{babel}
  \usepackage[T1]{fontenc}      % T1-encoded fonts: auch Wörter mit Umlauten  trennen
  \usepackage{url}
  \usepackage{ae} % Schöne Schriften für PDF-Dateien
  \usepackage{microtype} % Mikrotypographische Anpassungen für pdflatex
  \usepackage{fixltx2e} % korrigiert LaTeX-Fehler

  \firstfoot{} % no bank information

  \setkomavar{date}{\today} 
  \setkomavar{subject}{Betref}
  \setkomavar*{enclseparator}{Anlagen}
  \usepackage[babel,german=guillemets]{csquotes}
  \usepackage{a4wide}

  \begin{document}
  \pagestyle{empty}
  \begin{letter}%
   {Musterfirma \\ Musterbereich \\ Herr Hans Mustermann \\ Musterstrasse \\ 55555 Musterhausen}

  \opening{Sehr geehrte Damen und Herren,}


  \closing{Mit freundlichen Grüßen}

  \enlargethispage{6\baselineskip}\medskip
  \noindent Anlagen

 \end{letter}
 \end{document}

答案1

我确信有人会想出更好的办法……基本上,在您上面显示的 lco 文件中,frommobilephone 已定义但未在任何地方使用。因此,我继续定义 a\newkomavar{mobile}并将其用于 firsthead ( \setkomavar{firsthead}{...}) 的重新定义。我确信有一种更好的方法,不涉及此定义中的\Telefon和的硬编码\Mobilefone,但我无法立即弄清楚。

\documentclass[fromphone,]{scrlttr2}% 

\usepackage[utf8]{inputenc} 
\usepackage[ngerman]{babel}
\usepackage[babel,german=guillemets]{csquotes}
\usepackage[T1]{fontenc}  
\usepackage{marvosym}       % Fuer Telefon-, Handy- und Briefsymbol

\newkomavar[\Mobilefone]{mobile}
\setkomavar{mobile}{(01\,79)~1\,23\,45\,6}

\setkomavar{fromname}{Michael~Ebner}
\setkomafont{fromname}{\bfseries\large}%
\setkomavar{signature}{Michael~Ebner}

\setkomavar{fromaddress}{Strasse~1\\37000~G\"ottingen}
\setkomavar{backaddress}{Michael~Ebner,~Strasse~1,~37000~G\"ottingen}
\setkomavar{place}{G\"ottingen}

\setkomavar{fromphone}{(05\,51)~1\,23\,45\,67}
\setkomavar{mobile}{(01\,79)~1\,23\,45\,67}

\setkomavar{fromemail}{[email protected]}

  \setkomavar{date}{\today} 

  \setkomavar{subject}{Betref}

  \setkomavar*{enclseparator}{Anlagenn}


  \setkomavar{firstfoot}{} % no bank information


\setkomavar{firsthead}{%
\noindent
  \parbox[b]{\useplength{firstheadwidth}}{%
\noindent%
\raggedleft%
{\bfseries\large\usekomavar{fromname}}\\%
\rule{\useplength{firstheadwidth}}{1pt}\\%
\usekomavar{fromaddress}\\%
\Telefon\enskip\usekomavar{fromphone}\\%
\Mobilefone\enskip\usekomavar{mobile}\\%
\Email\enskip\usekomavar{fromemail}
  }%
}%
  \begin{document}
  \begin{letter}%
  {Musterfirma \\ Musterbereich \\ Herr Hans Mustermann \\ Musterstrasse \\ 55555 Musterhausen}

  \opening{Sehr geehrte Damen und Herren,}

  \closing{Mit freundlichen Grüßen}

  \enlargethispage{6\baselineskip}\medskip
  \noindent Anlagen

 \end{letter}
 \end{document}

在此处输入图片描述

相关内容