How can I insert this currency symbol in LaTeX
? It is called Colon and is used in some South American countries.
-
Welcome to the TeX.SE. Possible related here? tex.stackexchange.com/questions/226602/…– SebastianoJul 10, 2020 at 9:14
-
@Sebastiano I saw that in the symbols list, but there is was listed with only one line through it.– daleifJul 10, 2020 at 9:26
-
1This is one of typical questions: how to print a character xy. And OP is able to insert this character in the text editor (see the title of this thread, for example). The the answer is simple: use such character in your source text, ₡100 for example. And use Unicode TeX engine and appropriate Unicode font.– wipetJul 10, 2020 at 9:31
-
I like your answer @wipet. Unfortunately, I'm using Overleaf, and can't change compiler or my document messes up (pdflatex select, btw).– thmaskerJul 10, 2020 at 10:02
-
1@wipet I know, but the whole document has been already done with pdflatex, and it would be a headache to adapt all to the new compiler (I've tried, and appearance changes too much)– thmaskerJul 10, 2020 at 11:40
1 Answer
Here's a construction with the help of \ooalign
that superimposes glyphs.
\documentclass{article}
\DeclareRobustCommand{\Colon}{{%
\ooalign{%
\hidewidth\raisebox{0.2ex}{/}\kern0.1em\hidewidth\cr
C\cr
\hidewidth\kern0.1em\raisebox{0.2ex}{/}\hidewidth\cr
}%
}}
\begin{document}
You owe me \Colon 100
\end{document}
First a /
, almost centered, but pushed a bit to the left; then a full width C
, then another /
, centered, but pushed a bit to the right. The two slashes are slightly raised.
Why not simply raising two slashes slightly separated from each other? There are two reasons:
- the slash has quite wide sidebearings;
- with
\ooalign
, the height and depth are determined by the first item and the last respectively.
Reason 2 would require a phantom with a raised slash, so there's no efficiency gain in raising two boxes.
-
1With XeLaTeX or LuaLaTeX and
fontspec
, the main font may have the character ₡ (U+20A1 COLON SIGN).– egregJul 10, 2020 at 9:38 -
this seems like a good solution. How could I force to insert one blank space between currency and 100?– thmaskerJul 10, 2020 at 10:06
-
1@thmasker You may not need the space in every situation. Just do
\Colon~100
when you need the space.– egregJul 10, 2020 at 10:08