4

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:

enter image description here

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!

  • 1
    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
1

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

enter image description 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
1

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.

enter image description here

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.