4

I am using \mathcal{T} to denote types in my paper. For unit type I want to use something like \mathcal{1} but for some reason it renders as infinity symbol. How can I get a number 1 in mathcal font.

8
  • 3
    \mathcal can only be used for uppercase letters
    – egreg
    Mar 7 '16 at 23:00
  • 1
    Christian, I think \mathcal{1} should look like digit 1, rendered in a style/font similar to one used for \mathcal{} uppercase letters.
    – krokodil
    Mar 7 '16 at 23:07
  • 4
    that is not how the tex fonts work, each font only has 128 characters (even though tfm allows 256) and the alphabets and symbols are squeezed in wherever. the symbol font has an uppercase calligraphic alphabet in the ascii uppercase positions but all the math symbols are in the other slots, \mathcal just selects the symbol font so only produces caligraphic for uppercase letters. Mar 7 '16 at 23:11
  • 1
    If there is any other command I can use to render 1 in a style/font similar to one used for \mathcal{} uppercase letters?
    – krokodil
    Mar 7 '16 at 23:20
  • 2
    most of the tex fonts with math caligraphic/script don't have digits, I just looked at cmsy,euscr,rsfs,calliga but if you find a font with the characters you want, it could be set up for tex use. Mar 7 '16 at 23:27
1

TL;DR: Use \mathds{1} with the dsfont package instead of \mathcal{1}.


I have previously used $\mathcal{1}_{bla}$ for indicator variables that are 1 if and only if "bla" holds true. This worked fine in IEEE templates:

mathcal in IEEE

But broke in another KOMA-based template, where it also just showed the infinity symbol. As mentioned in the comments, \mathcal is only properly defined for capital letters.

A simple solution for me was to use the dsfont package (\usepackage{dsfont} in preamble), which allows the desired styling with \mathds{1}_{bla}. The result looks like this (different equation than above but similar styling of the indicator variable):

mathds instead of mathcal

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.