Fonts & Character Setspifont--missing zero?

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
theo moore
Posts: 72
Joined: Thu Jan 15, 2009 3:16 pm

pifont--missing zero?

Post by theo moore »

I'd like to use the circled numbers in the pifont package, as listed on p.87 here

So for example, you can use:

Code: Select all

\ding{172}
\ding{173}
\ding{174}
\ding{175}
to make circled numbers 1-4. You can also do a circled 10. However, there is no circled zero! This is a bit of a problem for me.

Any of you guys know a workaround?
Last edited by theo moore on Tue Jan 04, 2011 7:48 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

pifont--missing zero?

Post by localghost »

Concerning the font itself I'm afraid that there will be no workaround. The font designer just didn't provide this character. But there are a lot of possible alternatives [1-4]. A further search in the forum might yield more solutions. In the meantime you should know the search function.

[1] View topic: circle around letters
[2] View topic: 1 inside a circle
[3] View topic: How to draw a circle around text
[4] View topic: enumerate with circled numbers


Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
theo moore
Posts: 72
Joined: Thu Jan 15, 2009 3:16 pm

pifont--missing zero?

Post by theo moore »

localghost wrote:Concerning the font itself I'm afraid that there will be no workaround. The font designer just didn't provide this character. But there are a lot of possible alternatives [1-4]. A further search in the forum might yield more solutions. In the meantime you should know the search function.

[1] View topic: circle around letters
[2] View topic: 1 inside a circle
[3] View topic: How to draw a circle around text
[4] View topic: enumerate with circled numbers


Thorsten
Thank you for the reply. I ended up using the solution in [1]. By altering the tikz parameters, slightly, you can achieve the same sort of look as the pifonts package; but this way is much more flexible and allows you to use whatever you like in the circled boundary.
nderby
Posts: 3
Joined: Thu Jan 31, 2008 2:57 am

pifont--missing zero?

Post by nderby »

Theo, would you please post your solution to getting something that looks like the pifonts solution? Or more generally, would someone please help me with my related problem below?

Like Theo, I frequently use the pifont circled numbers, except I use the ones that are solid black with the number in white:

Code: Select all

\ding{202} \ding{203} ... \ding{211}
which produces numbers 1 through 10. And I often make them one step larger than the default size (with the relsize package), for easier readability:

Code: Select all

{\larger \ding{202}} {\larger \ding{203}} ... {\larger \ding{211}}
My problem is that I need the range of 1-10 to extend to numbers as high as 19, which are not available.

Like Theo, I explored the four options that Thorsten recommended, and preferred the same one Theo did, at this thread, reproduced below:

Code: Select all

\newcommand*\circled[1]{%
  \tikz[baseline=(C.base)]\node[draw,circle,inner sep=0.5pt](C) {#1};\!
}
My problems with this solution:

(1) How can I make this a solid circle, with the number in white?

(2) How can I put the number in a sans serif font, similar to what I'm trying to re-create?

(3) Most importantly, how can I make it so that the size of the circle stays the same for all numbers from 1 to 19? With the solution above, \circled{5} and \circled{15} create different-sized circles.
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

pifont--missing zero?

Post by localghost »

nderby wrote:[…] My problems with this solution:

(1) How can I make this a solid circle, with the number in white?

(2) How can I put the number in a sans serif font, similar to what I'm trying to re-create?

(3) Most importantly, how can I make it so that the size of the circle stays the same for all numbers from 1 to 19? With the solution above, \circled{5} and \circled{15} create different-sized circles.
Actually you could have done some research on your own by looking at the pgf/tikZ manual in the meantime. While replying to this question I had an idea that brings the additional value of one command with a starred version. See code below.

Code: Select all

\documentclass[11pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tikz}

\makeatletter
\newcommand*{\circled}{\@ifstar\circledstar\circlednostar}
\makeatother

\newcommand*\circledstar[1]{%
  \tikz[baseline=(C.base)]
    \node[%
      fill,
      circle,
      minimum size=1.35em,
      text=white,
      font=\sffamily,
      inner sep=0.5pt
    ](C) {#1};%
}
\newcommand*\circlednostar[1]{%
  \tikz[baseline=(C.base)]
    \node[%
      draw,
      circle,
      minimum size=1.35em,
      font=\sffamily,
      inner sep=0.5pt
    ](C) {#1};%
}

\begin{document}
  \circled{1} \circled{10}

  \circled*{1} \circled*{10}

  \begin{enumerate}
    \renewcommand{\labelenumi}{\circled{\theenumi}}
    \item First Item
    \item Second Item
    \item Third Item
  \end{enumerate}

  \begin{enumerate}
    \renewcommand{\labelenumi}{\circled*{\theenumi}}
    \item First Item
    \item Second Item
    \item Third Item
  \end{enumerate}
\end{document}
At the moment I'm trying to figure out how to make this \circled a real numbering command like \alph, \arabic or \roman. I already did something similar with \greek numbering some time ago (but that was easier) [1]. This would have the advantage that it could be incorporated into the enumitem package without having to redefine the list counters for every single list as seen in the code above.

[1] View topic: greek letters as page numerals


Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
Post Reply