Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

up vote 5 down vote accepted

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

share|improve this answer
    
The option [twoside=semi] : i want to know the meaning –  sandu Apr 8 at 5: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 8 at 5:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.