如何在tikz中增加一个节点标签的字体大小

时间:2017-10-10 23:02:08

标签: tikz

我有一张tikz图片:

\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

我想在底部节点中增加“x”的字体大小。出于某种原因,更改font=\fontsize{60}{60}中的值不会做任何事情(增加或减少大小没有差异)。知道如何让x在节点内占据更多区域吗?

1 个答案:

答案 0 :(得分:5)

我找到了答案here,并使用了lmodern包。

\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

相关问题