3

I know that there are several options to scale a whole tikz picture (e.g., \resizebox). However, I want to scale only some parts within a single tikz picture.

In my case I want to create some slides for a conference where one slide should be composed of different single (complex) tikz pictures that already exist. Furthermore, I want to have them partly overlapped. I already found \begin{scope}[scale=.2] ... \end{scope}. However, that does not work.

Here is MWE that should visualise what I mean:

\documentclass[border=3mm]{standalone}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage{tikz}
\usetikzlibrary{arrows,positioning,shapes}

\begin{document}

    \begin{tikzpicture}[auto,
              node distance=.5cm,
              rect/.style={rectangle, draw, thick, inner sep=5pt, minimum width=20mm, minimum height=10mm, align=center, fill=white},
              ellips/.style={circle, draw, thick, inner sep=0pt, minimum size=22mm, align=center, fill=white}]

    \node[rect] (A) at (-1, 0) {Stuff A};
    \node[rect] (B) [right= of A] {Stuff B};
    \node[rect] (C) [right= of B] {Stuff C};

    \node[ellips] (D) at (0,0) {As a whole};
    \node[ellips] (E) [below= of D] {we should \\ be scalable};
    \draw [draw, thick] (D.270) [] to node {} (E.90);

    \end{tikzpicture}

\end{document}

enter image description here

In my real case the combination of D and E is a rather complex tikz picture that I'd like to make smaller and to print 'above'/'between' Aand B.

2

I'm not entirely sure this will fit your needs, but you can try nesting with scaling both on the tikzpicture as a whole and on the nodes within (cf. How to scale a tikzpicture including texts?):

\documentclass[border=3mm]{standalone}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage{tikz}
\usetikzlibrary{arrows,positioning,shapes}

\begin{document}

    \begin{tikzpicture}[auto,
        node distance=.5cm,
        rect/.style={rectangle, draw, thick, inner sep=5pt, minimum width=20mm, minimum height=10mm, align=center, fill=white},
        ellips/.style={circle, draw, thick, inner sep=0pt, minimum size=22mm, align=center, fill=white}]

        \node[rect] (A) at (-1, 0) {Stuff A};
        \node[rect] (B) [right= of A] {Stuff B};
        \node[rect] (C) [right= of B] {Stuff C};

        \node (DE) [right= -5mm of A]{
            \begin{tikzpicture}[scale=0.6, every node/.style={scale=0.6}]
                \node[ellips] (D) at (0,0) {As a whole};
                \node[ellips] (E) [below= 2cm of D] {we should \\ be scalable};
                \draw [draw, thick] (D.270) [] to node {} (E.90);
            \end{tikzpicture}
        };
    \end{tikzpicture}

\end{document}

Producing (after fiddling with positioning):

enter image description here

  • I tried using scope, but [scale=0.5] did nothing. [every node/.style={scale=0.5}] worked. – John Kormylo Nov 21 '15 at 6:10
  • Thanks for that answer. However, it is not suited to scale a complex figure with an arrangement of several nodes and edges. However, I used and adapted your solution with the \node (DE). Instead of the tikz code is just include the tikz picture as a pdf by using \includegraphics[scale=0.7, keepaspectratio=true]{picture.pdf}. That works splendid. – phx Nov 22 '15 at 9:29

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.