8

In my textbook, the Hodge star operator is represented as an asterisk character with the same spacing as in the following image:

enter image description here

But when I use the * character in the obvious way:

\[
\ast d \ast \phi = \frac{\partial A}{\partial x}
\]

It ends up with spacing like an infix operator: enter image description here

How do I get rid of the extraneous space between *, d and \phi?

2 Answers2

6

You can define

\newcommand{\hodge}{{\star}}

or * if you prefer an asterisk. The additional braces will hide the nature of either \star or * as binary operation symbols.

\documentclass{article}
\usepackage{amsmath} % not needed here, but...

\newcommand{\hodge}{{\star}}

\begin{document}

[ \hodge d \hodge \phi = \frac{\partial A}{\partial x} ]

\end{document}

enter image description here

If you replace \star with * like in

\newcommand{\hodge}{{*}}

you get

enter image description here

egreg
  • 1,121,712
3

An alternative is to use a newcommand putting \mathord\star or \mathord\ast without the curly brackets {}, where you can see that you have the same result of @egreg's answer.

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\newcommand{\starr}{\mathord\star}
\newcommand{\astt}{\mathord\ast}
\begin{document}

[ \starr d \starr \phi = \frac{\partial A}{\partial x} ] [ \astt d \astt\phi = \frac{\partial A}{\partial x} ] \end{document}

enter image description here

PS: A \mathord object is kind of neutral to its left and right neighbours where an unary operator binds stronger to its right neighbour than to its left one (expressed be different spacing and potential break points). Difference between \mathop and \mathord

Sebastiano
  • 54,118
  • 1
    You seem to active again, did you finish your project? – Dr. Manuel Kuehner Feb 05 '22 at 21:33
  • 1
    @Dr.ManuelKuehner Dearest I am taking a break. I have changed pc's, to a more powerful one which I am slowly getting used to. My project is finished; I'm waiting for a publishing house to seriously consider my work and for my professor to decide sooner or later to correct the book. I hope so, but the current strength of my health is not optimal. – Sebastiano Feb 05 '22 at 21:37