投影机中的高棉语页码

投影机中的高棉语页码

我刚刚翻译光泽-khmer.ldf,这是多语包。我曾尝试将其与投影机使用主题的课程马德里. 定理数显示为高棉语但最后一页的页码仍然是阿拉伯号码。那么我怎样才能将最后一页的页码从阿拉伯高棉语? 这是我的梁默高棉语

\documentclass[xetex,serif]{beamer}

\setbeamertemplate{theorems}[numbered]

\usetheme{Madrid}

\usepackage{polyglossia}
\newfontfamily\khmerfont[Script=Khmer]{Khmer OS}
\setdefaultlanguage[numerals=khmer]{khmer}
\XeTeXlinebreaklocale “KHM”

\begin{document}
    \begin{frame}
        \begin{theorem}
            Please see the bottom right conner\newline
            [\alert{current page in Khmer}]/[\alert{last page in Arabic}]\newline
        \end{theorem}
    \end{frame}
    \begin{frame}
        \begin{theorem}
            How can I change the \alert{last page} from Arabic to Khmer?
        \end{theorem}
    \end{frame}
\end{document}

这是我的光泽-khmer.ldf

\ProvidesFile{gloss-khmer.ldf}[polyglossia: module for Khmer]
\PolyglossiaSetup{khmer}{
  script=Khmer,
  scripttag=khmr,
  langtag=KHM,
  hyphennames={nohyphenation},
  fontsetup=true,
  %TODO localalph={xxx@alph,xxx@Alph}
  %TODO localdigits=khmernumber
}

\newif\if@khmer@numerals
\def\tmp@khmer{khmer}
\define@key{khmer}{numerals}[arabic]{%
    \def\@tmpa{#1}%
    \ifx\@tmpa\tmp@khmer\@khmer@numeralstrue\else
      \@khmer@numeralsfalse\fi
}

\setkeys{khmer}{numerals}

\def\captionskhmer{%
  \def\prefacename{អារម្ភកថា}%
  \def\refname{ឯកសារយោង}%
  \def\abstractname{សង្ខេប}%
  \def\bibname{គន្ថនិទ្ទេស}%
  \def\chaptername{ជំពួក}%
  \def\appendixname{បន្ថែម}%
  \def\contentsname{មាតិការ}%
  \def\listfigurename{បញ្ជីរូបភាព}%
  \def\listtablename{បញ្ជីតារាង}%
  \def\indexname{សន្ទស្សន៍}%
  \def\figurename{រូប}%
  \def\tablename{តារាង}%
  \def\partname{ផ្នែក}%
  \def\pagename{ទំព័រ}%
  \def\seename{មើល}%
  \def\alsoname{មើលបន្ថែម}%
  \def\enclname{ឯកសារភ្ជាប់}%
  \def\ccname{ចម្លងជួន}%
  \def\headtoname{ផ្ញើរទៅ}%
  \def\proofname{សម្រាយ}%
  \def\glossaryname{សទានុក្រម}% 
}
\def\datekhmer{%   
   \def\khmer@month{%
     \ifcase\month\or
      មករា\or
      កុម្ភៈ\or
      មិនា\or
      មេសា\or
      ឧសភា\or
      មិថុនា\or
      កក្ដដា\or
      សីហា\or
      កញ្ញា\or
      តុលា\or
      វិច្ឆិកា\or
      ធ្នូ\fi}%
   \def\today{\khmernumber\day \space \khmer@month \space \khmernumber\year}%
}

\def\khmerdigits#1{\expandafter\@khmer@digits #1@}
\def\@khmer@digits#1{%
  \ifx @#1% then terminate
  \else
    \ifx0#1០\else\ifx1#1១\else\ifx2#1២\else\ifx3#1៣\else\ifx4#1៤\else\ifx5#1៥\else\ifx6#1៦\else\ifx7#1៧\else\ifx8#1៨\else\ifx9#1៩\else#1\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
    \expandafter\@khmer@digits
  \fi
}

\def\khmernumber#1{%
  \if@khmer@numerals
    \khmerdigits{\number#1}%
  \else
    \number#1%
  \fi}

\def\khmer@globalnumbers{%
   \let\orig@arabic\@arabic%
   \let\@arabic\khmernumber%
   \renewcommand{\thefootnote}{\protect\khmernumber{\c@footnote}}%
}
\def\nokhmer@globalnumbers{%
   \let\@arabic\orig@arabic%
   \renewcommand\thefootnote{\protect\number{\c@footnote}}%
}

\endinput

这是下载高棉字体的链接

答案1

终于找到了:) 总帧数其实是存储在控制序列中的\inserttotalframenumber,其定义在beamerbasemisc.sty。为了解决这个问题,我需要在我的光泽-khmer.ldf文件:

\@ifclassloaded{beamer}{%
    \AtEndDocument{%
        \immediate\write\@auxout{\string\@writefile{nav}%
            {\noexpand\headcommand{\noexpand\def\noexpand\inserttotalframenumber{\khmernumber{\the\c@framenumber}}}}}
    }
}{}

相关内容