# Changing the color of numbering for theorem environment

\documentclass[a4paper]{article}
\usepackage{amsmath}
\usepackage{ntheorem}
\usepackage{thmtools,xcolor}

\makeatletter

\renewtheoremstyle{plain}{
}

\makeatother

\setlength{\theorempreskipamount}{7mm}
\setlength{\theorempostskipamount}{7mm}

\theoremstyle{plain}
\theorembodyfont{\normalfont}

\newtheorem{ejemplo}{Ejemplo}
\newtheorem{defi}{Definición}

\begin{document}

\chapter{Resol}

\begin{defi}[Polinomio característico]
Si $A$ es una matriz cuadrada de orden $n$, al polinomio
\end{defi}

\end{document}

• Welcome to TeX SX! What are you asking, exactly? – Bernard Dec 17 '16 at 0:17

Using thmtools, this is fairly straight forward:

\documentclass{article}

\usepackage{amsthm,mathpazo}
\usepackage{thmtools,xcolor}
\usepackage[utf8]{inputenc}

\colorlet{theoremnamecolor}{blue!30!black}
\colorlet{theoremnumbercolor}{red!80!black}
\declaretheoremstyle[
spaceabove = 7mm,
spacebelow = 7mm,
notefont = \color{theoremnamecolor}\normalfont\mdseries,
notebraces = {(}{)},
bodyfont = \normalfont\itshape
]{plain}

\theoremstyle{plain}

\newtheorem{defi}{Definición}[section]

\begin{document}

\section{A section}

\begin{defi}[Polinomio característico]
Si $A$ es una matriz cuadrada de orden $n$, al polinomio
\end{defi}

\end{document}

• Thank you the code is correct XD I dont speak english ..Merry Chritsmas – Dennis Miranda Dec 26 '16 at 0:43