I like to write a letter in latex, it all works fine so far, i just find that the sender information on the top rightis kind of "ugly". This results from the long email-address pushing the entire block to the left:
Firstname Lastname
Street 001
9999 Cityname
Telefon: +43 9999 999 2
Email: first.lastname@alumni.university.edu
Is it possible to force a line break after the @-symbol aligning the adress with the rest of the information so it looks like below?
Firstname Lastname
Street 001
9999 Cityname
Telefon: +43 9999 999 2
Email: first.lastname@
alumni.university.edu
Here is the MWE:
\documentclass[version=last]{scrlttr2}
\usepackage[ngerman]{babel}
\usepackage{graphics}
\LoadLetterOption{DIN}
\usepackage{hyperref}
\KOMAoptions{
paper=a4,
pagenumber=botcenter,
fromemail,
backaddress,
foldmarks,
enlargefirstpage,
foldmarks=true,
fromrule=afteraddress,
fromphone,fromemail,
}
\hypersetup{
colorlinks=false,
hidelinks=true,
}
\makeatletter\setkomavar{firsthead}{%
\hspace*{\fill}\footnotesize
\begin{tabular}{l@{}}
\usekomavar{fromname}\\
\usekomavar{fromaddress}
\if@phone\\
\usekomavar*{fromphone}\usekomavar{fromphone}\fi
\if@fax\\
\usekomavar*{fromfax}\usekomavar{fromfax}\fi
\if@email\\
\usekomavar*{fromemail}\usekomavar{fromemail}\fi
\if@www\\
\usekomavar*{fromurl}\usekomavar{fromurl}\fi
\end{tabular}%
}\makeatother
\setkomavar{fromname}{Firstname Lastname}
\setkomavar{fromaddress}{Street 001\\9999 Cityname}
\setkomavar{fromphone}{+43\,9999\,999\,2}
\setkomavar{fromemail}{\href{mailto:first.lastname@alumni.university.edu}{first.lastname@alumni.university.edu}}
\begin{document}
\begin{letter}{%
Company\\
Mainstreet 001\\
1111 Cityname
}
\setkomavar{subject}{Subject}
\opening{Dear Mr. X,}
This is some text.
\closing{Cheers}
\end{letter}
\end{document}
Thank you in advance :)