3

I am trying to write a Dirac delta function. I almost have it but would like to bold my "x =x'" text.

Here is my code:

\begin{equation}
\delta(\mathbf{x-x^{'}})=\begin{cases}
            1, & \text{$x = x'$}\\
            0, & \text{$x \neq x'$}
\end{cases}
\end{equation}

I also tried this:

\begin{equation}
\delta(\mathbf{x-x^{'}})=\begin{cases}
            1, & \textbf{$x = x'$}\\
            0, & \textbf{$x \neq x'$}
\end{cases}
\end{equation}

but that gives the same output

Edit:from teddies comments this is the latex code I used to get the result I wanted:

\begin{equation}
\delta(\mathbf{x-x'})=\begin{cases}
            1, & \mathbf{ x = x'}\\
            0, & \mathbf{ x \neq x'}
\end{cases}
\end{equation}
Dick
  • 31
  • 2

2 Answers2

3

You haven't indicated whether the bold x symbols should be rendered in upright or in slanted/italic lettering. The following code shows how to pursue either variant.

enter image description here

I wouldn't render the - (minus), ' (prime), = (equals), or \neq (not equal to) symbols in bold.

\documentclass{article} % or some other suitable document class
\usepackage{amsmath}    % for 'cases' environment
\usepackage{bm}         % for '\bm' macdro
\newcommand\bfx{\mathbf{x}} % "upright bold" x
\newcommand\bmx{\bm{x}}     % "italic bold" x

\begin{document}

\begin{equation} \delta(\bfx-\bfx') =\begin{cases} 1 & \text{if $\bfx=\bfx'$,}\ 0 & \text{if $\bfx\neq\bfx'$.} \end{cases} \end{equation}

\begin{equation} \delta(\bmx-\bmx') =\begin{cases} 1 & \text{if $\bmx=\bmx'$,}\ 0 & \text{if $\bmx\neq\bmx'$.} \end{cases} \end{equation}

\end{document}

Mico
  • 506,678
2

Define your own command for vectors.

\documentclass{article}
\usepackage{amsmath}
\usepackage{bm}

\newcommand{\vect}[1]{\mathbf{#1}} % vector %\newcommand{\vect}[1]{\bm{#1}} % vector

\begin{document}

\begin{equation} \delta(\vect{x}-\vect{x}')= \begin{cases} 1, & \vect{x} = \vect{x}' \ 0, & \vect{x} \neq \vect{x}' \end{cases} \end{equation}

\end{document}

enter image description here

If you switch the comments, so use \bm instead of \mathbf, you get

enter image description here

Defining an own command ensures uniformity and has the advantage that you can change the typographic representation of all vectors with a single shot.

egreg
  • 1,121,712