Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

tikz

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?

like image 599
StatsSorceress Avatar asked Oct 10 '17 23:10

StatsSorceress


People also ask

What is node in TikZ?

In the present section, the usage of nodes in TikZ is explained. A node is typically a rectangle or circle or another simple shape with some text on it. Nodes are added to paths using the special path operation node. Nodes are not part of the path itself.


1 Answers

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

like image 190
StatsSorceress Avatar answered Oct 22 '22 20:10

StatsSorceress