3

I want to input a special character just like ①, but I don't find how to. Can Mathematica make it?

WangFei
  • 95
  • 5
  • Hi, take a look at Inset or Overlay. – Kuba Dec 07 '15 at 07:44
  • 4
    The Unicode block Enclosed Alphanumerics \:2460 - \:24ff has a selection of such characters that will display circled numbers up to 20 in Mathematica running on OS X and maybe other operating systems as well. – m_goldberg Dec 07 '15 at 12:37
  • Thanks! It works on Windows.., and I found that we can modify the font format, size,color, and so on – WangFei Dec 08 '15 at 03:08
  • Thanks! but the last one FromCharacterCode[#] & /@ Range[9398, 9449] dosen't seem to work on my Mathematica. – WangFei Dec 08 '15 at 09:11

3 Answers3

6

Follow the integer codes (to be used with FromCharacterCode) and hexadecimal codes (to be used with \:) for enclosed numbers. Although not asked, I added the codes for enclosed letters for completeness.

Enclosed numbers

FromCharacterCode[9450] (* \:24ea *)
FromCharacterCode /@ Range[9312, 9331] (* from \:2460 to \:2473 *)
FromCharacterCode /@ Range[12881, 12895] (* from \:3251 to \:325f *)
FromCharacterCode /@ Range[12977, 12991] (* from \:32b1 to \:32bf *)

enter image description here

FromCharacterCode /@ Range[9451, 9470] (* from \:24eb to \:24ff *)
FromCharacterCode /@ Range[10102, 10131] (* from \:2776 to \:2793 *)

enter image description here

Enclosed letters

FromCharacterCode /@ Range[9398, 9449] (* from to \:24b6 to \:24e9 *)

enter image description here

Remarks

As mentioned by @m_goldberg in his comment, characters may not displayed on some operating systems, and as mentioned by @WangFeiBoy in his comment, the Style of the characters can be modified to some extent.

1

Generic code:

Graphics[{Circle[], Text[x^2 + y^2 < 1, {0, 0}]}]

Output:

generic example

Specific code:

Graphics[{Circle[], Text[1]}, ImageSize -> 24]

Output:

specific example

Reference:
Graphics
Circle
Text

e.doroskevic
  • 5,959
  • 1
  • 13
  • 32
  • Thanks for your meaningful answer! but what I want to get is an "Enclosed Alphanumerics", just like what @m_goldberg said – WangFei Dec 08 '15 at 03:04
  • @WangFeiBoy, I do apologise for not providing the ideal solution. Could you please edit your question to include this requirement? What is the ideal output you are looking for? – e.doroskevic Dec 08 '15 at 09:35
  • Sorry I didn't express that clealy, but I think @Xavier have answered my doubts well. In fact your answer can solve my problem as well, in spite of some inconvenience. – WangFei Dec 09 '15 at 11:40
1

user31159's solution seems not always working at least on my system,

FromCharacterCode /@ Range[12881, 12895]

shows

enter image description here

I found this solution for numbers below 100

Table[Framed[i, ImageSize -> {25, 25}, Alignment -> Center, 
  RoundingRadius -> 100], {i, 1, 99}]

which gives

enter image description here

Also no problem for bigger number, but you need a sightly bigger circle!

Table[Framed[i, ImageSize -> {32, 32}, Alignment -> Center, 
  RoundingRadius -> 100], {i, 100, 110}]

gives

enter image description here

Even better, I made a function circledNumber that can control the size of circle and automatically adjust size of number to fit the circle. It only works for integer number smaller than 1000.

circledNumber[int_, size_] := Module[{scale},
   If[int < 100, scale = 0.7, scale = 0.5];
   Framed[Style[int, size*scale], ImageSize -> {size, size}, 
    Alignment -> Center, RoundingRadius -> 100, 
    ContentPadding -> False, FrameMargins -> 0]]

below is an example

Table[circledNumber[i, 
  size], {i, {9, 99, 999}}, {size, {10, 50, 100}}]

enter image description here

matheorem
  • 17,132
  • 8
  • 45
  • 115