Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I would like in my document to have fromphone and frommobilephone, but \KOMAoptions doesnt support frommobilephone...

as i searched in the Internet for solution, i found a lco file from Dr. Michael Ebner, which i find very nice still, but neither he solved this.

Could someone help tell me how could i change the lco file that it would also frommobilephone support?

Regards

Vorlagen/ebner.lco 
% $Id$
% Author: Dr. Michael Ebner, Michael@DrEbner.net
% 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~]{mail@post.de}
\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

My latex document:

\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}
share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

I am pretty sure someone will come up with something much better... Basically in the lco file you show above frommobilephone is defined but not used anywhere. So I went along and defined a \newkomavar{mobile} and used it in a redefinition of firsthead (\setkomavar{firsthead}{...}). I am fairly sure there is a better way of doing it that does not involve hard-coding of \Telefon and \Mobilefone in this definition but I was not able to figure that out straight away.

\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}{a@b.de}

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

enter image description here

share|improve this answer
    
thank you for your solution, unfortunately it doesn't work on my computer (Linux). It get: Class scrlttr2 Error: KOMA-Script variable not defined. \setkomavar{firstfoot}{} (line 32) and Class scrlttr2 Error: KOMA-Script variable not defined. (ine 47) –  Eagle Jul 4 '11 at 15:01
    
I am using Linux as well, this is not the problem I suppose. I use TeXlive 2010 as my distribution. If you use e.g. Ubuntu and installed TeXlive with the package manager you only get the 2009 version. This might result in an outdated version of KOMA-skript. Make sure you have the latest version installed –  Martin H Jul 4 '11 at 15:15
    
i have dev-texlive/texlive-latexrecommended-2010 installed. From what i understood, it suppose to contain Koma-Skript (I have Gentoo distribution), so this is also not the problem. You wrote in the first line: \documentclass[fromphone,]{scrlttr2} why do you need fromphone...? –  Eagle Jul 4 '11 at 16:39
    
well actually I am not entirely sure. I thought with using fromphone the phone symbol will appear in the firsthead. This however did not happen after I defined my own firsthead. In fact, every formatting command was omitted and this is the flaw in my solution really. So it should work without this option. As you can seen from my screenshot it worked for my system. I am at a different computer now but I can add a filelist tomorrow and you can compare versions. –  Martin H Jul 4 '11 at 20:41
    
ok, it is now working.... thanks –  Eagle Jul 5 '11 at 9:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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