Take the 2-minute tour ×
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.

I am trying to scale the font in a tikz picture using the scalefnt (compare this question) package. However for tkz obejects it doesn't work, for example:

\documentclass{minimal}
\usepackage{scalefnt}
\usepackage{tkz-euclide}

\begin{document}

{\scalefont{2}
\begin{tikzpicture}
   \path (2,0)  node{works};
   \tkzDefPoint(0,0){A}
   \tkzDrawPoint(A)
   \tkzLabelPoint(A){test}
\end{tikzpicture}
}
\end{document}

Any ideas how to fix this?enter image description here

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Looking at the file tkz-obj-points.tex you find that the style for the label of points is set using

\tikzset{label style/.style=\tkz@euc@pointpos,\tkz@euc@labelcolor,font=\normalsize}}

so you can change the font= key from \normalsize to the desired font:

\documentclass{article}
\usepackage{scalefnt}
\usepackage{tkz-euclide}

\makeatletter
\tikzset{label style/.style={\tkz@euc@pointpos,\tkz@euc@labelcolor,font=\scalefont{2}}}
\makeatother

\begin{document}

\begin{tikzpicture}[every node/.style={font=\scalefont{2}}]
   \path (2,0)  node{ works};
   \tkzDefPoint(0,0){A}
   \tkzDrawPoint(A)
   \tkzLabelPoint(A){test}
\end{tikzpicture}

\end{document}

I would suggest to make the change in the font size using every node/.style, as I did in my example code.

enter image description here

share|improve this answer
    
@Altermundus: now that I see how you set the font in label style/.style, wouldn't it be better to use something like font=\tkz@euc@labelfont, with a convenient initial value, instead of a fixed font=\normalfont? –  Gonzalo Medina Jun 25 '11 at 23:10
    
Yes I can look at this request but the idea is to use the same font with the same size in the document and in the picture. The size of font was not my first priority ! :) –  Alain Matthes Jun 26 '11 at 5:10

Your Answer

 
discard

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.