Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'd like to rotate a letter such as, say B, to show its reflection or inversion symmetry, or even at an arbitrary angle clockwise or counter-clockwise. Is this possible using commands without drawing a picture? Can I use \usepackage{rotating} out of a table? I used the code \begin{rotate}{180}B\end{rotate}. That puts B rotated as a subscript to the line. Any idea how to make it in-line aligned with other charcters?

share|improve this question
1  
Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count. This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). The same applies to your question tex.stackexchange.com/questions/30925/…. –  doncherry Oct 22 '11 at 12:47
add comment

3 Answers

With the graphicx package, you can do it as follows: \rotatebox[origin=c]{180}{B}

This rotates around the center of the letter. You can also rotate around other points: \rotatebox[origin=tr]{180}{B} will rotate around the top right of the box. See page 8 of this document for all the relevant options.

Following from what egreg pointed out, you may need a \raisebox to have the resulting this sit on the baseline:

\documentclass{scrartcl}
\usepackage{graphicx}
\newcommand\testletter[1]{
  \begin{tabular}{rl}
    Rotate: & #1\rotatebox{180}{#1}\hspace{-1em}\rule{1em}{0.5pt}\\
    Rotate and raise: & #1\raisebox{\depth}{\rotatebox{180}{#1}}\hspace{-1em}\rule{1em}{0.5pt} \\
    Rotate around centre: & #1\rotatebox[origin=c]{180}{#1}\hspace{-1em}\rule{1em}{0.5pt} \\
    Rotate around centre and raise: & #1\raisebox{\depth}{\rotatebox[origin=c]{180}{#1}}\hspace{-1em}\rule{1em}{0.5pt} \\
    Rotate (120): & #1\rotatebox{120}{#1}\hspace{-1em}\rule{1em}{0.5pt} \\
    Rotate (120) around centre: & #1\rotatebox[origin=c]{120}{#1}\hspace{-1em}\rule{1em}{0.5pt} \\
    Rotate (120) and raise: & #1\raisebox{\depth}{\rotatebox{120}{#1}}\hspace{-1em}\rule{1em}{0.5pt} \\
    Rotate (120) around centre and raise: & #1\raisebox{\depth}{\rotatebox[origin=c]{120}{#1}}\hspace{-1em}\rule{1em}{0.5pt}
  \end{tabular}
}
\begin{document}
\testletter{B}

\testletter{g}

\testletter{f}
\end{document}

The rule is just to show where the baseline is.

differences again

As you can see, the raisebox only makes a difference for letters with descenders (g,y,j etc). And which one you prefer is a matter of taste. (Also, doing both rotate about centre and raise seems otiose. Doing one or the other suffices, depending on which result you want...

share|improve this answer
add comment

If you need also a reflection, use \reflectbox{B}; you might need also \raisebox when rotating the letter with \rotatebox, for example

\raisebox{\depth}{\rotatebox[origin=c]{120}{B}}

will make the rotated "B" sit on the baseline. There are differences between the three calls

B\rotatebox{120}{B}B
B\rotatebox[origin=c]{120}{B}B
B\raisebox{\depth}{\rotatebox[origin=c]{120}{B}}B

Choose the one that suits you better. The \depth can be multiplied by a factor; you can use also \height and \totalheight as is customary for LaTeX boxes.

share|improve this answer
3  
There is also \reflectbox{...} which is short for \scalebox{-1}[1]{...}. –  Martin Scharrer May 13 '11 at 14:33
    
Your raisebox does nothing. However, using your raisebox and not specifying an origin gives you identical output to my answer –  Seamus May 13 '11 at 14:45
    
I take it back, there is a slight difference for letters with descenders. It's not obvious with capitals... –  Seamus May 13 '11 at 14:48
    
Rotating around centre inside a raisebox seems to be exactly the same as rotating inside a raisebox without specifying an origin... –  Seamus May 13 '11 at 15:10
1  
Martin, I appreciate if in citing code always mentioning the related usepackage for clarity. I found the linked Warwick document helpful. Thank you. –  Peter Jones May 15 '11 at 7:13
add comment

with package rotating or graphicx

B\rotatebox[origin=c]{180}{B}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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