\rotatebox
Synopsis if you use the graphics package:
\rotatebox{angle}{material}
Synopses if you use the graphicx package:
\rotatebox{angle}{material} \rotatebox[key-value list]{angle}{material}
Put material in a box and rotate it angle degrees counterclockwise.
This example rotates the table column heads forty-five degrees.
\begin{tabular}{ll} \rotatebox{45}{Character} &\rotatebox{45}{NATO phonetic} \\ A &AL-FAH \\ B &BRAH-VOH \end{tabular}
The material can be anything that goes in a box, including a graphic.
\rotatebox[origin=c]{45}{\includegraphics[width=1in]{lion}}
To place the rotated material, the first step is that LaTeX sets material in a box, with a reference point on the left baseline. The second step is the rotation, by default about the reference point. The third step is that LaTeX computes a box to bound the rotated material. Fourth, LaTeX moves this box horizontally so that the left edge of this new bounding box coincides with the left edge of the box from the first step (they need not coincide vertically). This new bounding box, in its new position, is what LaTeX uses as the box when typesetting this material.
If you use the graphics package then the rotation is about the reference point of the box. If you use the graphicx package then these are the options that can go in the key-value list, but note that you can get the same effect without needing this package, except for the x
and y
options (see \includegraphics).
origin
-
The point of the material’s box about which the rotation happens. Possible value is any string containing one or two of:
l
for left,r
for right,b
for bottom,c
for center,t
for top, andB
for baseline. Thus, the first line here\rotatebox[origin=c]{180}{moon} \rotatebox[origin=lB]{180}{LeBateau}
will turn the picture upside down from the center while the second will turn its picture upside down about its left baseline. (The character
c
gives the horizontal center inbc
ortc
but gives the vertical center inlc
orrc
, and gives both inc
.) The default islB
. x, y
-
Specify an arbitrary point of rotation with
\rotatebox[x=TeX dimension,y=TeX dimension]{...}
(see Units of length). These give the offset from the box’s reference point. units
-
This key allows you to change the default of degrees counterclockwise. Setting
units=-360
changes the direction to degrees clockwise and settingunits=6.283185
changes to radians counterclockwise.
© 2007–2018 Karl Berry
Public Domain Software
http://latexref.xyz/_005crotatebox.html