# automatic placement of a wrapfigure at the margin in a twopage desing

Using a twoside design in scrbook calls into question an automatic placement of a \wrapfigure at the margin opposite to the bookbinding.

\documentclass[twoside=true]{scrbook}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{lipsum}

\begin{document}

\begin{wrapfigure}{r}{0.5\linewidth}
\includegraphics[width=0.5\textwidth]{example-image-a}
\end{wrapfigure}
\lipsum[1-2]
\newpage
\begin{wrapfigure}{l}{0.5\linewidth}
\includegraphics[width=0.5\textwidth]{example-image-a}
\end{wrapfigure}
\lipsum[1-2]

\end{document}


Is there a automatic solution or parameter?

• What exactly are you trying to accomplish? Could you provide a manual MWE to be automated? – John Kormylo Aug 21 '15 at 20:59
• Do you think it is best practise to place it always right from a typography point of view? – jhg Aug 21 '15 at 22:03
• If you use the o option rather than r or l, it will always be on the outside. – cfr Aug 21 '15 at 22:13

## 1 Answer

The wrapfig package provides placement options o and i in addition to r and l, for outside and inside respectively. So you just need to use the appropriate option (o in this case):

\documentclass[twoside=true]{scrbook}
\usepackage{graphicx,wrapfig}
\usepackage{lipsum}

\begin{document}

\begin{wrapfigure}{o}{0.5\linewidth}
\includegraphics[width=0.5\textwidth]{example-image-a}
\end{wrapfigure}
\lipsum[1-2]
\newpage
\begin{wrapfigure}{o}{0.5\linewidth}
\includegraphics[width=0.5\textwidth]{example-image-a}
\end{wrapfigure}
\lipsum[1-2]

\end{document}