海报中子图上的箭头形式图形叠加(TiKZ)(a0poster.cls)

海报中子图上的箭头形式图形叠加(TiKZ)(a0poster.cls)

我正在尝试创建一张海报(现在我正在使用“a0poster.cls”),但在使用 tikz 之后,我无法整合子图的透支这个例子作者:Gonzalo Medina。在这张海报中,我还使用了论文中的(外部化的)pgfplots。这个想法是创建一个包含三个子图的图形,这些子图使用相互连接的箭头来阐明。我试图通过在单独的 .tex 文件中外部化图形来找到解决问题的方法,以便随后包含导出的图形,但在这里我也失败了:

\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}

这是我对海报的 MWE 以及所使用的软件包:

\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}

所以我的实际问题是,在 (a0) 海报环境中集成三个用箭头装饰的子图的最佳方法是什么。有没有解决方法可以将其直接与 mdwframed 子图集成,或者可能有其他方法?

答案1

\tikzexternaldisbale我发现了一个非常简单的解决方案,即用和包围图形\tikzexternalenable。这对我来说是一个不错的解决方案,但我不确定是否仍然可以使用 subfloat 外部化 mdwframed 图片。

使用上面的 MWE:

\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}

相关内容