Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
add comment

3 Answers

up vote 18 down vote accepted

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.

share|improve this answer
    
Absolutely awesome! :) –  Paulo Cereda Jan 11 '12 at 10:52
add comment

Looking at The Comprehensive LaTeX Symbols list, I've found \Beam symbol from marvosym.

enter image description here

share|improve this answer
1  
That looks okay in the small preview, but if you look at it more closely, the top bar is thicker than the lower and it protrudes slightly to the right. –  Jake Jan 10 '12 at 9:36
add comment

Possibly you are looking for unicode U+2393 DIRECT CURRENT SYMBOL FORM TWO see

http://www.unicode.org/charts/PDF/U2300.pdf

so the character will be in Unicode fonts such as stix at that position. How to access Unicode characters depends rather on whether you are using a Unicode flavoured TeX variant or not (and others here could no doubt give more up to date advice on that).

share|improve this answer
    
We have a few questions relating to unicode characters, Ulrike's answer at tex.stackexchange.com/q/37445/86 looked quite helpful at first glance. (NB This comment prompted by your parenthetical remark and so is for the benefit of others reading your answer!) –  Loop Space Jan 10 '12 at 13:17
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.