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.

krokodil
  • 237
  • 3
    \mathcal can only be used for uppercase letters – egreg Mar 07 '16 at 23:00
  • Welcome to TeX.SX! How should \mathcal{1} look like, according to your opinion? –  Mar 07 '16 at 23:01
  • 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 07 '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. – David Carlisle Mar 07 '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 07 '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. – David Carlisle Mar 07 '16 at 23:27
  • While there might be such a font, please don't do it. 1 is a 1. You don't need to make it fluffy and make it unreadable. – percusse Mar 08 '16 at 07:49
  • I have used $\mathcal{1}_{bla}$ successfully in IEEE templates to represent indicator variables that are 1 if and only if "bla" holds. In another KOMA-based template, it doesn't work and I also get the infinity symbol. Is there a good/recommended alternative to represent such indicator variables? A plain 1 doesn't seem suitable to me. – stefanbschneider Feb 26 '21 at 10:30

1 Answers1

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