# How to represent the trace of a matrix [duplicate]

Possible Duplicate:
Define additional math operators to be typeset in roman

The trace of a matrix is often written as "Tr [matrix] ", but there does not seem to be a naive LaTeX symbol for this.

The trace is defined as the sum on the main diagonal.

-

## marked as duplicate by Andrey Vihrov, dmckee, egreg, Mico, cmhughesNov 12 '11 at 0:04

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Do you mean \DeclareMathOperator{\Tr}{Tr}? –  Andrey Vihrov Nov 11 '11 at 23:17
@AndreyVihrov Yeah. I think I do. –  dmckee Nov 11 '11 at 23:18

## 1 Answer

I prefer the following definition:

\usepackage{amsmath}
\DeclareMathOperator{\Tr}{Tr}

-
The \mathrm is automatically issued by \DeclareMathOperator. –  egreg Nov 11 '11 at 23:23
@egreg you are right; thanks –  Boris Nov 11 '11 at 23:42
Whoever down voted this, please provide some info as to what exactly is wrong with this answer. I find it useful to know why things are wrong and not just that they are wrong. –  Peter Grill Nov 11 '11 at 23:45