2

using xelatex I tried this:

\usepackage{graphicx}
\newcommand{\Vol}{\rotatebox[origin=c]{180}{\ensuremath{A}}}

\begin{document}
\Vol
\end{document}

I know there is \forall but that's obviously not the answer. But the problem is when I try to do this:

\documentclass{article}
\usepackage{graphicx}
\usepackage{commath}
\usepackage{amsmath}
\newcommand{\Vol}{\rotatebox[origin=c]{180}{\ensuremath{A}}}
\begin{document}
$E_v=-\frac{\dif p}{\frac{\dif \Vol}{\Vol}}$
\end{document}

differential operator and volume get different size:

   differential operator and volume get different size.

Mensch
  • 65,388
rededarsho
  • 31
  • 2

2 Answers2

3

The following solution is based on \mathpalette that allows the detection of the current math style:

\documentclass{article}
\usepackage{graphicx}
\usepackage{commath}
\usepackage{amsmath}

\makeatletter
\newcommand{\Vol}{%
  \mathpalette\@Vol{}%
}
\newcommand*{\@Vol}[2]{%
  % #1: math style
  % #2: unused
  \rotatebox[origin=c]{180}{$\m@th#1A$}%
}
\makeatother

\begin{document}
$E_v=-\frac{\dif p}{\frac{\dif \Vol}{\Vol}}$
\end{document}

Result

The following variant uses \text from package amsmath or amstext:

\documentclass{article}
\usepackage{graphicx}
\usepackage{commath}
\usepackage{amsmath}

\makeatletter
\newcommand{\Vol}{%
  \text{\rotatebox[origin=c]{180}{$\m@th A$}}
}
\makeatother

\begin{document}
$E_v=-\frac{\dif p}{\frac{\dif \Vol}{\Vol}}$
\end{document}

In both cases, \m@th ensures that \mathsurround is zero to avoid additional space around the math symbol, when math is set in the text box.

Heiko Oberdiek
  • 271,626
2

A variant of Heiko’s solution, mainly to warn about not using commath; see

for some examples why.

I also add \newunicodechar so you can input the character directly.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{newunicodechar}
\usepackage{amsmath}
\usepackage{graphicx}

\makeatletter
\DeclareRobustCommand{\reverseletter}[1]{\mathpalette\reverse@letter{#1}}
\newcommand{\reverse@letter}[2]{%
  \rotatebox[origin=c]{180}{$\m@th#1#2$}%
}
\makeatother

\newcommand{\Vol}{\reverseletter{A}}
\newunicodechar{Ɐ}{\Vol}

\newcommand{\dif}{\mathop{}\!\mathrm{d}} % much better than commath's

\begin{document}

$E_v=-\frac{\dif p}{\frac{\dif \Vol}{\Vol}}$

$E_v=-\frac{\dif p}{\frac{\dif Ɐ}{Ɐ}}$

\end{document}

enter image description here

egreg
  • 1,121,712