Font size modified by scale option in TikZ

Is it possible to apply a uniform font size to all tikz figures in a document, eliminating the need to adjust each figure individually? To accomplish this, refrain from altering the font size within the figures themselves and utilize the following approach. Note that this method will not work if you utilize commands such as “fontsize”.

Question:

Initially, I imported my
TikZ figures
with

input


and set the documentclass to 10pt. However, I’m facing an issue now that I want to change the documentclass to 11pt. The problem is that the nodes are now appearing bigger due to the change in font size, which is causing distortion in the document.

I want to know how to change the fontclass in TikZ to 10pt. This will ensure that the normalfont in my figures matches my original design, instead of being 11pt like the document.


Solution:

Altering the font size in your pictures can be a straightforward task if you follow these steps.

documentclass[11pt]{article}
usepackage{tikz}
tikzset{
  font={fontsize{10pt}{12}selectfont}}
begin{document}
  This is some text.
  begin{tikzpicture}
    node {This is a node.};
  end{tikzpicture}
  This is some text.
end{document}

size switch

It is clear that using codes such as

small


in images can result in more complexity.

Frequently Asked Questions