Site icon texblog

Rotate an image, table or paragraph in LaTeX

The rotating package provides easy-to-use functionality to rotate content. The float environments sidewaystable and sidewaysfigure introduce landscape tables and figures, respectively. The package automatically takes care of the rotation direction for twoside documents. Besides 90 degrees rotation, the package also provides a command and environment to rotate content at an arbitrary angle.

 

Sidewaysfigure example

The easiest way to take full advantage of the page and position a figure (or table) in landscape-form is through the rotating package.

\documentclass[11pt]{article}
\usepackage{rotating, graphicx}
\begin{document}
\begin{sidewaysfigure}
\includegraphics[width=\textwidth]{capsules}
\caption{Result of a long day  at work.}
\end{sidewaysfigure}
\end{document}

I manually rotated the page to better fit here. Sidewaysfigure will place the figure on a separate page, as will sidewaystable.

 

Arbitrary angle text example

The command turn allows rotation at an arbitrary angle in degrees. Here is a rather useless example, but you get the idea:

\documentclass[11pt]{article}
\usepackage{blindtext, rotating}
\begin{document}
\begin{turn}{45}
\begin{minipage}{\linewidth}
\blindtext
\end{minipage}
\end{turn}
\blindtext
\end{document}

I use the minipage environment to limit the text horizontally. Otherwise, the entire paragraph is printed on a single line. The picture below is a snapshot of the output.

 
Did you come across an awesome package or would like me to write about a particular topic? Get in touch.

Exit mobile version