5

I have an enumerate environment defined as:

\begin{enumerate}[\hspace{0.5cm} a)]
    \item blablabla
\end{enumerate}

And as intended it enumerates using letters. But, since my document is in spanish, after the n it enumerates using an ñ ('eɲe' or 'énye', phonetically). I want it to use the standard alphabet (ñ is not ussually used to enumerate in our culture). I don't really want to use \stepcounter{enumi} since it's a machine generated tex code.

2

One way is to grab with \let the original \@alph macro before babel comes into action and redefines \@alph to provide the specific additions according to the letters of Spanish language.

At the begin of enumerate environment this can be changed back to the original (pre-babel) version. However, this would change any occurence of \@alph as well.

\documentclass{article}

\makeatletter

\let\@alphorig\@alph
\makeatother
\usepackage{etoolbox}
\usepackage{enumerate}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}


\makeatletter
\AtBeginEnvironment{enumerate}{%
  \let\@alph\@alphorig
}
\makeatother



\begin{document}
\begin{enumerate}[\hspace{0.5cm} a)]
    \item blablabla
    \item blablabla
    \item blablabla
    \item blablabla
    \item blablabla
    \item blablabla
    \item blablabla
    \item blablabla
    \item blablabla
    \item blablabla
    \item blablabla
    \item blablabla
    \item blablabla
    \item blablabla
    \item blablabla
    \item blablabla
    \item blablabla
    \item blablabla
    \item blablabla
    \item blablabla
    \item blablabla
    \item blablabla
    \item blablabla
    \item blablabla
    \item blablabla
    \item blablabla
\end{enumerate}

\end{document}

enter image description here

2

A crude solution is to add the option es-nolayout, that also changes other typographical aspects (see texdoc spanish).

\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[spanish,es-nolayout]{babel}

\begin{document}

\begin{enumerate}
\item Outer
  \begin{enumerate}
  \item Inner
  \item b
  \setcounter{enumii}{12} % just to keep it short
  \item m
  \item n
  \item o
  \item p
  \item q
  \end{enumerate}
\item Outer
\end{enumerate}

\end{document}

A more on target approach, just removing “ñ” and “Ñ” from the alphabetical numbering can be obtained with etoolbox.

\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage{etoolbox}

\makeatletter
\patchcmd{\@alph}{\~n\or}{}{}{}
\patchcmd{\@Alph}{\~N\or}{}{}{}
\makeatother

\begin{document}

\begin{enumerate}
\item Outer
  \begin{enumerate}
  \item Inner
  \item b
  \setcounter{enumii}{12} % just to keep it short
  \item m
  \item n
  \item o
  \item p
  \item q
  \end{enumerate}
\item Outer
\end{enumerate}

\end{document}

This works also with enumitem or enumerate features (I suggest using the former package, which is much more powerful and flexible).

enter image description here

It's a good idea to address a feature request to Javier Bezos, the maintainer of babel-spanish.

  • I tried an approach where I switch the language with´\begin{otherlanguage}{english}´ for the list. But the special n still appears. Didn't thought that it's so complicated :). – Dr. Manuel Kuehner Mar 15 '17 at 1:17
1

Under enumitem you can define the enumeration label. For example, using \noNalph as defined below:

enter image description here

\documentclass{article}

\usepackage[spanish]{babel}
\usepackage{enumitem}

\DeclareRobustCommand{\noNalph}[1]{\ifnum\value{#1}=15 \refstepcounter{#1}\fi \alph{#1}}

\begin{document}

\begin{enumerate}[label={\noNalph{enumi})}]
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
\end{enumerate}

\end{document}

In a more general setting, you can also define the sequence of enumeration manually:

\documentclass{article}

\usepackage[spanish]{babel}
\usepackage{enumitem}

\makeatletter
\DeclareRobustCommand{\noNalph}[1]{\ifcase\value{#1}% 0
  %   1    2    3    4    5    6    7    8    9   10   11   12   13
  \or a\or b\or c\or d\or e\or f\or g\or h\or i\or j\or k\or l\or m%
  %  14   15   16   17   18   19   20   21   22   23   24   25   26
  \or n\or o\or p\or q\or r\or s\or t\or u\or v\or w\or x\or y\or z%
  \else\@ctrerr\fi}
\makeatother

\begin{document}

\begin{enumerate}[label={\noNalph{enumi})}]
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
  \item blablabla
\end{enumerate}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.