通过 **babyloniannum** 对环境进行索引枚举会出现错误

通过 **babyloniannum** 对环境进行索引枚举会出现错误

我尝试像这样索引我的句子:

\renewcommand{\theenumi}{\roman{enumi}--\arabic{enumi}--\babyloniannum{enumi}}

MWE 示例是这样的:但它给出了如下所示的错误:

\documentclass{article}

\usepackage{amssymb,amsmath}
\usepackage{tikz-cd}
\usepackage{xypic}
\usepackage[czech]{babel}
\usepackage[utf8]{inputenc}

\newcommand{\pullbackcorner}[1][dl]{\save*!/#1-1pc/#1:(1,-1)@^{|-}\restore}
\usepackage[all]{xy}

\usepackage{pgffor}
\usepackage{babyloniannum}

\renewcommand{\theenumi}{\roman{enumi}--\arabic{enumi}--\babyloniannum{enumi}}

\begin{document}
\underline{motto:}{ každý den $\pm$ nový princip }\hfill{$\square$}
\\
\\
\begin{enumerate}
\item rozhodovat se na hraně zajímavého
\item *vždycky to tam máš (data v matematice)
\end{enumerate}
\end{document}

但是 xelatex 说

Command Line:   D:\ProgramFiles\MikTexNEW\miktex\bin\x64\xelatex.exe --interaction=errorstopmode --synctex=-1 "ideje.tex"
Startup Folder: C:\Users\hynek0\Desktop\TH0dipl

This is XeTeX, Version 3.14159265-2.6-0.999991 (MiKTeX 2.9.7050 64-bit)
entering extended mode
(ideje.tex
LaTeX2e <2018-12-01>
(D:\ProgramFiles\MikTexNEW\tex/latex/base\article.cls
Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
(D:\ProgramFiles\MikTexNEW\tex/latex/base\size10.clo))
(D:\ProgramFiles\MikTexNEW\tex/latex/amsfonts\amssymb.sty
(D:\ProgramFiles\MikTexNEW\tex/latex/amsfonts\amsfonts.sty))
(D:\ProgramFiles\MikTexNEW\tex/latex/amsmath\amsmath.sty
For additional information on amsmath, use the `?' option.
(D:\ProgramFiles\MikTexNEW\tex/latex/amsmath\amstext.sty
(D:\ProgramFiles\MikTexNEW\tex/latex/amsmath\amsgen.sty))
(D:\ProgramFiles\MikTexNEW\tex/latex/amsmath\amsbsy.sty)
(D:\ProgramFiles\MikTexNEW\tex/latex/amsmath\amsopn.sty))
(D:\ProgramFiles\MikTexNEW\tex/latex/tikz-cd\tikz-cd.sty
(D:\ProgramFiles\MikTexNEW\tex/latex/pgf/frontendlayer\tikz.sty
(D:\ProgramFiles\MikTexNEW\tex/latex/pgf/basiclayer\pgf.sty
(D:\ProgramFiles\MikTexNEW\tex/latex/pgf/utilities\pgfrcs.sty
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/utilities\pgfutil-common.tex
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/utilities\pgfutil-common-lists.tex))
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/utilities\pgfutil-latex.def
(D:\ProgramFiles\MikTexNEW\tex/latex/ms\everyshi.sty))
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/utilities\pgfrcs.code.tex
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf\pgf.revision.tex)))
(D:\ProgramFiles\MikTexNEW\tex/latex/pgf/basiclayer\pgfcore.sty
(D:\ProgramFiles\MikTexNEW\tex/latex/graphics\graphicx.sty
(D:\ProgramFiles\MikTexNEW\tex/latex/graphics\keyval.sty)
(D:\ProgramFiles\MikTexNEW\tex/latex/graphics\graphics.sty
(D:\ProgramFiles\MikTexNEW\tex/latex/graphics\trig.sty)
(D:\ProgramFiles\MikTexNEW\tex/latex/graphics-cfg\graphics.cfg)
(D:\ProgramFiles\MikTexNEW\tex/latex/graphics-def\xetex.def)))
(D:\ProgramFiles\MikTexNEW\tex/latex/pgf/systemlayer\pgfsys.sty
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/systemlayer\pgfsys.code.tex
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/utilities\pgfkeys.code.tex
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/utilities\pgfkeysfiltered.code.tex))
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/systemlayer\pgf.cfg)
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/systemlayer\pgfsys-xetex.def
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/systemlayer\pgfsys-dvipdfmx.def
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/systemlayer\pgfsys-common-pdf.def)))
)
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/systemlayer\pgfsyssoftpath.code.tex)
 (D:\ProgramFiles\MikTexNEW\tex/generic/pgf/systemlayer\pgfsysprotocol.code.tex
)) (D:\ProgramFiles\MikTexNEW\tex/latex/xcolor\xcolor.sty
(D:\ProgramFiles\MikTexNEW\tex/latex/graphics-cfg\color.cfg))
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/basiclayer\pgfcore.code.tex
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/math\pgfmath.code.tex
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/math\pgfmathcalc.code.tex
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/math\pgfmathutil.code.tex)
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/math\pgfmathparser.code.tex)
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/math\pgfmathfunctions.code.tex
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/math\pgfmathfunctions.basic.code.tex
)
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/math\pgfmathfunctions.trigonometric.
code.tex)
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/math\pgfmathfunctions.random.code.te
x)
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/math\pgfmathfunctions.comparison.cod
e.tex)
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/math\pgfmathfunctions.base.code.tex)

(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/math\pgfmathfunctions.round.code.tex
)
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/math\pgfmathfunctions.misc.code.tex)

(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/math\pgfmathfunctions.integerarithme
tics.code.tex)))
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/math\pgfmathfloat.code.tex))
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/math\pgfint.code.tex)
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/basiclayer\pgfcorepoints.code.tex)
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/basiclayer\pgfcorepathconstruct.code
.tex)
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/basiclayer\pgfcorepathusage.code.tex
) (D:\ProgramFiles\MikTexNEW\tex/generic/pgf/basiclayer\pgfcorescopes.code.tex)

(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/basiclayer\pgfcoregraphicstate.code.
tex)
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/basiclayer\pgfcoretransformations.co
de.tex)
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/basiclayer\pgfcorequick.code.tex)
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/basiclayer\pgfcoreobjects.code.tex)
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/basiclayer\pgfcorepathprocessing.cod
e.tex)
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/basiclayer\pgfcorearrows.code.tex)
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/basiclayer\pgfcoreshade.code.tex)
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/basiclayer\pgfcoreimage.code.tex
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/basiclayer\pgfcoreexternal.code.tex)
) (D:\ProgramFiles\MikTexNEW\tex/generic/pgf/basiclayer\pgfcorelayers.code.tex)

(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/basiclayer\pgfcoretransparency.code.
tex)
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/basiclayer\pgfcorepatterns.code.tex)
 (D:\ProgramFiles\MikTexNEW\tex/generic/pgf/basiclayer\pgfcorerdf.code.tex)))
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/modules\pgfmoduleshapes.code.tex)
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/modules\pgfmoduleplot.code.tex)
(D:\ProgramFiles\MikTexNEW\tex/latex/pgf/compatibility\pgfcomp-version-0-65.sty
)
(D:\ProgramFiles\MikTexNEW\tex/latex/pgf/compatibility\pgfcomp-version-1-18.sty
)) (D:\ProgramFiles\MikTexNEW\tex/latex/pgf/utilities\pgffor.sty
(D:\ProgramFiles\MikTexNEW\tex/latex/pgf/utilities\pgfkeys.sty
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/utilities\pgfkeys.code.tex))
(D:\ProgramFiles\MikTexNEW\tex/latex/pgf/math\pgfmath.sty
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/math\pgfmath.code.tex))
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/utilities\pgffor.code.tex
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/math\pgfmath.code.tex)))
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/frontendlayer/tikz\tikz.code.tex
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/libraries\pgflibraryplothandlers.cod
e.tex)
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/modules\pgfmodulematrix.code.tex)
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/frontendlayer/tikz/libraries\tikzlib
rarytopaths.code.tex)))
(D:\ProgramFiles\MikTexNEW\tex/latex/tikz-cd\tikzlibrarycd.code.tex
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/frontendlayer/tikz/libraries\tikzlib
rarymatrix.code.tex)
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/frontendlayer/tikz/libraries\tikzlib
raryquotes.code.tex)
(D:\ProgramFiles\MikTexNEW\tex/generic/pgf/libraries\pgflibraryarrows.meta.code
.tex))) (D:\ProgramFiles\MikTexNEW\tex/generic/xypic\xypic.sty
(D:\ProgramFiles\MikTexNEW\tex/generic/xypic\xy.sty
(D:\ProgramFiles\MikTexNEW\tex/generic/xypic\xy.tex Bootstrap'ing: catcodes,
docmode, (D:\ProgramFiles\MikTexNEW\tex/generic/xypic\xyrecat.tex)
(D:\ProgramFiles\MikTexNEW\tex/generic/xypic\xyidioms.tex)

 Xy-pic version 3.8.9 <2013/10/06>
 Copyright (c) 1991-2013 by Kristoffer H. Rose <[email protected]> and others
 Xy-pic is free software: see the User's Guide for details.

Loading kernel: messages; fonts; allocations: state, direction,
utility macros; pictures: \xy, positions, objects, decorations;
kernel objects: directionals, circles, text; options; algorithms: directions,
edges, connections;  Xy-pic loaded)
(D:\ProgramFiles\MikTexNEW\tex/generic/oberdiek\ifpdf.sty)

LaTeX Warning: You have requested package `xypic',
               but the package provides `xy'.

) (D:\ProgramFiles\MikTexNEW\tex/generic/xypic\xyv2.tex
 Xy-pic option: Version 2 Compatibility v.3.8

Xy-pic Warning: `\stop' redefined.

(D:\ProgramFiles\MikTexNEW\tex/generic/xypic\xyframe.tex
 Xy-pic option: Frame and Bracket extension v.3.14 loaded)
(D:\ProgramFiles\MikTexNEW\tex/generic/xypic\xymatrix.tex
 Xy-pic option: Matrix feature v.3.14 loaded)
(D:\ProgramFiles\MikTexNEW\tex/generic/xypic\xyarrow.tex
 Xy-pic option: Arrow and Path feature v.3.9 path, \ar, loaded) loaded))
(D:\ProgramFiles\MikTexNEW\tex/generic/babel\babel.sty
(D:\ProgramFiles\MikTexNEW\tex/generic/babel\switch.def)
*************************************
* Local config file bblopts.cfg used
*
(D:\ProgramFiles\MikTexNEW\tex/latex/arabi\bblopts.cfg)
(D:\ProgramFiles\MikTexNEW\tex/latex/babel-czech\czech.ldf
(D:\ProgramFiles\MikTexNEW\tex/generic/babel\babel.def
(D:\ProgramFiles\MikTexNEW\tex/generic/babel\xebabel.def
(D:\ProgramFiles\MikTexNEW\tex/generic/babel\txtbabel.def)))))
(D:\ProgramFiles\MikTexNEW\tex/latex/base\inputenc.sty

Package inputenc Warning: inputenc package ignored with utf8 based engines.

) (D:\ProgramFiles\MikTexNEW\tex/generic/xypic\xy.sty
(D:\ProgramFiles\MikTexNEW\tex/generic/xypic\xy.tex not reloaded)
(D:\ProgramFiles\MikTexNEW\tex/generic/xypic\xyall.tex
 Xy-pic option: All features v.3.8
(D:\ProgramFiles\MikTexNEW\tex/generic/xypic\xycurve.tex
 Xy-pic option: Curve and Spline extension v.3.12 curve, circles, loaded)
(D:\ProgramFiles\MikTexNEW\tex/generic/xypic\xycmtip.tex
 Xy-pic option: Computer Modern tip extension v.3.7
(D:\ProgramFiles\MikTexNEW\tex/generic/xypic\xytips.tex
 Xy-pic option: More Tips extension v.3.11 loaded) loaded)
(D:\ProgramFiles\MikTexNEW\tex/generic/xypic\xyline.tex
 Xy-pic option: Line styles extension v.3.10 loaded)
(D:\ProgramFiles\MikTexNEW\tex/generic/xypic\xyrotate.tex
 Xy-pic option: Rotate and Scale extension v.3.8 loaded)
(D:\ProgramFiles\MikTexNEW\tex/generic/xypic\xycolor.tex
 Xy-pic option: Colour extension v.3.11 loaded)
(D:\ProgramFiles\MikTexNEW\tex/generic/xypic\xygraph.tex
 Xy-pic option: Graph feature v.3.11 loaded) loaded))
(D:\ProgramFiles\MikTexNEW\tex/xelatex/babyloniannum\babyloniannum.sty
(D:\ProgramFiles\MikTexNEW\tex/latex/fontspec\fontspec.sty
(D:\ProgramFiles\MikTexNEW\tex/latex/l3packages/xparse\xparse.sty
(D:\ProgramFiles\MikTexNEW\tex/latex/l3kernel\expl3.sty
(D:\ProgramFiles\MikTexNEW\tex/latex/l3kernel\expl3-code.tex)
(D:\ProgramFiles\MikTexNEW\tex/latex/l3backend\l3backend-xdvipdfmx.def)))
(D:\ProgramFiles\MikTexNEW\tex/latex/fontspec\fontspec-xetex.sty
(D:\ProgramFiles\MikTexNEW\tex/latex/base\fontenc.sty
(D:\ProgramFiles\MikTexNEW\tex/latex/base\tuenc.def))
(D:\ProgramFiles\MikTexNEW\tex/latex/fontspec\fontspec.cfg)))
(D:\ProgramFiles\MikTexNEW\tex/xelatex/xunicode\xunicode.sty
*** you should *not* be loading the inputenc package
*** XeTeX expects the source to be in UTF8 encoding
*** some features of other encodings may conflict, resulting in poor output.
(D:\ProgramFiles\MikTexNEW\tex/latex/tipa\t3enc.def))
(D:\ProgramFiles\MikTexNEW\tex/latex/numname\numname.sty)) (ideje.aux)
(D:\ProgramFiles\MikTexNEW\tex/latex/tipa\t3cmr.fd)
ABD: EveryShipout initializing macros
*** you should *not* be loading the inputenc package
*** XeTeX expects the source to be in UTF8 encoding
*** some features of other encodings may conflict, resulting in poor output.
(D:\ProgramFiles\MikTexNEW\tex/latex/amsfonts\umsa.fd)
(D:\ProgramFiles\MikTexNEW\tex/latex/amsfonts\umsb.fd)
Underfull \hbox (badness 10000) in paragraph at lines 31--34


Underfull \hbox (badness 10000) in paragraph at lines 31--34

)
! Incomplete \iffalse; all text was ignored after line 35.
<inserted text> 
                \fi 
<*> ./ideje.tex

? 


_____________________________________________________________________

 PDFLaTeX Compilation Report (Pages: 0)

 Errors: 0   Warnings: 2   Bad Boxes: 0
_____________________________________________________________________

答案1

MWE 可以简化为

\documentclass{article}
\usepackage{babyloniannum}

\renewcommand{\theenumi}{\babyloniannum{enumi}}

\begin{document}

\begin{enumerate}
\item rozhodovat se na hraně zajímavého
\end{enumerate}

\end{document}

有两个问题。一个是在包中,一个是在代码中。

按照定义,是\babyloniannum脆弱的,因此不能通过 用作计数器表示\the<counter>。通过添加 可以解决这个问题\MakeRobust\babyloniannum

但是,该命令需要一个数字作为其参数,而不是计数器的名称。请参阅代码以了解解决方案。

\documentclass{article}
\usepackage{babyloniannum}

\MakeRobust\babyloniannum

\renewcommand{\theenumi}{\babyloniannum{\value{enumi}}}

\begin{document}

\show\babyloniannum

\begin{enumerate}
\item rozhodovat se na hraně zajímavého
\end{enumerate}

\end{document}

在此处输入图片描述

哦!有一个不需要的空格!

https://tex.stackexchange.com/a/473205/4427为了这。

一组略有不同的更改,还允许选择不同的字体;在这里我利用这一点是为了不将 Santakku 安装为系统字体。如果没有定义\babylonianfont,则包将调用 Santakku,期望它可用于操作系统。

文件babyloniannum-fixed.sty

\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{babyloniannum-fixed}
    [2011/08/19 0.5 Typeset Babylonian numerals with XeTeX and LuaTeX]
\RequirePackage{fontspec}
\RequirePackage{numname}

\AtBeginDocument{%
  \ifdefined\babylonianfont\else
    \newfontface{\babylonianfont}{Santakku}%
  \fi
}

\newcommand{\unicodedisp}[1]{\symbol{"#1}}
\newcommand{\babylonian}[1]{\babyloniannum{\arabic{#1}}}
\newcommand{\babylonianglyph}[1]{%
  \ifnum #1>\z@ % glyph is not zero
    \chardef\m@mten=10 % cuts by units of 10
    \numdigits{#1}% parse number
    \ifcase\c@xsm@mctr
    \or
      \unicodedisp{1230B}%10
    \or
      \unicodedisp{1230B}\kern-0.15em{}\unicodedisp{1230B}%20 -- unknown?
    \or
      \unicodedisp{1230D}%30
    \or
      \unicodedisp{1240F}%40
    \or
      \unicodedisp{12410}%50
    \fi
    \ifnum \c@ism@mctr > \z@
      \ifnum \c@xsm@mctr > \z@
        \kern-0.5em{}% make glyphs closer
      \fi
    \fi %
    \ifcase\c@ism@mctr
    \or
      \unicodedisp{12079}%1
    \or
      \unicodedisp{1222B}%2
    \or
      \unicodedisp{12408}%3
    \or
      \unicodedisp{120FB}%4
    \or
      \unicodedisp{1240A}%5
    \or
      \unicodedisp{1240B}%6
    \or
      \unicodedisp{1240C}%7
    \or
      \unicodedisp{1240D}%8
    \or
      \unicodedisp{1240E}%9
    \fi
    \addtocounter{baby@glyphs}{1}%
  \else
    \ifnum\c@baby@glyphs > \z@
      \kern0.5em{}% empty space for zero
    \fi
  \fi
}
\newcounter{baby@ism@mctr}  % "units"
\newcounter{baby@xsm@mctr}  % "tens"
\newcounter{baby@csm@mctr}  % "hundreds"
\newcounter{baby@ksm@mctr}  % "thousands"
\newcounter{baby@xksm@mctr} % "ten thousands"
\newcounter{baby@cksm@mctr} % "hundred thousands"
\newcounter{baby@msm@mctr}  % "millions"
\newcounter{baby@xmsm@mctr} % "ten millions"
\newcounter{baby@cmsm@mctr} % "hundred millions"
\newcounter{baby@bsm@mctr}  % "billions"
\newcommand{\babylonian@setcounters}{%
  \setcounter{baby@ism@mctr}{\c@ism@mctr}%
  \setcounter{baby@xsm@mctr}{\c@xsm@mctr}%
  \setcounter{baby@csm@mctr}{\c@csm@mctr}%
  \setcounter{baby@ksm@mctr}{\c@ksm@mctr}%
  \setcounter{baby@xksm@mctr}{\c@xksm@mctr}%
  \setcounter{baby@cksm@mctr}{\c@cksm@mctr}%
  \setcounter{baby@msm@mctr}{\c@msm@mctr}%
  \setcounter{baby@xmsm@mctr}{\c@xmsm@mctr}%
  \setcounter{baby@cmsm@mctr}{\c@cmsm@mctr}%
  \setcounter{baby@bsm@mctr}{\c@bsm@mctr}%
}
\newcounter{baby@glyphs}
\DeclareRobustCommand{\babyloniannum}[1]{%
  \chardef\m@mten=60 % Cut by units of 60
  \numdigits{#1}% Parse number
  \babylonian@setcounters
  \mbox{\babylonianfont
    \setcounter{baby@glyphs}{0}%
    \babylonianglyph{\c@baby@bsm@mctr}%
    \babylonianglyph{\c@baby@cmsm@mctr}%
    \babylonianglyph{\c@baby@xmsm@mctr}%
    \babylonianglyph{\c@baby@msm@mctr}%
    \babylonianglyph{\c@baby@cksm@mctr}%
    \babylonianglyph{\c@baby@xksm@mctr}%
    \babylonianglyph{\c@baby@ksm@mctr}%
    \babylonianglyph{\c@baby@csm@mctr}%
    \babylonianglyph{\c@baby@xsm@mctr}%
    \babylonianglyph{\c@baby@ism@mctr}%
  }%
}
\endinput

示例文件

\documentclass{article}
\usepackage{babyloniannum-fixed}

\MakeRobust\babyloniannum

\renewcommand{\theenumi}{\babyloniannum{\value{enumi}}}

\newfontface{\babylonianfont}{Santakku}[
  Path=./,
  Extension=.ttf,
]

\begin{document}

\begin{enumerate}
\item rozhodovat se na hraně zajímavého
\end{enumerate}

\end{document}

相关内容