Math & ScienceHow to rotate a symbol

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
idioma
Posts: 1
Joined: Fri Jul 03, 2009 2:59 pm

How to rotate a symbol

Post by idioma »

Hi all,
how can I rotate the following symbols within a math environment?

\leads to (at angle 180)

\forall (upside down)

Thanks!

Ilaria

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

How to rotate a symbol

Post by localghost »

The \scalebox command from the graphicx package will do the trick. See Section 4.3 (Scaling, p. 9) of the manual.


Best regards and welcome to the board
Thorsten
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

How to rotate a symbol

Post by frabjous »

You could use the \rotatebox[origin=c]{180}{...} option from the graphics/graphicx packages to rotate something 180 degrees.

If you wanted something upside down mirror-image style, rather than only rotated 180 degrees, you might try a combination of that with reflectbox:

Code: Select all

\usepackage{graphicx}
...
\reflectbox{\rotatebox[origin=c]{180}{$\leadsto$}}
If you're going to use it in math mode, you probably want something like:

Code: Select all

\newcommand{\invertleadsto}{%
\mathrel{\reflectbox{\rotatebox[origin=c]{180}{$leadsto$}}}}
To keep it with the spacing of a relation. Actually, I find rotating it like that makes it a shade lower than I'd like it, so, I might use:

Code: Select all

\newcommand{\invertleadsto}{%
           \mathrel{\raisebox{.1em}{%
           \reflectbox{\rotatebox[origin=c]{180}{$\leadsto$}}}}}
The rotating package will also rotate text.

E.g., I personally use:

Code: Select all

\usepackage{rotating}
...
\newcommand{\invertediota}{\begin{sideways}%
     \begin{sideways}$\iota$\end{sideways}\end{sideways}}
To create an iota rotated 180 degress, which is used for definite descriptions in some logical languages. (The sideways environment turns things 90 degrees, and so one within another them turns it 180 degrees.... though the package has options for arbitrary angles as well.)

Not quite sure why you want an upside down \forall though. That would just look like the letter A, wouldn't it?

(Thornsten posted while I was writing. I don't see how a scalebox would help, but maybe I'm missing something.)
Last edited by frabjous on Fri Jul 03, 2009 9:26 pm, edited 1 time in total.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

How to rotate a symbol

Post by localghost »

frabjous wrote: [...] (Thornsten posted while I was writing. I don't see how a scalebox would help, but maybe I'm missing something.)
As demonstrated in the above mentioned section of the graphicx manual.

Code: Select all

\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{babel}
\usepackage{graphicx}
\usepackage{latexsym}


\begin{document}
  \reflectbox{$\leadsto$}

  \scalebox{1}[-1]{$\forall$}
\end{document}
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: How to rotate a symbol

Post by frabjous »

But neither of those is what idioma is looking for (if I understand right). Put some text around the second to see that it's unusable, since it's as if it reflects it with the baseline as "mirror", and hence hangs it below the regular text. I suppose you can get around that with \raisebox, but I think \rotatebox with origin=c, or the rotating package solution, is easier.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

How to rotate a symbol

Post by localghost »

Correct for the second character.

Code: Select all

\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{babel}
\usepackage{graphicx}
\usepackage{latexsym}


\begin{document}
  Text \reflectbox{$\leadsto$} Text

  Text \rotatebox[origin=c]{180}{$\forall$} Text
\end{document}
The rotating package is superfluous in this case.
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

How to rotate a symbol

Post by frabjous »

I wasn't suggesting using both packages -- one or the other.
Post Reply