表格移出页面右侧。如何缩小它?

表格移出页面右侧。如何缩小它?

我有一张包含 5 张图表的表格,表格移到了页面之外。如何防止这种情况发生?以下是重现该问题的代码

\documentclass{article}
\usepackage[utf8]{inputenc} % allow utf-8 input
\usepackage[T1]{fontenc}    % use 8-bit T1 fonts
\usepackage{hyperref}       % hyperlinks
\usepackage{url}            % simple URL typesetting
\usepackage{booktabs}       % professional-quality tables
\usepackage{amsfonts}       % blackboard math symbols
\usepackage{nicefrac}       % compact symbols for 1/2, etc.
\usepackage{microtype}      % microtypography
\usepackage{hyperref}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{color}
\usepackage{enumitem}% http://ctan.org/pkg/enumitem
% For figures
\usepackage{graphicx} % more modern
%\usepackage{epsfig} % less modern
\usepackage{subfigure}
\usepackage{wrapfig}
\usepackage{amsmath, amssymb}
\usepackage[font=small,labelfont=bf]{caption}
\usepackage{setspace}

\usepackage{tikz}
\usepackage{amsmath, amssymb,bm,color}
\usetikzlibrary{positioning,arrows}

\def\layersep{2.5cm}
\def\layersepp{3cm}

\begin{document}

\begin{table}
\begin{tabular}{|c|c|c|}
  \hline
    \begin{tabular}{c}
      VAE\\
      \begin{tikzpicture}
         \begin{scope}[xshift=-7.5cm,yshift=-5cm,thick,
          node distance=1.6cm,on grid,>=stealth',
          comp/.style={circle,draw=black}]
          \node [comp]  (input)                       {$x$};
          \node [comp]  (latent)  [right=of input]    {$z$} edge [<-, draw=blue,very thick] (input);
          \node [comp]  (copy)  [right=of latent]    {$\hat{x}$} edge [<-, draw=brown, very thick] (latent);
         \end{scope}
      \end{tikzpicture}\\\hline
      RNN\\
      \begin{tikzpicture}[shorten >=1pt,->,draw=black, node distance=\layersep,transform shape,rotate=90]  %<-- rotate the NN
          \tikzstyle{every pin edge}=[<-,shorten <=1pt]
          \tikzstyle{neuron}=[circle,thick,draw,fill=white,minimum size=17pt,inner sep=0pt]
          \tikzstyle{output neuron}=[neuron];
          \tikzstyle{hoz}=[rotate=-90];


          % hidden states
          \foreach \x / \name in {0/1, 1.5/2, 3/3, 5/t}
          \node[neuron, hoz] (I-\name) at (0,-\x) {$h_\name$};

          \node[hoz] (I-4) at (0,-4) {$\dots$};

          % connect hidden states
          \begin{scope}[
          node/.style={circle,draw=black},
          every edge/.style={draw=red, very thick}
          ]
          \path (I-1.east) edge (I-2.west);
          \path (I-2.east) edge (I-3.west);
          \path (I-3.east) edge (I-4.west);
          \path (I-4.east) edge (I-t.west);

          % inputs states
          \foreach \x / \name in {0/1, 1.5/2, 3/3, 5/t}
          \node[neuron, hoz] (X-\name) at (-1,-\x) {$x_\name$};

          % connect inputs to hidden states
          \foreach \name in {1,2,3,t}
          \path (X-\name.north) edge (I-\name.south);
          \end{scope}


      \end{tikzpicture}\\\hline
      DANN\\
      \begin{tikzpicture}
         \begin{scope}[xshift=-7.5cm,yshift=-5cm,thick,
          node distance=1.6cm,on grid,>=stealth',
          comp/.style={circle,draw=black}]
          \node [comp]  (input)                       {$x$};
          \node [comp]  (latent)  [right=of input]    {$z$} edge [<-,very thick,draw=blue] (input);
          \node [comp]  (label)  [right=of latent,yshift=-0.8cm]    {$L_y$} edge [<-, very thick] (latent);
          \node [comp]  (domain)  [above=of label]    {$L_D$} edge [<-, very thick] (latent);
         \end{scope}
      \end{tikzpicture} 
    \end{tabular}
    &
    \begin{tabular}{c}
      VRNN\\
      \begin{tikzpicture}[shorten >=1pt,->,draw=black, node distance=\layersep,transform shape,rotate=90]  %<-- rotate the NN
          \tikzstyle{every pin edge}=[<-,shorten <=1pt]
          \tikzstyle{recurrence}=[<-,color=green]
          \tikzstyle{neuron}=[circle,thick,draw,fill=white,minimum size=17pt,inner sep=0pt]
          \tikzstyle{output neuron}=[neuron];
          \tikzstyle{hoz}=[rotate=-90];


          \begin{scope}[every path/.style={very thick}]

              % hidden states
              \foreach \y / \name in {0/1, 1.5/2, 3/3, 5/t}
              \node[neuron, hoz] (H-\name) at (0,-\y) {$h_\name$};

              \node[hoz] (H-4) at (0,-4) {$\dots$};

              % connect hidden states
              \path[color=red] (H-1.east) edge (H-2.west);
              \path[color=red] (H-2.east) edge (H-3.west);
              \path[color=red] (H-3.east) edge (H-4.west);
              \path[color=red] (H-4.east) edge (H-t.west);

              % inputs states
              \foreach \y / \name in {0/1, 1.5/2, 3/3, 5/t}
              \node[neuron, hoz] (X-\name) at (-\layersep,-\y) {$x_\name$};

              % connect inputs to hidden states
              \foreach \name in {1,2,3,t}
              \path[color=red] (X-\name.north) edge (H-\name.south);

              % latent states
              \foreach \y / \name in {0/1, 1.5/2, 3/3, 5/t}
              \node[neuron, hoz] (Z-\name) at (\layersep,-\y) {$z_\name$};

              % connect inputs to hidden states
              \foreach \name in {1,2,3,t}
              \path[color=red] (Z-\name.south) edge (H-\name.north);

              % draw inference connections
              \foreach \name in {1,2,3,t}
              \path[color=brown] (Z-\name.south) edge [bend left=70] (X-\name.north);

              % draw generation connections
              \foreach \name in {1,2,3,t}
              \path[color=blue] (X-\name.north) edge [bend left=70] (Z-\name.south);
          \end{scope}

      \end{tikzpicture}
    \end{tabular}
    &
    \begin{tabular}{c}
      VADA\\
    \begin{tikzpicture}[shorten >=1pt,->,draw=black, node distance=\layersep,transform shape,rotate=90]  %<-- rotate the NN
        \tikzstyle{every pin edge}=[<-,shorten <=1pt]
        \tikzstyle{recurrence}=[<-,color=green]
        \tikzstyle{neuron}=[circle,thick,draw,fill=white,minimum size=17pt,inner sep=0pt]
        \tikzstyle{output neuron}=[neuron];
        \tikzstyle{hoz}=[rotate=-90];


        \begin{scope}[every path/.style={very thick}]

            % hidden states
            \foreach \x / \name in {0/1, 1.5/2, 3/3, 5/t}
            \node[neuron, hoz] (H-\name) at (0,-\x) {$h_\name$};

            \node[hoz] (H-4) at (0,-4) {$\dots$};

            % connect hidden states
            \path[color=red] (H-1.east) edge (H-2.west);
            \path[color=red] (H-2.east) edge (H-3.west);
            \path[color=red] (H-3.east) edge (H-4.west);
            \path[color=red] (H-4.east) edge (H-t.west);

            % inputs states
            \foreach \x / \name in {0/1, 1.5/2, 3/3, 5/t}
            \node[neuron, hoz] (X-\name) at (-\layersep,-\x) {$x_\name$};

            % connect inputs to hidden states
            \foreach \name in {1,2,3,t}
            \path[color=red] (X-\name.north) edge (H-\name.south);

            % latent states
            \foreach \x / \name in {0/1, 1.5/2, 3/3, 5/t}
            \node[neuron, hoz] (Z-\name) at (\layersep,-\x) {$z_\name$};

            % connect inputs to hidden states
            \foreach \name in {1,2,3,t}
            \path[color=red] (Z-\name.south) edge (H-\name.north);

            % draw inference connections
            \foreach \name in {1,2,3,t}
            \path[color=brown] (Z-\name.south) edge [bend left=70] (X-\name.north);

            % draw generation connections
            \foreach \name in {1,2,3,t}
            \path[color=blue] (X-\name.north) edge [bend left=70] (Z-\name.south);


            % draw label classifiers
            \foreach \x / \name in {-.5/1, 1/2, 2.5/3, 4.5/t}
            \node[neuron, hoz] (X-\name) at (\layersepp,-\x) {$L_y^\name$};

            % draw domain classifiers
            \foreach \x / \name in {.5/1, 2/2, 3.5/3, 5.5/t}
            \node[neuron, hoz] (X-\name) at (\layersepp,-\x) {$L_D^\name$};
        \end{scope}

    \end{tikzpicture}
    \end{tabular}
   \\\hline
  \end{tabular}
\end{table}

\end{document}

在此处输入图片描述

相关内容