3

MWE

\documentclass[oneside]{scrbook}

\usepackage{blindtext}

\usepackage{sidenotes}
\usepackage{mwe}

\usepackage[showframe]{geometry}
\geometry{paperwidth=170mm, paperheight=240mm, left=42pt, top=40pt, textwidth=280pt, marginparsep=20pt, marginparwidth=100pt, textheight=560pt, footskip=40pt}
%



\begin{document}




%
\begin{marginfigure}%
    \includegraphics[width=\marginparwidth]{example-image-a}%
    \caption{A small rectangle put in the margin.\label{rectangle}}%
\end{marginfigure}%
%
\blindtext
%
\begin{figure*}[htbp]
    \includegraphics[height=180pt,width=400pt]{example-image-c}%
    \caption{An even larger rectangle. This is the widest figure option. Both, the text as well as the margin width are used for the diagram.}
    \label{rectangle3}
\end{figure*}
%
\clearpage
%
\begin{marginfigure}%
    \includegraphics[width=\marginparwidth]{example-image-a}%
    \caption{A small rectangle put in the margin.\label{rectangle2}}%
\end{marginfigure}%
%
\blindtext
%
\begin{figure*}[htbp]
    \includegraphics[height=180pt,width=400pt]{example-image-c}%
    \caption{An even larger rectangle. This is the widest figure option. Both, the text as well as the margin width are used for the diagram.}
    \label{rectangle31}
\end{figure*}
%
\end{document}

Right placement of figure

enter image description here

Wrong placement of figure

enter image description here

sandu
  • 7,950

1 Answers1

4

figure* is not designed for oneside option. You can do this patch for one side. This won't work for two side/don't do this for twoside.

 \documentclass[oneside]{scrbook}

\usepackage{blindtext}

\usepackage{sidenotes}
\usepackage{mwe}

\usepackage[showframe]{geometry}
\geometry{paperwidth=170mm, paperheight=240mm, left=42pt, top=40pt, textwidth=280pt, marginparsep=20pt, marginparwidth=100pt, textheight=560pt, footskip=40pt}
%
\makeatletter
%\renewcommand{\@sidenotes@adjust}{%
% \checkoddpage%
% \ifoddpage%
% %
% \else%
% %\hspace{\@sidenotes@extrawidth}%    %% this was originally there
% \fi}
%%
%% or
%%
\let\@sidenotes@adjust\relax
\makeatother


\begin{document}
%
\begin{marginfigure}%
    \includegraphics[width=\marginparwidth]{example-image-a}%
    \caption{A small rectangle put in the margin.\label{rectangle}}%
\end{marginfigure}%
%
\blindtext
%
\begin{figure*}[htbp]
    \includegraphics[height=180pt,width=400pt]{example-image-c}%
    \caption{An even larger rectangle. This is the widest figure option. Both, the text as well as the margin width are used for the diagram.}
    \label{rectangle3}
\end{figure*}
%
\clearpage
%
\begin{marginfigure}%
    \includegraphics[width=\marginparwidth]{example-image-a}%
    \caption{A small rectangle put in the margin.\label{rectangle2}}%
\end{marginfigure}%
%
\blindtext
%
\begin{figure*}[htbp]
    \includegraphics[height=180pt,width=400pt]{example-image-c}%
    \caption{An even larger rectangle. This is the widest figure option. Both, the text as well as the margin width are used for the diagram.}
    \label{rectangle31}
\end{figure*}
%
\end{document}

enter image description here