People are saying u1D378 is the unicode for


How do i create such a tally mark character in mathematica front end. If there is another way please also suggest that.

| improve this question | | | | |
  • $\begingroup$ According to unicode.org/alloc/Pipeline.html, the Tally Mark Five character was finally published in Unicode 11, on June 5 2018. Since no version of Mathematica is newer than that, I don't believe the built-in font has support for these characters (my OSX system font also doesn't have support for these characters). Related: stackoverflow.com/questions/3557276/… mathematica.stackexchange.com/questions/159178/… $\endgroup$ – Carl Lange Jan 8 '19 at 16:04
  • $\begingroup$ I believe Mathematica implements only UTF-16 Unicode characters, so the characters that look like u plus 5 hex digits can't be used in M. See FromCharacterCode[] and try FromCharacterCode[16^^1D378]. $\endgroup$ – Michael E2 Jan 8 '19 at 16:40
  • $\begingroup$ I think version 12 will support emoji, so perhaps support for higher-register UTF characters will come via that 💩 $\endgroup$ – Carl Lange Jan 8 '19 at 16:44

While it seems impossible to get the true unicode character to display in Mathematica (see comments), you can create a graphics expression that behaves like a character in terms of display (code at the end of the answer):

enter image description here

You can copy this object into a string, and it will adapt to font color and size (copy & paste the result from above to where the <> is):

Style["This is like a character: <>",Red,FontSize->30]

enter image description here

This is achieved by wrapping the graphics expression in Dynamic (to get the dynamic color/size) and Deploy (to prevent accidental editing). The color is set to CurrentValue@"Color", the size is set using CurrentValue@FontSize. Similarly, other properties of the object could be adapted to the surrounding text. I got the graphics expression itself by printing the SVG file to a PDF and importing that into Mathematica.

Code to generate expression

| improve this answer | | | | |
  • $\begingroup$ Although i used FontVariations->{"StrikeThrough"->True}] to achieve a slightly poor effect but this is brilliant. Can this be used to convert any image data into a character to be used in the frontend? $\endgroup$ – user13892 Jan 8 '19 at 18:35
  • $\begingroup$ @user13892 In principle, you can insert anything into strings, yes. Dynamic styling is also pretty straightforward - just wrap the expression in dynamic and use CurrentValue[…] to get the correct values (the are many others besides "Color" and FontSize, just play around with it - see also this post) $\endgroup$ – Lukas Lang Jan 8 '19 at 19:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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