Math & ScienceThe Identity Matrix

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

The Identity Matrix

Post by Cham »

Hi guys,

what symbol are you using for the identity matrix ?

Currently, I'm simply using "I", which appears as a slanted (italic ?) symbol. Everything was fine, until today :? . I'm not sure any more it's a proper symbol for the identity matrix in complicated equations.

I tried \mathbb{I}, which looks nice too, but I'm now wondering what other options we have for this matrix.

Any other ideas ?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Stefan Kottwitz
Site Admin
Posts: 10359
Joined: Mon Mar 10, 2008 9:44 pm

The Identity Matrix

Post by Stefan Kottwitz »

I would use the same font as for other matrices, i.e. I when I also have matrices A, B, M, etc. all in italic, standard math font.

If there's no other variable, matrix, or map I, i.e. if there's not a chance for confusion, I don't see a reason to change the font. I would not like to have some bold I within non-bold formulas.

Furthermore, there's not just one identity matrix. There's one for each rank, so one should write I_1, I_2, I_3 etc. if the rank or size is not really obvious.

Stefan
LaTeX.org admin
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Re: The Identity Matrix

Post by Cham »

Well, it may be a good thing to make the identity matrix to "stand up", against all the other matrices.

Since it's the matrix which "do nothing", it's like "1". Maybe a special font for "1" could be used for the identity matrix. Which one ?
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

The Identity Matrix

Post by Cham »

I've found this one :

Code: Select all

\usepackage{bbm} 
\newcommand\bbone{\ensuremath{\mathbbm{1}}}
Very nice, but I'm not sure I'll use it yet...
There are some jaggies on this symbol. It's not smooth at high magnification.


Edit:
This one appears to be nicer :

Code: Select all

\usepackage{mathbbol}
and use \mathbb{1}. Sadly, it interfere with other default symbols...
Last edited by Stefan Kottwitz on Mon Jun 25, 2012 9:21 am, edited 1 time in total.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

The Identity Matrix

Post by localghost »

Code: Select all

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{bbold}

\begin{document}
  $\mathbb{1}$
\end{document}

Thorsten
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

The Identity Matrix

Post by Cham »

localghost wrote:

Code: Select all

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{bbold}

\begin{document}
  $\mathbb{1}$
\end{document}
The problem with this solution is it's interfering with the symbols I use for the ensembles (Natural numbers, reals, complexes, etc).

Is there a way to define a "double 1" without calling the bbold package ? Or at least without changing all the other symbols ?
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

The Identity Matrix

Post by Cham »

I've found this solution (however, I think the vertical bar is a bit too thick) :

Code: Select all

\usepackage{dsfont}
then use

Code: Select all

\mathds{1}
It's really pretty, despite the thick bar. It may be the best solution yet (?).

I'm pretty sure there's another solution to be found for a double-1.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

The Identity Matrix

Post by localghost »

Cham wrote:[…] Is there a way to define a "double 1" without calling the bbold package? […]

Code: Select all

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}

\newcommand*{\id}{{\normalfont\hbox{1\kern-0.15em \vrule width .8pt depth-.5pt}}}

\begin{document}
  \id
\end{document}
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Re: The Identity Matrix

Post by Cham »

Eurk ! This one is extremely ugly. Looks like an hack. The "double-1" is terrible after compilation...
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

The Identity Matrix

Post by Cham »

The best solution I've found yet is this :

Code: Select all

\usepackage{bbm}
\newcommand\id{\ensuremath{\mathbbm{1}}} 
But sadly, the symbol resolution is really bad at high magnification. The "1" appears to be pixelised.
Post Reply