Starting a new project (script for a lecture) I would like to put wide graphs partly into the margin. The following MWE shows the current situation (very much simplified).
\documentclass[parskip=true]{scrbook}
\usepackage{calc}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\setlength{\textwidth}{10cm}
\setlength{\marginparsep}{1cm}
\setlength{\marginparwidth}{5cm}
\begin{document}
\section*{Version 1}
foo
\rule{\textwidth}{1pt}
\begin{figure}[h]
\makebox[\textwidth]{\rule{\textwidth+\marginparsep+0.6\marginparwidth}{1cm}}
\caption{bla}
\end{figure}
bar
\newpage
foo
\rule{\textwidth}{1pt}
\begin{figure}[h]
\makebox[\textwidth]{\rule{\textwidth+\marginparsep+0.6\marginparwidth}{1cm}}
\caption{bla}
\end{figure}
bar
\newpage
\section*{Version 2}
foo
\rule{\textwidth}{1pt}
\begin{figure}[h]
\rule{\textwidth+\marginparsep+0.6\marginparwidth}{1cm}
\caption{bla}
\end{figure}
bar
\newpage
foo
\rule{\textwidth}{1pt}
\begin{figure}[h]
\rule{\textwidth+\marginparsep+0.6\marginparwidth}{1cm}
\caption{bla}
\end{figure}
bar
\end{document}
I need the figure to be left-justified on the odd pages and to be right-justified on the even pages (not so surprising). Both approaches (versions 1 and 2) do not yield this result.
The width of the graph will vary and any manual adjustment is not acceptable. Of course I can put each graph into a box, measure its width and set it according to this value. But I wonder (and hope) if there is simpler solution. Maybe this is already implemented in a package?


memoir. See the manual if it has a similar environment and a similar commend. Otherwise tryscrextend. The package has been made to provide several KOMA-Script features to users of other classes. – Schweinebacke Dec 12 '17 at 07:57