17

As the title suggests, how do I draw a $\partial$ with a diagonal line through it?

cgnieder
  • 66,645
user91705
  • 171

5 Answers5

23

Like this?

enter image description here

\documentclass{article}
\usepackage{slashed}
\begin{document}
$\partial\kern-0.5em\raise0.22ex\hbox{/}$ or $\slashed{\partial}$
\end{document}
Mico
  • 506,678
14

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}

enter image description here

egreg
  • 1,121,712
12

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

\cancel\partial

Pål GD
  • 889
2

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} 

enter image description here

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} 

enter image description here

1

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} 

This yield enter image description here

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, enter image description here

Now you have another idea!

Dox
  • 5,729