Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

With pifont, the darkened circled number starts from 182.

enter image description here

I made a macro that maps \dcircle{1} to \ding{182} as follows.

\newcommand{\dcircle}[1]{\ding{181 + #1}}

However, \dcircle{1} returns the characters that I don't expect:

enter image description here

What might be wrong?

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

You have to evaluate the numeric expression; \numexpr provides this:

enter image description here

\documentclass{article}
\usepackage{pifont}% http://ctan.org/pkg/pifont
\newcommand{\dcircle}[1]{\ding{\numexpr181 + #1}}
\begin{document}

\ding{182}\ \dcircle{1}
\end{document}

Note that this performs no end-of-sequence checking.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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