[Tex/LaTex] Howto typeset the direct current symbol in LaTeX

symbols

How can I typeset the following symbol for direct current (i.e. a = symbol where the lower line is dashed)?

Direct current symbol

The image above is an enlarged version, the size I need is like =, \approx, \simeq etc.

Best Answer

If \Beam from marvosym is not satisfying, then you may try this solution.

\documentclass{article}
\newcommand{\textdirectcurrent}{%
  \settowidth{\dimen0}{$=$}%
  \vbox to .85ex {\offinterlineskip
    \hbox to \dimen0{\leaders\hrule\hfill}
    \vskip.35ex
    \hbox to \dimen0{%
      \leaders\hrule\hskip.2\dimen0\hfill
      \leaders\hrule\hskip.2\dimen0\hfill
      \leaders\hrule\hskip.2\dimen0
    }
    \vfill
  }%
}
\newcommand{\mathdirectcurrent}{\mathrel{\textdirectcurrent}}

\begin{document}
a =\textdirectcurrent{} b

$a \mathdirectcurrent b$

$a = b$
\end{document}

enter image description here

A maybe better implementation, that can work also in subscripts and superscripts, is

\newcommand{\mathdirectcurrent}{\mathrel{\mathpalette\mathdirectcurrentinner\relax}}
\newcommand{\mathdirectcurrentinner}[2]{%
  \settowidth{\dimen0}{$#1=$}%
  \vbox to .85ex {\offinterlineskip
    \hbox to \dimen0{\hss\leaders\hrule\hskip.85\dimen0\hss}
    \vskip.35ex
    \hbox to \dimen0{\hss
      \leaders\hrule\hskip.17\dimen0
      \hskip.17\dimen0
      \leaders\hrule\hskip.17\dimen0
      \hskip.17\dimen0
      \leaders\hrule\hskip.17\dimen0
    \hss}
    \vfill
  }%
}
\newcommand{\textdirectcurrent}{\mathdirectcurrentinner{\textstyle}{}}

However, the spacing parameters may need to be adapted to the main font used.

Related Question