5

I am preparing layout similar to How to create twoside book with oneside margin?

I get error in the position of caption in odd page. The location of caption in the even page is correct.

\documentclass{scrbook}

\usepackage{sidenotes}
\usepackage[demo]{graphicx}

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

\usepackage{blindtext}

\makeatletter
\renewcommand{\@sidenotes@adjust}{%
\checkoddpage%
\ifoddpage%
\hspace{-\@sidenotes@extrawidth}% 
\else%
\hspace{-\@sidenotes@extrawidth}%    
\fi}
\makeatother

\begin{document}

\blindtext

\begin{marginfigure}
\includegraphics[width=100pt]{rectangle}
\caption{I am a figure}
\end{marginfigure}

%\blindtext
\begin{figure}[htb!]
\centering
\includegraphics[width=100pt]{rectangle}
\caption{I am a figure}
\end{figure}


\begin{figure*}
%\centering
\includegraphics[width=400pt]{rectangle}
\caption{I am a figure}
\end{figure*}

\clearpage

\begin{margintable}%
    \small
    \begin{tabular}{lll}
     Hg&Sn&Pb \\
    0.50&0.47&0.48\\
  \end{tabular}
    \caption{I am a table.}%
\end{margintable}%

\blindtext


\begin{marginfigure}
\includegraphics[width=100pt]{rectangle}
\caption{I am a figure}
\end{marginfigure}

%\blindtext
\begin{figure}[htb!]
\centering
\includegraphics[width=100pt]{rectangle}
\caption{I am a figure}
\end{figure}


\begin{figure*}
%\centering
\includegraphics[width=400pt]{rectangle}
\caption{I am a figure}
\end{figure*}

\end{document}

enter image description here

sandu
  • 7,950

1 Answers1

5

You have to change the caption style widefigure so to have the same margin on odd and even pages:

\DeclareCaptionStyle{widefigure}{margin=-\@sidenotes@extrawidth,font=footnotesize}

Note that the redefinition of \@sidenotes@adjust can be made simpler:

\renewcommand{\@sidenotes@adjust}{\hspace{-\@sidenotes@extrawidth}}

MWE:

\documentclass[twoside=semi]{scrbook}

\usepackage{sidenotes}
\usepackage[demo]{graphicx}

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

\usepackage{blindtext}

\makeatletter
\renewcommand{\@sidenotes@adjust}{\hspace{-\@sidenotes@extrawidth}}
\DeclareCaptionStyle{widefigure}{margin=-\@sidenotes@extrawidth,font=footnotesize}
\makeatother

\begin{document}

\blindtext

\begin{marginfigure}
\includegraphics[width=100pt]{rectangle}
\caption{I am a figure}
\end{marginfigure}

%\blindtext
\begin{figure}[htb!]
\centering
\includegraphics[width=100pt]{rectangle}
\caption{I am a figure}
\end{figure}


\begin{figure*}
%\centering
\includegraphics[width=400pt]{rectangle}
\caption{I am a figure}
\end{figure*}

\clearpage

\begin{margintable}%
    \small
    \begin{tabular}{lll}
     Hg&Sn&Pb \\
    0.50&0.47&0.48\\
  \end{tabular}
    \caption{I am a table.}%
\end{margintable}%

\blindtext


\begin{marginfigure}
\includegraphics[width=100pt]{rectangle}
\caption{I am a figure}
\end{marginfigure}

%\blindtext
\begin{figure}[htb!]
\centering
\includegraphics[width=100pt]{rectangle}
\caption{I am a figure}
\end{figure}


\begin{figure*}
%\centering
\includegraphics[width=400pt]{rectangle}
\caption{I am a figure}
\end{figure*}

\end{document} 

Output:

enter image description here

karlkoeller
  • 124,410
  • The option [twoside=semi] : i want to know the meaning – sandu Apr 08 '14 at 05:27
  • @sandu Sorry, I forgot to delete it. Anyway, in scrbook class, using twoside=semi results in a double-sided typesetting with single-sided margins and single-sided. That is, in other words, the same thing of the option asymmetric for the geometry package. – karlkoeller Apr 08 '14 at 05:35