7

Using \usym{2776} one can typeset numbers in circles. Is it possible, to also add numbers to other symbols, e.g., \faBookmark?

\documentclass{article}

\usepackage{relsize}

\usepackage{utfsym}

\usepackage{fontawesome5}
  
\begin{document}

My text {\relscale{1.1}\usym{2776}} is awesome.

My text {\relscale{.9}\faBookmark} is awesome.

\end{document}

1 Answer 1

8

Yes, it is possible. One way is to write your symbol and then add a number on top of it, for example with \ooalign. Here's a possible solution.

\documentclass{article}
\usepackage{relsize}
\usepackage{utfsym}
\usepackage{fontawesome5}
\usepackage{xcolor}
\newcommand*{\faBookmarknum}[1]{%
    \ooalign{%
        \relscale{.9}\faBookmark\cr%
        \hfil\raisebox{.5ex}{%
            \color{white}\relscale{.65}#1%
        }\hfil\cr%
    }%
}
  
\begin{document}

My text {\relscale{1.1}\usym{2776}} is awesome.

My text \faBookmarknum{1} is awesome.

\footnotesize
\faBookmarknum{1}
\faBookmarknum{2}
\faBookmarknum{3}
\faBookmarknum{4}
\faBookmarknum{5}
\faBookmarknum{6}
\faBookmarknum{7}
\faBookmarknum{8}
\faBookmarknum{9}
\faBookmarknum{0}

\normalsize
\faBookmarknum{1}
\faBookmarknum{2}
\faBookmarknum{3}
\faBookmarknum{4}
\faBookmarknum{5}
\faBookmarknum{6}
\faBookmarknum{7}
\faBookmarknum{8}
\faBookmarknum{9}
\faBookmarknum{0}

\large
\faBookmarknum{1}
\faBookmarknum{2}
\faBookmarknum{3}
\faBookmarknum{4}
\faBookmarknum{5}
\faBookmarknum{6}
\faBookmarknum{7}
\faBookmarknum{8}
\faBookmarknum{9}
\faBookmarknum{0}

\Large
\faBookmarknum{1}
\faBookmarknum{2}
\faBookmarknum{3}
\faBookmarknum{4}
\faBookmarknum{5}
\faBookmarknum{6}
\faBookmarknum{7}
\faBookmarknum{8}
\faBookmarknum{9}
\faBookmarknum{0}

\end{document}

Here's another option were the symbol is lowered instead of the number being raised, so that the baseline of the number aligns with that of the text.

\documentclass{article}
\usepackage{relsize}
\usepackage{utfsym}
\usepackage{fontawesome5}
\usepackage{xcolor}
\newcommand*{\faBookmarknum}[1]{%
    \ooalign{%
        \raisebox{-.5ex}{%
            \relscale{.9}\faBookmark%
        }\cr%
        \hfil\textcolor{white}{\relscale{.65}#1}\hfil\cr%
    }%
}
  
\begin{document}

My text {\relscale{1.1}\usym{2776}} is awesome.

My text \faBookmarknum{1} is awesome.

\footnotesize
\faBookmarknum{1}
\faBookmarknum{2}
\faBookmarknum{3}
\faBookmarknum{4}
\faBookmarknum{5}
\faBookmarknum{6}
\faBookmarknum{7}
\faBookmarknum{8}
\faBookmarknum{9}
\faBookmarknum{0}

\normalsize
\faBookmarknum{1}
\faBookmarknum{2}
\faBookmarknum{3}
\faBookmarknum{4}
\faBookmarknum{5}
\faBookmarknum{6}
\faBookmarknum{7}
\faBookmarknum{8}
\faBookmarknum{9}
\faBookmarknum{0}

\large
\faBookmarknum{1}
\faBookmarknum{2}
\faBookmarknum{3}
\faBookmarknum{4}
\faBookmarknum{5}
\faBookmarknum{6}
\faBookmarknum{7}
\faBookmarknum{8}
\faBookmarknum{9}
\faBookmarknum{0}

\Large
\faBookmarknum{1}
\faBookmarknum{2}
\faBookmarknum{3}
\faBookmarknum{4}
\faBookmarknum{5}
\faBookmarknum{6}
\faBookmarknum{7}
\faBookmarknum{8}
\faBookmarknum{9}
\faBookmarknum{0}

\end{document}
4
  • 4
    It's not what was asked, but it would look nicer if the baseline of the numbers were positioned at the baseline of the text, and there's room below the baseline where the text descenders would be. So maybe lowering the symbol instead of raising the number would be possible. Commented Aug 20, 2023 at 15:21
  • +1. I would like @barbarabeeton's suggestion too
    – user1
    Commented Aug 20, 2023 at 16:28
  • @barbarabeeton Good idea, thanks for the suggestion!
    – Vincent
    Commented Aug 20, 2023 at 21:55
  • @user1 I added another solution
    – Vincent
    Commented Aug 20, 2023 at 21:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .