Betten Sie ein Tikz-Bild in eine Includegraphics-Umgebung ein.

Betten Sie ein Tikz-Bild in eine Includegraphics-Umgebung ein.

\tikzpicture Ich möchte ein in ein einfügen. \includegraphicsAuf diese Weise kann ich mein Bild auf die Hälfte der Seite einstellen.

Kann mir jemand helfen? Hier ist mein MWE:

\documentclass{article}
\usepackage{xcolor}
\usepackage{tikz} 
    \usetikzlibrary{chains}
    \usetikzlibrary{positioning}
    \usetikzlibrary{backgrounds}
    \usetikzlibrary{trees}

\usetikzlibrary{arrows,automata}
\usepackage{epstopdf}
\definecolor{mycolor}{RGB}{8,108,131}
\usepackage{array}
\usepackage{adjustbox}      
\usetikzlibrary{shapes}
\usepackage{colortbl}
\begin{document}        
    \begin{figure}[h!]
        \centering
        \includegraphics[width=0.5\textwidth]{%to fill 1/2 of the page and to see entierly my tikzpicture
        \begin{tikzpicture}
            [ 
            show background rectangle,
            background rectangle/.style={fill=gray!10}
            ];
            \node[rounded corners=3mm, fill=mycolor!20] (1) [draw,minimum width=2.4cm,minimum height=2.4cm] {Live functionnal OpenStack Cluster};
            \node[rounded corners=3mm, fill=mycolor!20] (2) [draw,minimum width=2.4cm,minimum height=2.4cm, right=1cm of 1] {Configure Tempest};
            \node[rounded corners=3mm, fill=mycolor!20] (3) [draw,minimum width=2.4cm,minimum height=2.4cm, right=1cm of 2] {Run Tempest Tests};            
            \node[rounded corners=3mm, fill=mycolor!20] (4) [draw,minimum width=2.4cm,minimum height=2.4cm, right=1cm of 3] {Collect test results};
            \node[rounded corners=3mm, fill=mycolor!20] (5) [draw,minimum width=2.4cm,minimum height=2.4cm, right=1cm of 4] {Analyse test results};
            \node[rounded corners=3mm, fill=mycolor!20] (6) [draw,minimum width=2.4cm,minimum height=2.4cm, right=1cm of 5] {Run Tempest cleanup};
            \draw[thick,->] (1) -- node[above]{} (2);
            \draw[thick,->] (2) -- node[above]{} (3);
            \draw[thick,->] (3) -- node[above]{} (4);
            \draw[thick,->] (4) -- node[above]{} (5);
            \draw[thick,->] (5) -- node[above]{} (6);
          %  \path[mycolor,->,thick] (root) edge  [loop left] node {Auto-signé} ();
        \end{tikzpicture}
        }
        \caption{Chaînage des signatures pour Let's encrypt}
    \end{figure}

\end{document} 

Thx für die Hilfe

Antwort1

Ich glaube, Sie wollen eineresizebox

\documentclass{article}
\usepackage{xcolor}
\usepackage{tikz} 
    \usetikzlibrary{chains}
    \usetikzlibrary{positioning}
    \usetikzlibrary{backgrounds}
    \usetikzlibrary{trees}

\usetikzlibrary{arrows,automata}
\usepackage{epstopdf}
\definecolor{mycolor}{RGB}{8,108,131}
\usepackage{array}
\usepackage{adjustbox}      
\usetikzlibrary{shapes}
\usepackage{colortbl}
\begin{document}        
    \begin{figure}[h!]
        \centering
        \resizebox{0.5\textwidth}{!}{%to fill 1/2 of the page and to see entierly my tikzpicture
        \begin{tikzpicture}
            [ 
            show background rectangle,
            background rectangle/.style={fill=gray!10}
            ];
            \node[rounded corners=3mm, fill=mycolor!20] (1) [draw,minimum width=2.4cm,minimum height=2.4cm] {Live functionnal OpenStack Cluster};
            \node[rounded corners=3mm, fill=mycolor!20] (2) [draw,minimum width=2.4cm,minimum height=2.4cm, right=1cm of 1] {Configure Tempest};
            \node[rounded corners=3mm, fill=mycolor!20] (3) [draw,minimum width=2.4cm,minimum height=2.4cm, right=1cm of 2] {Run Tempest Tests};            
            \node[rounded corners=3mm, fill=mycolor!20] (4) [draw,minimum width=2.4cm,minimum height=2.4cm, right=1cm of 3] {Collect test results};
            \node[rounded corners=3mm, fill=mycolor!20] (5) [draw,minimum width=2.4cm,minimum height=2.4cm, right=1cm of 4] {Analyse test results};
            \node[rounded corners=3mm, fill=mycolor!20] (6) [draw,minimum width=2.4cm,minimum height=2.4cm, right=1cm of 5] {Run Tempest cleanup};
            \draw[thick,->] (1) -- node[above]{} (2);
            \draw[thick,->] (2) -- node[above]{} (3);
            \draw[thick,->] (3) -- node[above]{} (4);
            \draw[thick,->] (4) -- node[above]{} (5);
            \draw[thick,->] (5) -- node[above]{} (6);
          %  \path[mycolor,->,thick] (root) edge  [loop left] node {Auto-signé} ();
        \end{tikzpicture}
        }
        \caption{Chaînage des signatures pour Let's encrypt}
    \end{figure}

    \begin{figure}[h!]
        \centering
        \resizebox{\textwidth}{!}{%to fill 1/2 of the page and to see entierly my tikzpicture
        \begin{tikzpicture}
            [ 
            show background rectangle,
            background rectangle/.style={fill=gray!10}
            ];
            \node[rounded corners=3mm, fill=mycolor!20] (1) [draw,minimum width=2.4cm,minimum height=2.4cm] {Live functionnal OpenStack Cluster};
            \node[rounded corners=3mm, fill=mycolor!20] (2) [draw,minimum width=2.4cm,minimum height=2.4cm, right=1cm of 1] {Configure Tempest};
            \node[rounded corners=3mm, fill=mycolor!20] (3) [draw,minimum width=2.4cm,minimum height=2.4cm, right=1cm of 2] {Run Tempest Tests};            
            \node[rounded corners=3mm, fill=mycolor!20] (4) [draw,minimum width=2.4cm,minimum height=2.4cm, right=1cm of 3] {Collect test results};
            \node[rounded corners=3mm, fill=mycolor!20] (5) [draw,minimum width=2.4cm,minimum height=2.4cm, right=1cm of 4] {Analyse test results};
            \node[rounded corners=3mm, fill=mycolor!20] (6) [draw,minimum width=2.4cm,minimum height=2.4cm, right=1cm of 5] {Run Tempest cleanup};
            \draw[thick,->] (1) -- node[above]{} (2);
            \draw[thick,->] (2) -- node[above]{} (3);
            \draw[thick,->] (3) -- node[above]{} (4);
            \draw[thick,->] (4) -- node[above]{} (5);
            \draw[thick,->] (5) -- node[above]{} (6);
          %  \path[mycolor,->,thick] (root) edge  [loop left] node {Auto-signé} ();
        \end{tikzpicture}
        }
        \caption{Chaînage des signatures pour Let's encrypt}
    \end{figure}
\end{document} 

Bildbeschreibung hier eingeben

verwandte Informationen