About
Shop
LaTeX
Software
Books
Gallery
News
Contact
Blog
Settings
Account


6.1 Graphical Transformations

The graphicx package also provides commands to rotate, resize, reflect and scale text. They are as follows:

\rotatebox[<option list>]{<angle>}{<text>}

Rotates <text> by <angle> (degrees anti-clockwise by default). The optional argument <option list> is a comma-separated list of any of the following options:

Example:

base line
\rotatebox{45}{Some text}
\rotatebox[units=-360]{45}{Some text}
\rotatebox[units=-360,origin=rB]{45}{Some text}
\rotatebox[x=3em,y=3em]{45}{Some text}
base line

Image of typeset output: each occurrence of 'Some text' has been rotated

\scalebox{<h scale>}[<v scale>]{<text>}

Scales <text> by <h scale> in both directions if <v scale> omitted, otherwise scales <text> by <h scale> horizontally and <y scale> vertically.

Example:

\scalebox{0.8}{Some text}

Some text (scaled by a factor of 0.8)

Compare with:

\scalebox{0.8}[1.2]{Some text}

Some text (aspect ratio changed)

\reflectbox{<text>}

Reflects <text> (equivalent to \scalebox{-1}[1]{<text>}).

Example:

\reflectbox{Some text}

Some text (mirror image)

\resizebox{<h length>}{<v length>}{<text>}

Scales <text> so that it is <h length> wide and <v length> high. To preserve the aspect ratio, use ! instead of one of the dimensions.

Example:

\resizebox{12mm}{1cm}{Some text}
\resizebox{!}{1cm}{Some text}

Image of typeset output: two instances of 'Some text' scaled with and without changing the aspect ratio.


This book is also available as A4 PDF or 12.8cm x 9.6cm PDF or paperback (ISBN 978-1-909440-00-5).

© 2012 Dickimaw Books. "Dickimaw", "Dickimaw Books" and the Dickimaw parrot logo are trademarks. The Dickimaw parrot was painted by Magdalene Pritchett.

Terms of Use Privacy Policy Cookies Site Map FAQs