我如何删除数字符号?

我如何删除数字符号?

我用希腊语写作,我想创建一个enumerate自定义alphAlph标签的列表,通过删除每个字母后的重音符号,这样“α'。”就会变成“α。”等等。我的尝试是这样的:

\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}

但是当我的列表包含超过 10 个项目时,枚举就会出错。例如,希腊数字中的数字 11 是“ια”,而不是“κ”(=20)。如何在不改变字母顺序的情况下删除重音符号?

答案1

您可以使用建议的方法更改枚举的问题

\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}

注意:我删除了代码中所有无用的声明。

如果你想总是抑制数字符号而不使用,将和之间\noanw的代码改为\makeatletter\makeatother

\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

在此处输入图片描述

相关内容