# operator name for kernel

I'm trying to define \newcommand{\ker}{\operatorname{ker}} just after \begin{document} in order to have a nice way to write the kernel of an application but the command is ignored and I don't know why since I put \usepackage{amsmath}.

-

The amsmath package offers \ker:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

$X=\ker f.$

\end{document}


If you want an upper-cased variant, you can use \DeclareMathOperator:

\documentclass{article}
\usepackage{amsmath}

\DeclareMathOperator{\Ker}{Ker}

\begin{document}

$X=\Ker f.$

\end{document}


The syntax for \DeclareMathOperator is

\DeclareMathOperator{\xxx}{yyy}


and using \xxx in the document body will produce yyy in the proper font and will automatically add proper spacing on either side when necessary.

For new operators with subscripts and superscripts placed in "limits" position above and below, use the * form:

\DeclareMathOperator*{\xxx}{yyy}

-