9

I'm looking for a way to include a Philippine Peso sign (Unicode code point 0x20B1) in a LaTeX document. Using the textcomp package (as shipped with the base latex distribution) in conjunction with times, I get like this:

picture of \textpeso

when what I want is this:

5

This assumes that the arc of the P is half the height of the letter.

\documentclass{article}

\makeatletter
\DeclareRobustCommand{\PHP}{%
  \begingroup
  \leavevmode\,\vphantom{P}%
  \dimen\z@=.5\fontcharht\font`P\relax
  \dimen\tw@=0.33333\dimen\z@
  \ooalign{%
    \raisebox{\dimexpr\dimen\z@+2\dimen\tw@-0.4pt}{\rule{\fontcharwd\font`P}{0.4pt}}\cr
    \raisebox{\dimexpr\dimen\z@+\dimen\tw@-0.2pt}{\rule{\fontcharwd\font`P}{0.4pt}}\cr
    P\cr
  }%
  \,\endgroup
}
\makeatother

\begin{document}

\PHP\quad\textbf{\PHP}\quad{\Large\PHP}

100\PHP

\end{document}

enter image description here

  • I like the fact that this answer has fewer dependencies, and seems to scale nicely. – user3188445 Sep 2 '16 at 22:49
7

If one needs the ability to adjust the vertical space between the cross-lines, then this can work:

\documentclass[10pt]{article}
\usepackage{stackengine}
\newcommand\pesos{%
  \stackengine{-1.38ex}{P}{\stackengine{-1.2ex}{$-$}{$-$}{O}{c}{F}{F}{S}}{O}{c}{F}{T}{S}}
\begin{document}
35\pesos ~\sffamily 35\pesos ~\ttfamily 35\pesos
\end{document}

enter image description here

If using a \scriptstyle= sign is sufficient, a nested stack is avoided, at the expense of a \scalebox:

\documentclass[10pt]{article}
\usepackage{stackengine,graphicx}
\newcommand\pesos{\stackengine{-.85ex}{P}{\scalebox{1.15}[1]{$\scriptstyle=$}}{O}{c}{F}{T}{S}}
\begin{document}
35\pesos ~\sffamily 35\pesos ~\ttfamily 35\pesos
\end{document}

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.