3

I searched a bit on the internet, but I could not find any answer. Studying quantum field theory and Dirac equation I had to write this symbol $\overset{\leftarrow}{\partial}$, but the problem is that there is so much vertical space between the arrow and the derivative symbol, so much that I cannot insert the whole of it in the middle of an argument, because it ruins the spacing between lines. I looked in physics,amsmath and other packages, but I cannot find any implementation of this symbol, so I'm asking myself if there is any somewhere, or at least how can I solve the vertical spacing problem (should I define a new symbol by myself?). Thanks

Rob Tan
  • 263
  • 2
    Couldn't \vec{\partial} be used? – Bernard Sep 14 '20 at 09:49
  • I'm exactly looking for something like this, but with the arrow pointing left! – Rob Tan Sep 14 '20 at 09:50
  • Oops! I didn't notice \LEFTarrow. – Bernard Sep 14 '20 at 09:53
  • Maybe I found a temporary solution thanks to you! With the '\vec' suggestion I checked this https://tex.stackexchange.com/questions/15010/vecx-but-with-arrow-from-right-to-left and found the answer from egreg very useful (following instead the first answer the arrow was misaligned to the symbol). I still wait anyway if someone has a complete answer, but for the moment I can work with this, so thanks for the suggestion! – Rob Tan Sep 14 '20 at 09:55

3 Answers3

5

You can remove the vertical space between the (smaller) arrow and the \partial symbol.

This only works for text size, so not in subscripts or superscripts: if needed it can be made to work also in those cases.

\documentclass{article}
\usepackage{amsmath}

\usepackage{lipsum}

\newcommand{\qftder}{% \mathord{% \vbox{\offinterlineskip \ialign{\hfil##\cr$\scriptscriptstyle\leftarrow$\cr$\partial$\cr} }% }% }

\begin{document}

\lipsum*[1][1-3] $\qftder$ \lipsum[2][1-3]

\end{document}

image

egreg
  • 1,121,712
  • That's great! Thanks a lot egreg. I didn't understand the phrase "This only works for text size, so not in subscripts or superscripts", what do you mean with this? – Rob Tan Sep 14 '20 at 10:16
  • And also another question: in your answer that I cited in the link, you define a '\cev' command that seems to be quite universal, while in this case you are defining a specific "object" that is '\qftder', am I right? Sorry for the dumbness I just want to understand the way code works – Rob Tan Sep 14 '20 at 10:18
  • @Rob I hope you don't have \frac{\qftder X}{2} inside normal text or X_{\qftder Y}. – egreg Sep 14 '20 at 10:18
  • @Rob You're better in searching than I. ;-) I remembered something like that and possibly \cev is what you need. – egreg Sep 14 '20 at 10:20
  • Sure I cannot put '\qftder' inside normal text because seems to work in just math mode, is that what are you saying? Both '\qftder' and '\cev' are very good, I will try both in the time and I'll choose. :) – Rob Tan Sep 14 '20 at 10:23
  • 1
    @Rob I meant something like text $\frac{\qftder X}{2}$ other text – egreg Sep 14 '20 at 10:27
  • @egreeg Yes I tried it and I get what you mean! Yes, but I don't normally use '\frac' command inside text because I don't like the way it seems: I would use instead '$\qftder X/2$ so no problem for that, thanks again! – Rob Tan Sep 14 '20 at 10:31
4

You have a recent dedicated package: letterswitharrows .

\documentclass{article}
\usepackage{amssymb}
\usepackage{letterswitharrows}

\begin{document} [ \arrowoverset*\partial ]%

\end{document}

enter image description here

Bernard
  • 271,350
  • That's great too thanks! – Rob Tan Sep 14 '20 at 10:19
  • Just a curiosity, if you know: why in your opinion is this not implemented in 'physics' package? In quantum field theory these kind of symbols seem to be used a lot! – Rob Tan Sep 14 '20 at 10:27
  • 1
    Sorry, I'm only a mathematician and I have no idea. This package, it seems, fills a gap. – Bernard Sep 14 '20 at 10:34
  • Okay just if you knew. Thanks, I will try the package! – Rob Tan Sep 14 '20 at 10:35
  • Note the position of the arrow takes into account the italic angle of the symbol. – Bernard Sep 14 '20 at 10:37
  • So fundamentally the commands in the package don't generate alignment problem, is that what you mean? – Rob Tan Sep 14 '20 at 10:38
  • I didn't test it really, but what I mean is that it may happen an over arrow or an over line be positioned as though it was over a character in upshape, so we have to compensate with math kerning – Bernard Sep 14 '20 at 10:49
  • So the arrow or the line are positioned like there is a character that is lined up with the vertical of the page ('upshape' command?) and to adjust it for tilded signs a kerning (this kerning? https://en.wikipedia.org/wiki/Kerning) was used. My knowledge is very basic sorry. Anyway if that was what you meant, the example in your figure is very clear; the arrow seems to be perfectly aligned with the '\partial' symbol, so yes, it was a good work :) – Rob Tan Sep 14 '20 at 11:07
  • Yes, it is as though the bounding box of the glyph were a parallelogram instead of a rectangle, if you see what I mean. The problem may happen in particular with the \widebar command (which has a solution on this site). – Bernard Sep 14 '20 at 11:11
  • Oh yes. Sometimes this happens with '\hat' or 'bar' or similar commands – Rob Tan Sep 14 '20 at 11:54
1

There is also another alternative using a rare package named halloweenmath with the command \overscriptleftarrow{...}.

\documentclass[a4paper,12pt]{article}
\usepackage{halloweenmath}
\begin{document}
Today is not halloween :-) $\overscriptleftarrow{\partial}$!
\end{document}

enter image description here

Sebastiano
  • 54,118