enumeration
我想使用 package.json 更改具有希臘小寫字母的環境中的標準枚舉(阿拉伯數字)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}