3
\documentclass[a4paper]{article}
\usepackage{amsmath,amssymb}
\usepackage{mathtools}
\usepackage{amsfonts}
\begin{document}
\[\displaystyle\int\limits_{1}^{2}(x+2)^\frac{1}{2}-(x+2)^\frac{-1}{2}\;\mathrm{d}x\]
\end{document}

enter image description here

I use minus sign instead of negative sign but it looks too long. Is there an alternative symbol or anything like that?

manh3
  • 363
  • 2
    Not an answer, but I personally find ^{-\frac{1}{2}} much better – Rmano Sep 25 '22 at 11:22
  • @Rmano yes, in this case I used it. But sometimes I need a shorter -. I read 1 post about this https://tex.stackexchange.com/questions/79141/is-there-a-designated-symbol-for-the-negative-sign-in-say-16 but it seems it unusable for frac{}{} or something like that – manh3 Sep 25 '22 at 11:27
  • I, personally, don't thnk that the unary minus sign should be graphically different from its binary version. The reason why the minus sign is longer than a hyphen is that it should be as wide as a plus sign, which makes especially sense if used in a tabular context etc. I am not a mathematician, but from a typographical point of view, there should be no difference between the glyphs except from spacing which should be narrower where the minus sign is used as unary operator. – Jasper Habicht Sep 25 '22 at 12:17
  • From a ( not so) higher mathematical point of view, there’s no subtraction symbol and $a-b$ is just shorthand for $a+-b$. – egreg Sep 25 '22 at 12:22
  • 1
    You could use https://tex.stackexchange.com/a/469724/82917 – campa Sep 25 '22 at 19:38

1 Answers1

2

Not really an answer, but too long for a comment.

No, there is as far as I know no symbol for that, and there is no entry for a unary minus in the Unicode math tables. That is a bit strange, but maybe there was no real demand for it.

There was a ConTeXt user asking for the unary minus this summer. The simple implementation, to scale the minus sign (as in at least one of the answers in the question you link to in the comment) was used, and ended up in a macro \um. To get spacing right, we also added a new atom class, the unary operators.

Regarding accessibility and copying: Private unicode slots are used (there were in fact some more unary symbols added). The unary minus can nevertheless be copied from the pdf and pasted again, and then it will give the usual math minus (what else could one use?).

Below you see a few examples. As you see, the size of the minus is adapted to where it is used.

\setupbodyfont[modern]

\starttext \startTEXpage[offset=1dk] \dm{ \int_1^2 \left[(x+2)^{\frac{1}{2}} - (x+2)^{ -\frac{1}{2}}\right] \dd x }\par \dm{ \int_1^2 \left[(x+2)^{\frac{1}{2}} - (x+2)^{\frac{\um1}{2}}\right] \dd x }\par \dm{ \int_1^2 \left[(x+2)^{\frac{1}{2}} - (x+2)^{\um\frac{1}{2}}\right] \dd x }\par \dm{ a + \um a = 0} \stopTEXpage \stoptext

Some examples with the unary minus

mickep
  • 8,685
  • The differential symbol should be upright. – Bernard Sep 25 '22 at 13:25
  • Should and should, but you are right that it is in the question. One can do \setupmathematics[differentiald=upright] to get an upright differential d. – mickep Sep 25 '22 at 13:28
  • Personally, I define in the preamble \newcommand*{\dd}{\mathop{}\!\mathrm{d}}, which I found on this site a few years ago. – Bernard Sep 25 '22 at 13:50
  • Thank you, I am aware of that hack. In ConTeXt there is a differential atom class, and the spacing is controlled by spacing between different classes. – mickep Sep 25 '22 at 13:54