2

I am trying to create a poster (right now I am using 'a0poster.cls') and I am not able to integrate subfigures overdrawn with tikz after this example by Gonzalo Medina. In this poster I am using also (externalized) pgfplots out of my thesis. The idea is to create a figure with three subfigures that are claryfied using interlinked arrows. I tried to find a way around my problem by externalizing the figure in a seperate .tex file to include the exported grapic subsequently, but here I also failed:

\documentclass{scrartcl}
\usepackage{courier}
\usepackage[labelsep=period]{caption}
\usepackage{subcaption}
\usepackage{graphicx}
\usepackage[framemethod=tikz]{mdframed}
\usepackage{tikz}
\usetikzlibrary{arrows,positioning,external}
\tikzexternalize[prefix=tikzpictures/]
\usepackage{floatrow}



\begin{document}

\begin{figure}
\begin{mdframed}[
  align=center,
  linecolor=black,
  fontcolor=black,
  backgroundcolor=white,
  %userdefinedwidth=0.9\textwidth,
  roundcorner=5pt,
  skipabove=10pt,
  skipbelow=10pt,
  leftmargin=0pt,
  innertopmargin=40pt,
  innerbottommargin=0pt, 
  innerlinewidth=0pt,
  middlelinewidth=0pt,
  outerlinewidth=1pt
]
\floatsetup[subfigure]{captionskip=10pt}
\ffigbox{%
\begin{subfloatrow}[3]
  \ffigbox{%
  \tikzsetnextfilename{importantFigure1}
  \begin{tikzpicture}[remember picture]
  \node[anchor=south west,inner sep=0] (image1) 
    {\def\svgwidth{.7\linewidth}
       \input{cbudzc_bi.pdf_tex}} ;
%  \mygrid{image1}
  \end{tikzpicture}
  }%
  {\subcaption{subcap1}\label{sfig:a}}%
  \ffigbox{%
  \tikzsetnextfilename{importantFigure2}
  \begin{tikzpicture}[remember picture]
    \node[anchor=south west,inner sep=0] (image2)  
      {\def\svgwidth{.45\linewidth}
         \input{cbuabw.pdf_tex}};
%  \mygrid{image2}
  \end{tikzpicture}
  }%
  {\subcaption{subcap2}\label{sfig:b}}
  \ffigbox{%
  \tikzsetnextfilename{importantFigure3}
  \begin{tikzpicture}[remember picture]
  \node[anchor=south west,inner sep=0] (image3) 
    {\def\svgwidth{.8\linewidth}
           \input{ABWnew.pdf_tex}};
%  \mygrid{image3}
  \end{tikzpicture}
  }%
  {\subcaption{subcap3}\label{sfig:c}}
\end{subfloatrow}  
}{\caption{figure}{A Minimal Working Example with three subfigures:~\ref{sfig:a}, \ref{sfig:b} and~\ref{sfig:c}}}
\end{mdframed}
\end{figure}

\begin{tikzpicture}[remember picture,overlay]
% Some arrows
%\draw[->,line width=1.5pt,cyan!80!black,dashed] 
%  ([yshift=0pt,xshift=10pt]image2.north) |- +(0,60pt) -|
%  ([yshift=-40pt,xshift=20pt]image3.north);
%\draw[->,line width=1.5pt,orange!80!black] 
%  ([yshift=-10pt,xshift=20pt]image2.west) |- 
%  ([yshift=-10pt,xshift=20pt]image3.west);
\draw[->,line width=1.5pt,cyan!80!black,dashed] 
  ([xshift=60pt,yshift=10pt]image1.west) |- +(0,80pt) -| 
  ([yshift=48pt,xshift=49pt]image3.west);
\draw[->,line width=1.5pt,green!80!black,dashed] 
  ([yshift=-31pt,xshift=-43pt]image2.east) |- +(0,-18pt) -|
  ([yshift=-51pt,xshift=-40pt]image3.east);
% Some labels
%\node[anchor=north west,rotate=90,font=\ttfamily] 
%  at (image1.north west) {Lane1: geneA};
%\node[anchor=north west,rotate=90,font=\ttfamily,yshift=-15pt] 
%  at (image1.north west) {Lane2: geneB};
%\node[anchor=north west,rotate=90,font=\ttfamily,yshift=-30pt] 
%  at (image1.north west) {Lane3: geneC};

  \end{tikzpicture}

\end{document}

This is my MWE of the poster with the used packages:

\documentclass[a0,portrait]{a0poster}
\usepackage[utf8]{inputenc}
\usepackage{multicol} 
\columnsep=100pt 
\columnseprule=3pt

\usepackage[svgnames]{xcolor} 
\usepackage{graphicx}

\usepackage{times} 
\usepackage{xspace}
\usepackage{graphicx} 
\usepackage{booktabs}
\usepackage[font=small,labelfont=bf]{caption} 
\usepackage{amsfonts, amsmath, amsthm, amssymb} 
\usepackage{wrapfig} 
\usepackage{siunitx}
\usepackage[version=3]{mhchem}
\usepackage{tabularx,threeparttable,booktabs}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepgfplotslibrary{external} 
\usetikzlibrary{spy,arrows,positioning,external}
    \tikzexternalize[prefix=tikzpictures/]

    \begin{document}
    \begin{center}
    \begin{mdframed}[
  align=center,
  linecolor=black,
  fontcolor=black,
  backgroundcolor=white,
  %userdefinedwidth=0.9\textwidth,
  roundcorner=5pt,
  skipabove=10pt,
  skipbelow=10pt,
  leftmargin=0pt,
  innertopmargin=40pt,
  innerbottommargin=0pt, 
  innerlinewidth=0pt,
  middlelinewidth=0pt,
  outerlinewidth=1pt
]
\floatsetup[subfigure]{captionskip=10pt}
\ffigbox{%
\begin{subfloatrow}[3]
  \ffigbox{%
  \begin{tikzpicture}[remember picture]
  \node[anchor=south west,inner sep=0] (image1) 
    {\def\svgwidth{.7\linewidth}
       \input{subfigure1.pdf_tex}} ;
  \mygrid{image1}
  \end{tikzpicture}
  }%
  {\subcaption{subcap1}\label{sfig:a}}%
  \ffigbox{%
  \begin{tikzpicture}[remember picture]
    \node[anchor=south west,inner sep=0] (image2)  
      {\def\svgwidth{.45\linewidth}
         \input{subfigure2.pdf_tex}};
  \mygrid{image2}
  \end{tikzpicture}
  }%
  {\subcaption{subcap2}\label{sfig:b}}
  \ffigbox{%
  \begin{tikzpicture}[remember picture]
  \node[anchor=south west,inner sep=0] (image3) 
    {\def\svgwidth{.8\linewidth}
           \input{subfigure3.pdf_tex}};
  \mygrid{image3}
  \end{tikzpicture}
  }%
  {\subcaption{subcap3}\label{sfig:c}}
\end{subfloatrow}  
}{\captionof{figure}{A Minimal Working Example with three subfigures:~\ref{sfig:a}, \ref{sfig:b} and~\ref{sfig:c}}}
\end{mdframed}
\end{center}

\begin{tikzpicture}[remember picture,overlay]
% Some arrows
%\draw[->,line width=1.5pt,cyan!80!black,dashed] 
%  ([yshift=0pt,xshift=10pt]image2.north) |- +(0,60pt) -|
%  ([yshift=-40pt,xshift=20pt]image3.north);
%\draw[->,line width=1.5pt,orange!80!black] 
%  ([yshift=-10pt,xshift=20pt]image2.west) |- 
%  ([yshift=-10pt,xshift=20pt]image3.west);
\draw[->,line width=1.5pt,cyan!80!black,dashed] 
  ([xshift=60pt,yshift=10pt]image1.west) |- +(0,80pt) -| 
  ([yshift=48pt,xshift=49pt]image3.west);
\draw[->,line width=1.5pt,green!80!black,dashed] 
  ([yshift=-31pt,xshift=-43pt]image2.east) |- +(0,-18pt) -|
  ([yshift=-51pt,xshift=-40pt]image3.east);
% Some labels
%\node[anchor=north west,rotate=90,font=\ttfamily] 
%  at (image1.north west) {Lane1: geneA};
%\node[anchor=north west,rotate=90,font=\ttfamily,yshift=-15pt] 
%  at (image1.north west) {Lane2: geneB};
%\node[anchor=north west,rotate=90,font=\ttfamily,yshift=-30pt] 
%  at (image1.north west) {Lane3: geneC};

  \end{tikzpicture}

\end{document}

So my actual question is, what would be the best way to achieve my goal to integrate three subfigures decorated by arrows in a (a0) poster environment. Is there a workaround to integrate it directly with the mdwframed subfigures, or maybe an alternative?

2

I found a quite easy solution for the problem by enclosing the figure with \tikzexternaldisbale and \tikzexternalenable. This is a decent solution for me but I'm not sure if externalization of the mdwframed picture with subfloat is still possible.

With the MWE from above:

\documentclass{scrartcl}
\usepackage{courier}
\usepackage[labelsep=period]{caption}
\usepackage{subcaption}
\usepackage{graphicx}
\usepackage[framemethod=tikz]{mdframed}
\usepackage{tikz}
\usetikzlibrary{arrows,positioning,external}
\tikzexternalize[prefix=tikzpictures/]
\usepackage{floatrow}

\begin{document}

\tikzexternaldisable

\begin{figure}
\begin{mdframed}[
  align=center,
  linecolor=black,
  fontcolor=black,
  backgroundcolor=white,
  %userdefinedwidth=0.9\textwidth,
  roundcorner=5pt,
  skipabove=10pt,
  skipbelow=10pt,
  leftmargin=0pt,
  innertopmargin=40pt,
  innerbottommargin=0pt, 
  innerlinewidth=0pt,
  middlelinewidth=0pt,
  outerlinewidth=1pt
]
\floatsetup[subfigure]{captionskip=10pt}
\ffigbox{%
\begin{subfloatrow}[3]
  \ffigbox{%
  \tikzsetnextfilename{importantFigure1}
  \begin{tikzpicture}[remember picture]
  \node[anchor=south west,inner sep=0] (image1) 
    {\def\svgwidth{.7\linewidth}
       \input{image1_tex}} ;
%  \mygrid{image1}
  \end{tikzpicture}
  }%
  {\subcaption{subcap1}\label{sfig:a}}%
  \ffigbox{%
  %\tikzsetnextfilename{importantFigure2}
  \begin{tikzpicture}[remember picture]
    \node[anchor=south west,inner sep=0] (image2)  
      {\def\svgwidth{.45\linewidth}
         \input{image2.pdf_tex}};
%  \mygrid{image2}
  \end{tikzpicture}
  }%
  {\subcaption{subcap2}\label{sfig:b}}
  \ffigbox{%
  %\tikzsetnextfilename{importantFigure3}
  \begin{tikzpicture}[remember picture]
  \node[anchor=south west,inner sep=0] (image3) 
    {\def\svgwidth{.8\linewidth}
           \input{image3.pdf_tex}};
%  \mygrid{image3}
  \end{tikzpicture}
  }%
  {\subcaption{subcap3}\label{sfig:c}}
\end{subfloatrow}  
}{\caption{figure}{A Minimal Working Example with three subfigures:~\ref{sfig:a},                     \ref{sfig:b} and~\ref{sfig:c}}}
\end{mdframed}
\end{figure}

\begin{tikzpicture}[remember picture,overlay]
% Some arrows
%\draw[->,line width=1.5pt,cyan!80!black,dashed] 
%  ([yshift=0pt,xshift=10pt]image2.north) |- +(0,60pt) -|
%  ([yshift=-40pt,xshift=20pt]image3.north);
%\draw[->,line width=1.5pt,orange!80!black] 
%  ([yshift=-10pt,xshift=20pt]image2.west) |- 
%  ([yshift=-10pt,xshift=20pt]image3.west);
\draw[->,line width=1.5pt,cyan!80!black,dashed] 
  ([xshift=60pt,yshift=10pt]image1.west) |- +(0,80pt) -| 
  ([yshift=48pt,xshift=49pt]image3.west);
\draw[->,line width=1.5pt,green!80!black,dashed] 
  ([yshift=-31pt,xshift=-43pt]image2.east) |- +(0,-18pt) -|
  ([yshift=-51pt,xshift=-40pt]image3.east);
\end{tikzpicture}

\tikzexternalenable

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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