13

How do I write the Bitcoin symbol in LaTeX?

  • Abusing Unicode, "B⃦" can be used in normal text files. I'm not a fan of writing non-ASCII in LaTeX, as you can run into all sorts of encoding issues.
  • There does not seem to be a package defining it.
  • I could use TikZ to roll my own version, but then that would probably not scale well (telling from past attempts at similar things).

So: what do you think would be the best way of writing the Bitcoin currency symbol in LaTeX?

For comparison, here's the Bitcoin wiki entry for the symbol.

11

Three examples, from here:

\def\bitcoinA{%
  \leavevmode
  \vtop{\offinterlineskip %\bfseries
    \setbox0=\hbox{B}%
    \setbox2=\hbox to\wd0{\hfil\hskip-.03em
    \vrule height .3ex width .15ex\hskip .08em
    \vrule height .3ex width .15ex\hfil}
    \vbox{\copy2\box0}\box2}}

and

\def\bitcoinB{\leavevmode
  {\setbox0=\hbox{\textsf{B}}%
    \dimen0\ht0 \advance\dimen0 0.2ex
    \ooalign{\hfil \box0\hfil\cr
      \hfil\vrule height \dimen0 depth.2ex\hfil\cr
    }%
  }%
}

and

\def\bitcoinC{\leavevmode\rlap{\hskip.5pt-}B} 

enter image description here

  • 2
    As for now, only the last symbol posted by Papiro has to be used (here's the why) Since this thread is still in use, I'll (picky me) slightly modify Papiro's answer by lowering the overlaid line to a more proper position : \def\btc{\leavevmode\rlap{\raisebox{-.7pt}{-}}B} – Warren Mar 24 '16 at 21:10
  • @Warren I think that advice is out-dated; as the page linked by the OP says, Unicode has added U+20BF as the Bitcoin symbol in Unicode 10.0 released mid-2017, and already many fonts have support for it (₿). In the fonts and in the reference image, it looks closer to the first one above. – ShreevatsaR Jan 4 '18 at 20:04
5

A variant, more inline with the “official” rendering (see http://bitcoinsymbol.org)

\documentclass{article}

\DeclareRobustCommand{\bitcoin}{{%
  \normalfont\sffamily
   \raisebox{-.05ex}{\makebox[.1\width][l]{-\kern-.2em-}}B%
}}

\begin{document}

\bitcoin

\end{document}

enter image description here

Of course the adjustments depend on the document sans serif font.

From the site:

enter image description here

2

Thanks for the bitcoin symbol. Here is an attempt at drawing the Litecoin symbol in latex

\newcommand{\diaCo}{\mkern-\medmuskip\rotatebox[origin=c]{45}{\scalebox{0.9}{$-$}}\mkern-\medmuskip}%   
\def\litecoin{\leavevmode\rlap{\hskip-1.3pt \textbf{$\diaCo$}}L} 

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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