Hi guys,
I was wondering if there is a way to fit a text into a box (or something else) by automatically reducing or increasing the font size. For instance, I specify a 2inx2in box and the text I want in it; and the font size that best fits the box is automatically selected.
Thanks,
Efo
Page Layout ⇒ autosize fonts
NEW: TikZ book now 40% off at Amazon.com for a short time.

autosize fonts
You could try \resizebox from the graphicx package. See its documentation, page 7:
This will give "Some text" which is exactly 1 inch long. The ! for the second argument means to vary the height by whatever it needs to in order to maintain the aspect ratio. If you did {!}{1in} it would be 1 inch tall instead. If you specify both parameters, it'll be stretched disproportionally so that it is exactly a rectangle of that size, and so on.
Code: Select all
\resizebox{1in}{!}{Some text}