1

I am trying to add a colon after item number in enumerated list but this produces an error.

Here is my normal MWE:

\documentclass[a4paper]{article} 
\usepackage[utf8]{inputenc}%
\usepackage[T1]{fontenc}%
\newenvironment{xenumerate}%
{\begin{enumerate}\renewcommand\labelenumi{§\theenumi}}%
{\end{enumerate}}%
\begin{document} 
\begin{xenumerate}
\item first
\item second
\end{xenumerate} 
\end{document}

Works like a charm. When I add colon after it it produces different errors:

\documentclass[a4paper]{article} 
\usepackage[utf8]{inputenc}%
\usepackage[T1]{fontenc}%
\newenvironment{xenumerate}%
{\begin{enumerate}\renewcommand\labelenumi{§\theenumi\colon}}%
{\end{enumerate}}%
\begin{document} 
\begin{xenumerate}
\item first
\item second
\end{xenumerate} 
\end{document}

Anyone has an idea how I solve this but without using packages like enumerate and enumitem because they clash with some other things I have?

stx932
  • 950

1 Answers1

3

The following MWE should give you the desired result. You can sinply use : instead of \colon which is a 'punctuation colon' in math mode and therefor does not work in text mode.

\documentclass[a4paper]{article} 
\usepackage[utf8]{inputenc}%
\usepackage[T1]{fontenc}%
\newenvironment{xenumerate}%
{\begin{enumerate}\renewcommand\labelenumi{§\theenumi:}}%
{\end{enumerate}}%
\begin{document} 
\begin{xenumerate}
\item first
\item second
\end{xenumerate} 
\end{document}

enter image description here

leandriis
  • 62,593