As the title suggests, how do I draw a $\partial$
with a diagonal line through it?
5 Answers
Like this?
\documentclass{article}
\usepackage{slashed}
\begin{document}
$\partial\kern-0.5em\raise0.22ex\hbox{/}$ or $\slashed{\partial}$
\end{document}
-
1As one working in qft this is the one I prefer due to its simplicity Nov 10, 2015 at 5:32
A variation of \centernot
(the slash needs to be raised a bit):
\documentclass{article}
\newcommand{\npartial}{{%
\mathpalette\raisenot\partial
}}
\makeatletter
\newcommand{\raisenot}[2]{%
\raise.4\fontdimen22
\ifx#1\displaystyle
\textfont2
\else
\ifx#1\textstyle
\textfont2
\else
\ifx#1\scriptstyle
\scriptfont2
\else
\scriptscriptfont2
\fi
\fi
\fi
\rlap{%
\settowidth\dimen@{$\m@th#1{#2}$}%
\kern.5\dimen@
\settowidth\dimen@{$\m@th#1=$}%
\kern-.5\dimen@
$\m@th#1\not$%
}%
{#2}%
}
\makeatother
\begin{document}
\[
\npartial A_{\npartial_{\npartial}}
\]
\end{document}
The cancel package provides a way of cancelling symbols (see the cancel tag)
\documentclass{article}
\usepackage{cancel}
\begin{document}
$\cancel\partial$
\end{document}
Which yields
-
1Though this is visually correct it does not have the correct semantics. The slash in this case does not mean “cancel”, see Feynman Slash Notation. Nov 10, 2015 at 17:16
-
1@HenriMenke I just answered the question: a $\partial$ with a diagonal line through it. Whether or not it has the correct semantics is a matter of interpretation.– Pål GDNov 11, 2015 at 1:48
As a \stackinset
. Made to obey the math style.
\documentclass{article}
\usepackage{stackengine,scalerel}
\def\slashpartial{\ThisStyle{\ensurestackMath{\stackinset{c}{}{c}{}{\SavedStyle/}{%
\SavedStyle\partial}}}}
\begin{document}
\[
\slashpartial B\textstyle\slashpartial A_{\slashpartial_{\slashpartial}}
\]
\end{document}
And here is a version that only presents as the height of \partial
. Note it affects vertical height of subscripting. I also tweaked the relative location
of the slash by a fraction of a point:
\documentclass{article}
\usepackage{stackengine,scalerel}
\def\slashpartial{\vphantom{\partial}\ThisStyle{\ensurestackMath{\smash{%
\stackinset{c}{.2\LMpt}{c}{-.2\LMpt}{\SavedStyle/}{\SavedStyle\partial}}}}}
\begin{document}
\[
\slashpartial B\textstyle\slashpartial A_{\slashpartial_{\slashpartial}}
\]
\end{document}
Some times this slashed notation (in physics) is called "Feynman slash". I use it very often. For that I use the centernot
package, and define a command \fy
\documentclass{article}
\usepackage{centernot}
\newcommand\fy[1][\partial]{\centernot{#1}}
\begin{document}
\begin{equation}
\fy \fy[A] \fy[p]
\end{equation}
\end{document}
However, after reading other answers I tried the package slashed
,
\documentclass{article}
\usepackage{slashed}
\newcommand\fy[1][\partial]{\slashed{#1}}
\begin{document}
\begin{equation}
\fy \fy[A] \fy[p]
\end{equation}
\end{document}
And the result seems improved,
Now you have another idea!
\partial
with a line through it, but there is the\eth
command available withamssymb
or there's the\dh
command if you use T1 fonts. Or you can simply use XeTeX and use a font which contains the symbol