更改枚举的问题

更改枚举的问题

我想使用包将环境中的标准枚举(阿拉伯数字)更改enumeration为希腊小写字母enumitem

我也使用XeLateX引擎来编译我的文档。问题是,当我使用

\documentclass{article}
\usepackage{fontspec,xgreek,enumitem}
\defaultfontfeatures{Mapping=tex-text}
\setromanfont[Mapping=tex-text]{GFS Artemisia}

\usepackage{polyglossia}
\setdefaultlanguage{english}
\setotherlanguage[variant=modern]{greek}

\begin{document}    
\begin{enumerate}[label=\let\textdexiakeraia\relax(\alph*)]
      \item bla bla 
      \item bla bla
    \end{enumerate}
\end{document}

我收到以下错误(来自我的日志文件):

! Undefined control sequence.
\labelenumi ->\let \textdexiakeraia 
                                    \relax (\alph *)
l.120 ...label=\let\textdexiakeraia\relax(\alph*)]

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

LaTeX Info: Redefining \anw@print on input line 121.
LaTeX Font Info:    Font shape `EU1/GFSArtemisia(0)/m/sl' in size <10.95> not a
vailable
(Font)              Font shape `EU1/GFSArtemisia(0)/m/it' tried instead on inpu
t line 122.

label=(\alph*)但是,当我仅使用选项时,没有出现任何错误。

答案1

xgreek包以一种相当扭曲的方式定义希腊数字,这使得改变表示形式变得困难。

以下是应该可以更好地运行的代码允许通过省略数字符号来本地改变表示形式。

\documentclass{article}
\usepackage{fontspec,xgreek,enumitem}
\setmainfont{GFS Artemisia}

\usepackage{polyglossia}
\setdefaultlanguage{english}
\setotherlanguage[variant=modern]{greek}

\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 bla bla bla
\item bla bla
\end{enumerate}

\end{document}

在此处输入图片描述

相关内容