Built-in Types

%reload_ext rubberize
from rubberize.config import config

Built-in Python types other than numbers and collections are rendered like so:

Strings

The font style for strings can be changed using @str_font:

config.str_font
''

It can be changed to any of these values:

Font style Value Rendered Output
None "" \(\displaystyle \text{“Hello world!”}\)
Boldface "bf" \(\displaystyle \textbf{“Hello world!”}\)
Italics "it" \(\displaystyle \textit{“Hello world!”}\)
Roman "rm" \(\displaystyle \textrm{“Hello world!”}\)
Sans serif "sf" \(\displaystyle \textsf{“Hello world!”}\)
Typewriter "tt" \(\displaystyle \texttt{“Hello world!”}\)

Additionally, string quotes can also be changed using @str_quotes:

config.str_quotes
'"'

It can be changed to any of these values:

Quotation Marks Value Rendered Output
None "" \(\displaystyle \text{Hello world!}\)
Single "'" \(\displaystyle \text{‘Hello world!’}\)
Double '"' \(\displaystyle \text{“Hello world!”}\)

Boolean

%%tap --grid
True
False
\( \displaystyle \text{True} \)
\( \displaystyle \text{False} \)

None Type

%%tap
None
\( \displaystyle \emptyset \)

Range

%%tap --dead
range(25)
range(x, y, 2)
\( \displaystyle \left( 0,\, 1,\, \cdots,\, 24 \right) \)
\( \displaystyle \left( x,\, x + 2,\, \cdots,\, \le y - 1 \right) \)

Ellipsis Type

%%tap
(...)
\( \displaystyle \dots \)