\ProvidesFile{reudnetzbrief.lco}[letter class option]


\RequirePackage[utf8]{inputenc}
\RequirePackage{graphicx}
\RequirePackage{hyperref}

%Lokalisierung
\RequirePackage{ngerman}
\RequirePackage{fix-cm}

% (TrueType-)Schriften
\usepackage{iftex}
\ifXeTeX
	\usepackage{xltxtra}
	\setmainfont{Crimson-Roman}
\else
	\usepackage{crimson}
	\RequirePackage[T1]{fontenc}
\fi

%Farben
\usepackage{color}
\definecolor{blatt}{rgb}{0.55, 0.64, 0.23}

%Formatierung
\addtokomafont{fromname}{\color{blatt}}
\addtokomafont{fromaddress}{\scriptsize\color{blatt}}
\addtokomafont{fromrule}{\color{blatt}}
\pagestyle{headings}

\KOMAoptions{
	fontsize=12pt,
	paper=a4,
	pagenumber=botcenter,
	fromalign=left,
%Trennlinie unter dem Logo: afteraddress, false, aftername:
	fromrule=false,
	fromlogo,fromurl,
	fromemail,
%	fromfax, fromphone,
	enlargefirstpage
}

\setkomavar{fromname}{Reudnetz w.V.}
\setkomavar{fromaddress}{Wurzner Straße 2 \\ 04315 Leipzig}

\setkomavar{fromlogo}{\includegraphics[height=2.5cm]{logo.png}}

\setkomavar{fromemail}[]{mail@reudnetz.org}
\setkomavar{fromurl}[]{http://reudnetz.org/}

\setkomavar{place}{Leipzig}

%Spezialheader
\setkomavar{firsthead}{%
	\parbox[b]{0.5\textwidth}{
		\flushright{
			\usekomafont{fromname}\strut\ignorespaces
        	\usekomavar{fromname}%
        	{
            \ifnum\@rulefrom=1\\[-.5\baselineskip]%
              \usekomafont{fromrule}{%
                \setlength{\@tempdima}{\useplength{fromrulewidth}}%
                \ifdim\@tempdima=\z@
                  \setlength{\@tempdima}{\textwidth}%
                  \if@logo
                    \settowidth{\@tempdimb}{\usekomavar{fromlogo}}%
                    \addtolength{\@tempdima}{-\@tempdimb}%
                  \fi
                \fi
                \expandafter\rule\expandafter{\the\@tempdima}{%
                  \useplength{fromrulethickness}}}%
            \fi
        	}
          \\
        }%
        {\usekomafont{fromaddress}\strut\ignorespaces
          \usekomavar{fromaddress}%
          \if@phone\\\usekomavar*{fromphone}\usekomavar{fromphone}\fi%
          \if@mobilephone
            \\\usekomavar*{frommobilephone}\usekomavar{frommobilephone}%
          \fi%
          \if@fax\\\usekomavar*{fromfax}\usekomavar{fromfax}\fi%
          \if@email\\\usekomavar*{fromemail}\usekomavar{fromemail}\fi%
          \if@www\\\usekomavar*{fromurl}\usekomavar{fromurl}\fi%
          \ifnum\@rulefrom=2\\[-.5\baselineskip]%
            \usekomafont{fromrule}{%
              \setlength{\@tempdima}{\useplength{fromrulewidth}}%
              \ifdim\@tempdima=\z@
                \setlength{\@tempdima}{\textwidth}%
              \fi
              \expandafter\rule\expandafter{\the\@tempdima}{%
                \useplength{fromrulethickness}}}%
          \fi
          \\
        }%
	}%
	\hspace{1mm}
	\if@logo
	\rlap{\usekomavar{fromlogo}}%
	\fi
}