TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have made many figures with tikz and want to include them in a template. Unfortunately I used ex as a measure and the template I have to use redefines the font size. THis leads to wrong distances in the figures. is there a way to set the font size for all tikz figures in a document, so I do not have to adjust my figures?

share|improve this question
You could use \begin{tikzpicture}[every node/.style={font=\footnotesize}]. (Or whatever size you need.) – Count Zero Jul 3 '13 at 9:52
@CountZero: the problem is not with the text size but with mixing e.g. \draw (3,3) -- (2ex,0); (its not mixed that directly but i place some nodes at e.g. (0,0) add text above and want to draw a line above that. since I did quite a lot, I dont want to adjust the figures, I would rather to do something like renewenviornment{tikzpicture}{\setFontSizeMagically\begin{tikzpicture}}{\end{ti‌​kzpicture}} – ted Jul 3 '13 at 10:12
up vote 15 down vote accepted

You can enforce a font command at the start of each picture which would make the fontsize consistent.

\tikzset{every picture/.style={font issue=\footnotesize},
         font issue/.style={execute at begin picture={#1\selectfont}}

    \draw (0,0) -- (10ex,0);

    \draw (0,0) -- (10ex,0);

    \draw (0,0) -- (10ex,0);


enter image description here

share|improve this answer
how can I enter arbitrary values i.e. 10pt? – ted Jul 3 '13 at 11:44
Well arbitrary is not possible in TeX if the fonts do not support but I think you are aware of it, so you can use font issue={\fontsize{10}{12}} above. – percusse Jul 3 '13 at 11:51
thanks a lot, works like a charm. For thosw hwo are unaware as I was about selecting arbitrary font sizes, this awnser is a good read. – ted Jul 3 '13 at 11:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.