# Rotating text: how to avoid overlap?

Say I am faced with the following example:

\documentclass[12pt]{article}
\usepackage{rotating}

\begin{document}

Horizontal text\\\\
\begin{rotate}{50}Vertical text\end{rotate}

\end{document}


Unfortunately, this creates some nasty overlap:

What is a good way to fix this?

(As a sidenote: I'm new to the latex stack exchange, and have not figured out how to typeset the code I put in the question within the webpage to generate an image; or should I always do it manually?)

Thanks!

• Hi, welcome. There is no on-site rendering of code, you have to do it locally and add a screenshot. – Torbjørn T. Mar 1 '17 at 15:20

You really only need rotating package for sidewaystable, just use the standard \rotatebox here.

\documentclass[12pt]{article}
\usepackage{graphicx}

\begin{document}

Horizontal text\\
\rotatebox{50}{Vertical text}

\end{document}

• Thank you! Just an extra kink: if I put the rotated text in superscript of some other text, then rotating text using 'rotatebox' leaves blank space under the rotated portion, whereas 'rotate' leaves the text underneath intact (which is the desired quality). Any easy fixes? If needed should I ask this as a separate thread? – Jeffery Mar 2 '17 at 6:17
• @Jeffery probably you should ask a new question as I'm not sure what you mean. What you describe sounds like the same issue as you show here. the rotate environment is a very thin wrapper around \rotatebox that puts the result in a zero sized box so it over-prints surrounding text. So it overprints as you show here and being zero sized doesn't have much effect on surrounding elements in math. – David Carlisle Mar 2 '17 at 7:47

From the documentation of the rotating package:

• rotate prints the contents turned through an arbitrary angle but does not leave any space for the result.

Use instead the turn environment:

• turn prints the contents turned through an arbitrary angle.

\documentclass[12pt]{article}
\usepackage{rotating}
\begin{document}
\noindent
Horizontal text\\
\begin{turn}{50}Vertical text\end{turn}
\end{document}

\documentclass[12pt]{article}
\usepackage{rotating}

\begin{document}

Horizontal text

\vspace{3cm}

\begin{rotate}{30}Vertical text\end{rotate}

\end{document}}


Add \vspace to separate the two.