# wrap logo and sender's address with scrlttr2

I have a problem with scrlttr2 and Lualatex when I use a logo and the english manual of Koma-script don't help.

I want to have it next to the sender's address, partly in the margin, and with the address wrapped on the right on it. I use wrapfig for it, but I'm unable to get the address and the logo vertically entered: the logo is always a little higher and the result seems messy.

By making this MWE, another problem occurred with it: the last line of the address is hyphenating for an unknown reason. You can see the result there [on PDF archive][1].

\documentclass{scrlttr2}

\usepackage{fontspec}
\usepackage{polyglossia}
\setdefaultlanguage{french}
\usepackage{wrapfig}
\usepackage{kantlipsum}
\usepackage[final]{microtype}

\setkomavar{signature}{Bibi}
\setkomavar{fromname}{Bibi}
Moscow\newline
Mother Russia}

\setkomavar{fromlogo}{\begin{wrapfigure}
%[5] %
{i}
[6mm]
{0.115\textheight}
\includegraphics[width=0.1\textheight]{logo}
% for information, I took the logo there :
\end{wrapfigure}}

\begin{minipage}[t]{10cm}
\vspace{0pt}
%\setlength\intextsep{0pt} %don't seems to solve the issue
~\\ %I don't understand why it's there
\usekomavar{fromlogo}\\
\usekomavar{fromname}\\
[1cm]
\end{minipage}
}

\title{}

\begin{document}

\setkomavar{subject}{pratical reason disputatio}

\begin{letter}{%
René Descartes\newline
57200 La Flèche\newline
France}

\opening{Sir,}

\kant[1]

\closing{Kind regards,}

\encl{Dummy text.}
\end{letter}
\end{document}


The wrafig solution still doesn't work, but a simple minipage environnement does. The drawbacks are:

1. I can't have an automated solution adjust the size of my image on that of my address' paragraph, like wrapfig does.

2. When I add a third minipage on the left, I still can't top align it ({minipage}[t]) with the two others, only centering works ({minipage}[c]). >>> see edit below.

Here's the new code:

\documentclass{scrlttr2}

\usepackage{fontspec}
\usepackage{polyglossia}
\setdefaultlanguage{french}
\usepackage{wrapfig}
\usepackage{kantlipsum}
\usepackage[final]{microtype}

\setkomavar{signature}{Bibi}
\setkomavar{fromname}{Bibi}
Moscow\newline
Mother Russia}
\setkomavar{fromphone}{06~98~76~54~32} %pro
\setkomavar{fromemail}{gondrix@gmx.fr}

\setkomavar{fromlogo}{
\includegraphics[width=0.1\textheight]{logo1}
}

\begin{minipage}[c]{0.15\textwidth}
% \includegraphics[width=0.1\textheight]{logo}
\usekomavar{fromlogo}
\end{minipage}
\begin{minipage}[c]{0.35\textwidth}
\usekomavar{fromname}\newline
\end{minipage}
% and here is the second, right-aligned part:
\hspace{0.15\textwidth}
\begin{minipage}[c]{0.35\textwidth}
\usekomavar*{fromphone}\usekomavar{fromphone}\\
\usekomavar*{fromemail}\usekomavar{fromemail}\\%
\end{minipage}
}

\title{}

\begin{document}

\setkomavar{subject}{pratical reason disputatio}

\begin{letter}{%
René Descartes\newline
57200 La Flèche\newline
France}

\opening{Sir,}

\kant[1]

\closing{Kind regards,}

\encl{Dummy text.}
\end{letter}
\end{document}


Edit: The package adjustbox provides a solution for the first drawback. With the align options of the minipage environment, the baseline is always used as a reference point, and for an image, the baseline is at bottom. Just using the following code and tuning the width of minipages, the alignment is made between the three of it.

\adjustbox{valign=t}
{
\begin{minipage}{0.33\linewidth}
% first minipage content here
\end{minipage}
}