3

I am writing in greek and I would like to create an enumerate list with custom alph or Alph label, by removing the accent after each letter so that "α'. " will become "α." etc. My attempt was this:

\documentclass[a4paper,11pt,twocolumn]{article}
\usepackage[no-math,cm-default]{fontspec}
\usepackage{xunicode}
\usepackage{xgreek}
\usepackage{enumitem}
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
\setmainfont[Mapping=tex-text,Numbers=Lining,Scale=1.0,BoldFont={Times New Roman Bold}]{Times New Roman}
%---------------------------------
\makeatletter
\renewcommand*{\@alph}[1]{%
  \ifcase#1\or α\or β\or γ\or
    δ\or ε\or στ\or ζ\or η\or θ\or ι\or κ\or
    λ\or μ\or ν\or ξ\or ο\or π\or ρ\or σ\or
    τ\or υ\or φ\or χ\or ψ\or
    ω\else\@ctrerr\fi
}
\renewcommand*{\@Alph}[1]{%
  \ifcase#1\or Α\or Β\or Γ\or
    Δ\or Ε\or ΣΤ\or Ζ\or Η\or Θ\or Ι\or Κ\or
    Λ\or Μ\or Ν\or Ξ\or Ο\or Π\or Ρ\or Σ\or
    Τ\or Υ\or Φ\or Χ\or Ψ\or
    Ω\else\@ctrerr\fi
}
\makeatother
%--------------------------------

\begin{document}
\begin{enumerate}[label=\alph*.]
\item \item \item \item \item \item \item \item \item \item \item 
\end{enumerate}
\begin{enumerate}[label=\Alph*.]
\item \item \item \item  \item \item \item \item \item \item \item
\end{enumerate}
\end{document}

But when I have a list with more than 10 items the enumeration is wrong. For example number 11 in greek numbering is "ια" and not "κ"(=20). How can I remove the accent without changing the sequence of the letters?

egreg
  • 1,121,712
mac
  • 1,479
  • Use ready-made things, do not re-invent the wheel (with bumpd). See also this question http://tex.stackexchange.com/questions/277117/how-to-create-a-list-with-numbering-greek-letters and this answer http://tex.stackexchange.com/questions/4058/greek-numbering/4069#4069 – Sir Cornflakes Aug 01 '16 at 10:10

1 Answers1

1

You can use the method suggested for Problem with changing enumeration

\documentclass[a4paper,11pt,twocolumn]{article}

\usepackage[no-math]{fontspec}
\usepackage{xgreek}
\usepackage{enumitem}
\usepackage{etoolbox}

\setmainfont[
  BoldFont={Times New Roman Bold},
]{Times New Roman}

\makeatletter
\renewrobustcmd{\anw@true}{\let\ifanw@\iftrue}
\renewrobustcmd{\anw@false}{\let\ifanw@\iffalse}\anw@false
\newrobustcmd{\noanw@true}{\let\ifnoanw@\iftrue}
\newrobustcmd{\noanw@false}{\let\ifnoanw@\iffalse}\noanw@false
\renewrobustcmd{\anw@print}{\ifanw@\ifnoanw@\else\numer@lsign\fi\fi}
\newrobustcmd{\noanw}{\noanw@true}
\makeatother


\begin{document}
\begin{enumerate}[label=\noanw\alph*.]
\item \item \item \item \item \item \item \item \item \item \item 
\end{enumerate}
\begin{enumerate}[label=\noanw\Alph*.]
\item \item \item \item  \item \item \item \item \item \item \item
\end{enumerate}
\end{document}

Note: I removed all the useless declarations in your code.

If you want to always suppress the numeral sign without using \noanw, change the code between \makeatletter and \makeatother into

\makeatletter
\renewrobustcmd{\anw@true}{\let\ifanw@\iffalse}
\renewrobustcmd{\anw@false}{\let\ifanw@\iffalse}\anw@false
\newrobustcmd{\noanw@true}{\let\ifnoanw@\iffalse}
\newrobustcmd{\noanw@false}{\let\ifnoanw@\iffalse}\noanw@false
\renewrobustcmd{\anw@print}{\ifanw@\ifnoanw@\else\numer@lsign\fi\fi}
\makeatother

enter image description here

egreg
  • 1,121,712
  • That's exactly what I want to do. And this way we keep the correct order of the greek numbering letters. This can be used for any similar modification. – mac Aug 01 '16 at 10:25