Skip to content
Specular Differentiation

LaTeX Macro

Preamble

To use the specular differentiation symbol in your LaTeX document, add the following code to your preamble (before \begin{document}):

% Required packages
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{amssymb}

% specular derivative symbol
\newcommand{\sd}{\mathord{\prime\mkern-2.5mu\reflectbox{$\scriptstyle\prime$}}}

% specular Gateaux derivative symbol
\newcommand{\sGd}{%
    \mathord{\text{\normalfont\UseTextSymbol{T1}{\dj}}}%
}

% specular Frechet derivative symbol
\newcommand{\sFd}{%
    \mathord{\text{\normalfont\UseTextSymbol{T1}{\DJ}}}%
}

% specular gradient symbol
\newcommand{\sg}{%
  \mathchoice
    {\mathord{\raisebox{-0.05ex}{\rule{0pt}{1.3ex}\smash{\scalebox{1.37}[1.22]{\ensuremath{\displaystyle\blacktriangledown}}}}\mkern-1.2mu}}
    {\mathord{\raisebox{-0.05ex}{\rule{0pt}{1.3ex}\smash{\scalebox{1.37}[1.22]{\ensuremath{\textstyle\blacktriangledown}}}}\mkern-1.2mu}}
    {\mathord{\raisebox{-0.03ex}{\rule{0pt}{1.0ex}\smash{\scalebox{1.29}[1.15]{\ensuremath{\scriptstyle\blacktriangledown}}}}\mkern-0.8mu}}
    {\mathord{\raisebox{-0.02ex}{\rule{0pt}{0.8ex}\smash{\scalebox{1.18}[1.05]{\ensuremath{\scriptscriptstyle\blacktriangledown}}}}\mkern-0.5mu}}
}

The packages above support the following commands:

Package Purpose
fontenc with T1 Provides the đ and Đ text symbols used by \sGd and \sFd.
amsmath Provides \text for \sGd and \sFd.
graphicx Reflects the prime in \sd and scales the triangle in \sg.
amssymb Provides \blacktriangledown for \sg.

If you only use \sGd and \sFd, you only need fontenc with T1 and amsmath from this list. Do not load a package again if your document already loads it.

Usage examples

Use the symbols in your document after \begin{document}.

% A specular derivative in the one-dimensional Euclidean space
$f^{\sd}(x)$

% A specular directional derivative in normed vector spaces
$\partial^{\sd}_v f(x)$

% A specular Gateaux derivative
$\sGd f(x)$

% A specular Frechet derivative
$\sFd f(x)$

% A specular gradient
$\sg f(x)$

Markdown usage

The documentation defines \sd, \sGd, \sFd, and \sg globally, so the same commands work inside Markdown math without adding a preamble to each page. The Gâteaux and Fréchet symbols are the upright letters đ and Đ, respectively.

Markdown source Rendered symbol
\(f^{\sd}(x)\) \(f^{\sd}(x)\)
\(\partial^{\sd}_v f(x)\) \(\partial^{\sd}_v f(x)\)
\(\sGd f(x)\) \(\sGd f(x)\)
\(\sFd f(x)\) \(\sFd f(x)\)
\(\sg f(x)\) \(\sg f(x)\)
\(\frac{\sg f(x)}{\|\sg f(x)\|}\) \(\frac{\sg f(x)}{\|\sg f(x)\|}\)