How to write $\pi_1$ [duplicate]

I am writing an article and I need to write the fundamental group. For that we use $\pi_1\left(X,x_0\right)$. However I am arriving at the following error:

Use of \pi doesn't match its definition.
l.113 This shall be denoted by $\pi_ {1}(X,x_0)$ or simply $\pi_1\left(X\right)$.


My Code is given below.

\documentclass[psamsfonts]{amsart}

%-------Packages---------
\usepackage{amssymb,amsfonts}
\usepackage[all,arc]{xy}
\usepackage{enumerate}
\usepackage{mathrsfs}
\usepackage{amsmath}
%\usepackage{mathtools}
%\usepackage[mtpscr]{mtpro2}
\makeatletter
\let\c@equation\c@thm
\makeatother

\DeclareMathOperator\pione{\pi_1}
\DeclareMathOperator{\pi1et}{\pi^{\'et}_1}

\newcommand {\sub}{\mbox{SB}}

\begin{document}

Given a "nice" topological space $\left(X, x_0\right)$, we define the fundamental group to be $\left[S^1, (X, x_0)\right]_{\star}$.
This shall be denoted by $\pi_{1}(X,x_0)$ or simply $\left(X\right)$.

\end{document}

• welcome to tex.sx. unfortunately, the brief snippet of code that you provide isn't enough to diagnose the problem. (other than the fact that \left and \right aren't needed, the math expression looks to be input correctly. all i can think of is that somehow, \pi has been redefined from its basic meaning. please provide a small compilable example (beginning with \documentclass and ending with \end{document}) that results in the error you have quoted. then people here will have the information they need to experiment. – barbara beeton Jul 28 '17 at 20:07
• Welcome to TeX.SX! A tip: If you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it). – Heiko Oberdiek Jul 28 '17 at 20:27

Numbers are not allowed in macro names in LaTeX:

\DeclareMathOperator{\pi1et}{\pi^{\'et}_1}


This defines macro \pi that expects the parameter text 1et. Use a name like \pioneet to follow the naming scheme of the previous operator:

\DeclareMathOperator{\pioneet}{...}


BTW, \' is a text mode command that is invalid in math mode. Either use text if ét is used as word:

\pi^{\text{\'et}}


or math, if the accent has mathematical meaning:

\pi^{\acute{e}t}


Is it possible that you are looking for something like:

\documentclass{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\begin{document}

For that we use $\pi _1(X,x_0)$.

For that we use ${\pi}_1(X,x_0)$.

For that we use $\pi{}_1(X,x_0)$.

\end{document}

• The error message shows that TeX has successfully parsed \pi as command name. The problem is the definition \DeclareMathOperator{\pi1et}{...}. 1et is now a mandatory parameter text and TeX expects 1 as next token after \pi. – Heiko Oberdiek Jul 28 '17 at 20:36
• Now, with the added example of the problem, your solution is obvious. – Typo Jul 28 '17 at 22:07