I wanted to rotate $\Box$ $45^\circ$ clockwise to make a diamond. At the time, I did not know there was a diamond command $\diamond$ and $\Diamond$ and $\diamondsuit$ and even things like $\not\diamondsuit$. But I then wondered to myself, is there a command to rotate symbols? For instance, say I had the letter $\Psi$. I can rotate this, only $180^\circ$ but not with some fancy rotating command. Simply, I use \pitchfork and this generates $\pitchfork$. A bit like a flip. I can also flip curved lines. For instance, take the curve $\frown$. I can flip it $180^\circ$ but with an entirely seperate command, \smile to generate $\smile$.

The examples that I mentioned however, are only certain examples where I can flip them. For example, I can flip arrows. $\downarrow$ $\leftarrow$ $\uparrow$ $\rightarrow$ $\wedge$ $>$ $\lor$ $<$, but none of these uses a rotating command; only directions. But say I want to flip the curve $\smile$ only $90^\circ$. Then how would I do that? I can write the command, \between but this generates $\between$ which is both curves flipped $90^\circ$, not one. I would simply have to use brackets $()$. And if I wanted to rotate a symbol like $\gtrless$ then what command do I use now? I would have to use two commands to generate $\land\lor$ and $\lor\land$ but I won't be able to flip $\gtrless$ sideways.

Essentially, I am asking if there is some kind of rotating command, and if not, is it ok to feature some kind of command like that?

Thank you in advance.

  • 1
    see my comments on the answer below. – Davide Cervone Jan 28 at 14:04
up vote 6 down vote accepted

This is possible using the HTML extension

$$\require{HTML} \style{display: inline-block; transform: rotate(45deg)}{\Box}$$

$$\require{HTML}\style{display: inline-block; transform: rotate(45deg)}{\Box}$$

  • How did you...? Anyway, congratulations!! $$(+1) \ \ \color{green}{\checkmark}$$ Oh, and thank you very much!! How could I forget? :) – user477343 Jan 28 at 1:48
  • @user477343 I knew this could be accomplished in $\mathrm{\LaTeX}$ using \rotatebox so that was the first thing I looked for in the documentation. Since that wasn't there, my next thought was that this could be done with CSS. When I looked through the MathJax extensions, I found the HTML extension and all that was left to do is see if I could use it on StackExchange. – Trevor Gunn Jan 28 at 1:55
  • Thank you very much though! It feels like I can write anything I want on SE :) – user477343 Jan 28 at 2:18
  • 3
    Note that CSS transforms don't affect the bounding box of the content, so if you have a short width character, its bounding box will not become a tall this character. E.g., $\bbox[red]{\style{display:inline-block; transform:rotate(90deg)}{\longrightarrow}}\Rule{0px}{1em}{.25em}$. This has implications when the rotated character is used between two others. – Davide Cervone Jan 28 at 12:29
  • It also means that in HTML-CSS output, which is clipped to the bounding box, part of the character might be clipped: $\bbox[red]{\style{display:inline-block; transform:rotate(90deg)}{\longrightarrow}}$ (I added spacing above to prevent that, though it only affects HTML-CSS output, not CommonHTML output). – Davide Cervone Jan 28 at 12:30
  • This technique only works for HTML-CSS, CommonHTML, and NativeMML output (in particular, not for SVG output), so some users (those who have selected SVG output) will not see what you expect them to. – Davide Cervone Jan 28 at 12:32
  • 2
    Note that this only affects the visual representation, so users with assistive technology (like screen readers) will get the wrong output. E.g., in the arrow example above, they will be told it is a right arrow, not a down arrow. So while such hacks are possible, they are not recommended if you are interested in supporting all your readers. – Davide Cervone Jan 28 at 12:34
  • 3
    Finally, note that the HTML extension is loaded automatically when needed, so there is no need for the explicit \require{HTML}. – Davide Cervone Jan 28 at 12:35
  • @DavideCervone thank you very much for that! :) – user477343 Feb 1 at 4:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .