TikZ 图片未出现在海报中

TikZ 图片未出现在海报中

我正在使用此处提供的模板用 LaTeX 制作海报http://www.damtp.cam.ac.uk/user/eglen/damtp/cuposter/

由于某种原因,使用 TikZ 创建的图像未出现在海报中。它编译得很好,并且使用添加的其他图像也\includegraphics{}出现了。以下是我认为相关的代码部分。同一段代码以及初始 TikZ 包含和定义在 LNCS 模板中运行良好。如果我可以添加更多信息,请告诉我。

\documentclass[noback]{cuposter}

\usepackage{mathptmx}
\usepackage{xspace}
\usepackage{amsmath}
\usepackage{pifont}
\usepackage{psfrag}
\usepackage{graphicx}
\usepackage{wrapfig}

% Tikz stuff
\usepackage{tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{positioning}
\usetikzlibrary{fit,chains}

\tikzset{latent/.style={circle,fill=white,draw=black,inner sep=1pt, 
minimum size=20pt, font=\fontsize{10}{10}\selectfont},
obs/.style={latent,fill=gray!25},
const/.style={rectangle, inner sep=0pt},
factor/.style={rectangle, fill=black,minimum size=5pt, inner sep=0pt},
>={triangle 45}}

\pgfdeclarelayer{b}
\pgfdeclarelayer{f}
\pgfsetlayers{b,main,f}

% shapename, fitlist, caption, pos
\newcommand{\plate}[4]{
\begin{pgfonlayer}{b}
    \node (invis#1) [draw, color=white, inner sep=2pt,rectangle, fit=#2] {};
\end{pgfonlayer}

\begin{pgfonlayer}{f}
    \node (#1) [draw,inner sep=0pt, rectangle,fit=(invis#1),#3,#4] {};
\end{pgfonlayer}
}

\begin{document}

.
.
.

\begin{figure}
    \begin{center}
        \begin{tikzpicture}
    \node [matrix,matrix anchor=mid, column sep=5pt, row sep=20pt] {
    % hidden layer
    \node (inv) [draw=none] {}; &
    \node (inv) [draw=none] {}; &
    \node (inv) [draw=none] {}; &
    \node (h1) [latent] {$h_1$}; &
    \node (h2) [latent] {$h_2$}; &
    \node (hlabel) [draw=none] {$\mathbf{h}$};
    \\

    % visible layer
    \node (inv) [draw=none] {}; &
    \node (inv) [draw=none] {}; &
    \node (x1) [latent] {$v_1$}; &
    \node (x2) [latent] {$v_2$}; &
    \node (x3) [latent] {$v_3$}; &
    \node (x4) [latent] {$v_4$}; &
    \node (xlabel) [draw=none] {$\mathbf{v}$}; &        
    \node (inv) [draw=none] {}; &       
    \\
    };

    % connections
    \draw [-] (x1) -- node [left=2pt] {} (h1);
    \draw [-] (x1) -- node [left=2pt] {} (h2);
    \draw [-] (x2) -- node [left=2pt] {} (h1);
    \draw [-] (x2) -- node [left=2pt] {} (h2);
    \draw [-] (x3) -- node [left=2pt] {} (h1);
    \draw [-] (x3) -- node [left=2pt] {} (h2);
    \draw [-] (x4) -- node [left=2pt] {} (h1);
    \draw [-] (x4) -- node [right=2pt] {W} (h2);
    \end{tikzpicture}
    \end{center}
\caption{A simple Restricted Boltzmann Machine with four visible, two hidden, and no bias units.}
\label{fig:rbm}
\end{figure}

.
.
.

\end{document}

谢谢!

答案1

该类cuposter不允许使用诸如figure或 之类的浮动环境table

删除figure环境后你的图片就会出现。

相关内容