views:

128

answers:

1

I've got a latex macro that draws a picture using PGF and Tikz according to given parameters. The width of picture drawn depends on these parameters.

PGF automatically calculates the resulting width of any picture drawn so the user does not have to set it explicitly(like for example when using latex build in picture environment).

However I need to know the width of picture that will be drawn. Of cause I could calculate it as the PGF does but this is going to be quite some work(a lot of if statements...). Is there a way to ask PGF what is the width of picture that is to be drawn (some command I expect)? Either inside tikzpicture environment or just after it? Thanks for help.

+5  A: 
Antal S-Z
This is what I call great answer! Thank you. It should have come to my mind too, I've already worked with boxes... But it just did not. I wanted to query the environment instead but this is better for me. Thanks a lot!
drasto
wow, that was really helpful and interesting, @aAntal. Thanks for that!
Vivi