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 have this shaded circle:

\shade [ball color=black!80!white] (0,0) circle (1);

Is it possible to encapsulate it with node style? Including fixing circle radius?

share|improve this question

1 Answer 1

You could define a style for nodes using \tikzstyle:

\documentclass{article} 
\usepackage{tikz}
\begin{document}
\tikzstyle{ball} = [circle,shading=ball, ball color=black!80!white,
    minimum size=1cm]
\begin{tikzpicture}
\node [style=ball] {};
\end{tikzpicture}
\end{document}

Output:

alt text

share|improve this answer
    
thanks!. Why can't I have "maximum size" as well? –  Łukasz Lew Aug 17 '10 at 17:15
    
I think TikZ doesn't support a maximum size for nodes. –  Stefan Kottwitz Aug 17 '10 at 17:17
    
You can specify text width, text height, text depth and inner sep explicitly. This will define the maximum node size. I don't think it's a good idea, though. –  Martin Heller Aug 17 '10 at 17:38
    
So how should I ensure that text will be scaled down to fit into node (instead of node scaled up) ? –  Łukasz Lew Aug 17 '10 at 18:32
    
For instance with \resizebox of the graphicx package if needed. –  Stefan Kottwitz Aug 17 '10 at 18:47

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.