How to increase the font size of one node label in tikz

StatsSorceress picture StatsSorceress · Oct 11, 2017 · Viewed 16.7k times · Source

I have a tikz picture:

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning, shapes, shadows, arrows}
\begin{document}
\thispagestyle{empty}
\tikzstyle{abstract}=[circle, draw=black, fill=white]
\tikzstyle{labelnode}=[circle, draw=white, fill=white]
\tikzstyle{line} = [draw, -latex']

\begin{tikzpicture}[
    every node/.style={line width=2mm, circle split, draw, minimum size=5cm}
    ]
    \node (output) [thick, font=\fontsize{60}{60}\selectfont, thick] {$y_{(out)}$ \nodepart{lower} $y_{(in)}$};
    \node (hidden) [thick, font=\fontsize{60}{60}\selectfont, below=1cm of output] {$h_{(out)}$ \nodepart{lower} $h_{(in)}$};
    \node (input) [thick, font=\fontsize{60}{60}\selectfont, below=1cm of output, abstract, below=of hidden] {$x$};
\draw[line width=1mm, ->] (input) -- (hidden) node[font=\fontsize{60}{60}\selectfont, below=of output, labelnode, midway, right=2cm] {$W_1\, {\rm{, }} \,b_1$};
\draw[line width=1mm, ->] (hidden) -- (output) node[font=\fontsize{60}{60}\selectfont, below=of output, labelnode, midway, right=2cm] {$W_2 \, {\rm{, }} \,b_2$};

\end{tikzpicture}


\end{document}

enter image description here

I would like to increase the font size of "x" in the bottom node. For some reason, altering the values in font=\fontsize{60}{60} does nothing (increasing or decreasing made no difference in the size). Any idea how I can make the x take up more area inside the node?

Answer

StatsSorceress picture StatsSorceress · Oct 11, 2017

I found the answer here, and used the lmodern package.

\documentclass{standalone}
\usepackage{tikz}
\usepackage{lmodern}
\usetikzlibrary{positioning, shapes, shadows, arrows}

\begin{document}
\thispagestyle{empty}
\tikzstyle{abstract}=[circle, draw=black, fill=white]
\tikzstyle{labelnode}=[circle, draw=white, fill=white]
\tikzstyle{line} = [draw, -latex']

\begin{tikzpicture}[
    every node/.style={line width=2mm, circle split, draw, minimum size=5cm}
    ]
    \node (output) [thick, font=\fontsize{60}{0}\selectfont, thick] {$y_{(out)}$ \nodepart{lower} $y_{(in)}$};
    \node (hidden) [thick, font=\fontsize{60}{0}\selectfont, below=1cm of output] {$h_{(out)}$ \nodepart{lower} $h_{(in)}$};
    \node (input) [thick, font=\fontsize{80}{0}\selectfont, below=1cm of output, abstract, below=of hidden] {$x$};
\draw[line width=1mm, ->] (input) -- (hidden) node[font=\fontsize{60}{0}\selectfont, below=of output, labelnode, midway, right=3cm] {$W_1\, {\rm{, }} \,b_1$};
\draw[line width=1mm, ->] (hidden) -- (output) node[font=\fontsize{60}{0}\selectfont, below=of output, labelnode, midway, right=3cm] {$W_2 \, {\rm{, }} \,b_2$};

\end{tikzpicture}


\end{document}

enter image description here