3

I would like to set the size of the "plus" circle smaller. I have tried with minimum size and with radius but nothing changes. Here the minimal document:

\documentclass{beamer}

\usepackage{tikz}
\usetikzlibrary{arrows,positioning} 
\tikzset{
    %Define standard arrow tip
    >=stealth',
    %Define style for boxes
    punkt/.style={
           rectangle,
           rounded corners,
           draw=black, very thick,
           text width=6.5em,
           minimum height=2em,
           text centered},
    % Define arrow style
    pil/.style={
           ->,
           thick,
           shorten <=2pt,
           shorten >=2pt}
}

\begin{document}
\begin{frame}
\begin{tikzpicture}[node distance=1cm, auto,]
 nodes
 \node[punkt] (boosting) {Boosting};
 \node[right=of boosting] (dummy) {};
 \node[punkt, right=of dummy, minimum size=0.1cm] (fqi) {Fitted Q-Iteration};
 \node[punkt, circle,minimum size=0.1cm, below=of dummy] (plus) {$+$};
 \node[punkt, below=of plus] (bfqi) {Boosted Fitted Q-Iteration};

\end{tikzpicture}
\end{frame}
\end{document}

As a plus I also would like to understand how to "fqi" and "bfqi" boxes the same height of "boosting" node (without breaking in two lines).

Sam
  • 277
  • Thanks for your suggestion. It changes but not enough, the circle remains huge. – Sam May 31 '17 at 08:50

2 Answers2

2

Your punkt style includes text width=6.5em, and that is what makes the circle so large. Add e.g. text width=1em after punkt in the options of that node to override the punkt style.

enter image description here

\documentclass{beamer}    
\usepackage{tikz}
\usetikzlibrary{arrows,positioning} 
\tikzset{
    %Define standard arrow tip
    >=stealth',
    %Define style for boxes
    punkt/.style={
           rectangle,
           rounded corners,
           draw=black, very thick,
           text width=6.5em,
           minimum height=2em,
           text centered},
    % Define arrow style
    pil/.style={
           ->,
           thick,
           shorten <=2pt,
           shorten >=2pt}
}

\begin{document}
\begin{frame}
\begin{tikzpicture}[node distance=1cm, auto,]
 nodes
 \node[punkt] (boosting) {Boosting};
 \node[right=of boosting] (dummy) {};
 \node[punkt, right=of dummy, minimum size=0.1cm] (fqi) {Fitted Q-Iteration};
 \node[punkt, circle, text width=1em, below=of dummy] (plus) {$+$};
 \node[punkt, below=of plus] (bfqi) {Boosted Fitted Q-Iteration};

\end{tikzpicture}
\end{frame}
\end{document}
Torbjørn T.
  • 206,688
2

In addition to Torbjørn T.'s answer, with inner sep=... you can choose the distance from the text to the border of the node.

For not breaking the lines inside the node, set text width=... large enough to contain all the text (but doing so your image is too close to the right border).

\documentclass{beamer}

\usepackage{tikz}
\usetikzlibrary{arrows,positioning} 
\tikzset{
    %Define standard arrow tip
    >=stealth',
    %Define style for boxes
    punkt/.style={
        rectangle,
        rounded corners,
        draw=black, very thick,
        text width=11.5em,
        minimum height=2em,
        text centered},
    % Define arrow style
    pil/.style={
        ->,
        thick,
        shorten <=2pt,
        shorten >=2pt}
}

\begin{document}
    \begin{frame}
    \begin{tikzpicture}[node distance=1cm, auto,]
    nodes
    \node[punkt] (boosting) {Boosting};
    \node[right=of boosting] (dummy) {};
    \node[punkt, right=of dummy] (fqi) {Fitted Q-Iteration};
    \node[draw, circle,  inner sep=2pt, below=of dummy] (plus) {$+$};
    \node[punkt, below=of plus] (bfqi) {Boosted Fitted Q-Iteration};

    \end{tikzpicture}
\end{frame}
\end{document}
CarLaTeX
  • 62,716