2

My codes,

\documentclass[a4paper,twoside,openright,11pt]{scrbook}
\usepackage[left=1.5cm,right=1cm,top=3cm,bottom=1.5cm,marginparwidth=5.5cm,marginparsep=1cm,outer=8cm]{geometry}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[fulladjust]{marginnote}
\usepackage{sidenotes}
\usepackage[svgnames]{xcolor}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usepackage{showframe}

\captionsetup{
justification=raggedright,
labelfont={color=Maroon,bf},
font=small}

\begin{document}

\begin{figure}  
  \centering
  \begin{subfigure}[t]{0.45\textwidth}
    \centering
    \includegraphics[width=\textwidth]{IMAGE}
    \caption{One Circuit}\label{fig:1a}
  \end{subfigure}
  \quad
  \begin{subfigure}[t]{0.45\textwidth}
    \centering
    \includegraphics[width=\textwidth]{IMAGE}
    \caption{Two Circuit}\label{fig:1b}
  \end{subfigure}
  \caption{What a nice circuits.}\label{fig:1}
\end{figure}

\marginpar{
\begin{center}
\includegraphics[width=\marginparwidth]{IMAGE}
\captionof{figure}{Picture One in Margin}
\end{center}}

\marginpar{
\begin{center}
\includegraphics[width=\marginparwidth]{IMAGE}
\captionof{figure}{Picture Two in Margin}
\end{center}}
\end{document}

And output,

enter image description here

No problem but If possible, subfigures in body, same subfigures attached in margin note. Again If possible use to my preamble.

I didn't find duplicate another question. I found like its, don't working in full my code. Does anyone know how to fix it?

enter image description here

Özgür
  • 3,270

2 Answers2

1

Borrowing from egreg's answer at Using the same figure twice with no new number, here is a solution. EDITED to match format better.

I use \repeatcaption and \repeatsubcaption to regurgitate the label based on a prior reference.

\documentclass[a4paper,twoside,openright,11pt]{scrbook}
\usepackage[left=1.5cm,right=1cm,top=3cm,bottom=1.5cm,marginparwidth=5.5cm,
  marginparsep=1cm,outer=8cm]{geometry}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[fulladjust]{marginnote}
\usepackage{sidenotes}
\usepackage[svgnames]{xcolor}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usepackage{showframe}

\captionsetup{
justification=raggedright,
labelfont={color=Maroon,bf},
font=small}

\newcommand{\repeatcaption}[2]{%
  \addtocounter{figure}{-1}%
  \renewcommand{\thefigure}{\ref{#1}}%
  \captionsetup{list=no, labelformat=simple, labelsep=colon}%
  \captionof{figure}{#2}%
}

\newcommand{\repeatsubcaption}[2]{%
  \renewcommand{\thesubfigure}{\subref{#1}}%
  \captionsetup{list=no, labelformat=parens, labelsep=space}%
  \captionof{subfigure}{#2}%
}
\begin{document}
\begin{figure}  
  \centering
  \begin{subfigure}[t]{0.45\textwidth}
    \centering
    \includegraphics[width=\textwidth]{example-image-A}
    \caption{One Circuit}\label{fig:1a}
  \end{subfigure}
  \quad
  \begin{subfigure}[t]{0.45\textwidth}
    \centering
    \includegraphics[width=\textwidth]{example-image-B}
    \caption{Two Circuit}\label{fig:1b}
  \end{subfigure}
  \caption{What a nice circuits.}\label{fig:1}
\end{figure}

\marginpar{
\begin{center}
\includegraphics[width=\marginparwidth]{example-image-A}
\repeatsubcaption{fig:1a}{One Circuit}
\medskip
\includegraphics[width=\marginparwidth]{example-image-B}
\repeatsubcaption{fig:1b}{Two Circuit}
\repeatcaption{fig:1}{What a nice circuits.}
\end{center}}

\end{document}

enter image description here

0

I had such a solution. Do you want evaluate? How is it? Or is there a simple way?

\documentclass[a4paper,twoside,openright,11pt]{scrbook}
\usepackage[left=1.5cm,right=1cm,top=3cm,bottom=1.5cm,marginparwidth=5.5cm,marginparsep=1cm,outer=8cm]{geometry}

\usepackage[utf8]{inputenc}
\usepackage[svgnames]{xcolor}

\usepackage{caption}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usepackage{calc}
\usepackage{showframe}

\captionsetup{
justification=raggedright,
labelfont={color=Maroon,bf},
font=small,textfont=it,
indention=0pt,format=plain}

\newcommand{\margintwosubfigures}[5]{
\marginpar{
\includegraphics[width=\marginparwidth]{#1}
\begin{center}\raggedright\small\bfseries\textcolor{Maroon}{(a)} \normalfont\small\itshape {#2}\end{center}
    \includegraphics[width=\marginparwidth]{#3}
    \begin{center}\raggedright\small\bfseries\textcolor{Maroon}{(b)} \normalfont\small\itshape {#4}\end{center}
\captionof{figure}{#5}
}}

\begin{document}

\begin{figure}[h]
\centering
\includegraphics[keepaspectratio=false,width=6cm]{example-image-a}
\caption{I am a figure}
\end{figure}

\margintwosubfigures{example-image-a}{First Subfigure}{example-image-a}{Second Subfigure}{Two Subfigures}

\end{document}

enter image description here

Özgür
  • 3,270