找回密码
 快速注册
搜索
查看: 53|回复: 1

equationautorefname已经被定义要怎么解决?

[复制链接]

413

主题

1558

回帖

1万

积分

积分
11498

显示全部楼层

abababa 发表于 2023-3-14 18:25 |阅读模式
本帖最后由 abababa 于 2023-3-14 21:35 编辑 my.tex的代码如下,省略了正文部分。
  1. \documentclass[12pt]{article}
  2. \usepackage{amsmath,bm,yhmath,amssymb,etoolbox,esvect,stmaryrd,cite,enumitem,extarrows,mathtools,ifthen}
  3. \usepackage{pgf,tikz}
  4. \usepackage[inline]{asymptote}
  5. \usepackage{tkz-euclide}
  6. \usepackage[amsmath, thmmarks]{ntheorem}
  7. {
  8.         \theoremstyle{nonumberplain}
  9.         \theoremheaderfont{\indent\bfseries}
  10.         \theorembodyfont{\normalfont}
  11.         \theoremsymbol{\ensuremath{\Box}}
  12.         \newtheorem{proof}{证明}
  13. }
  14. \newcommand\equationautorefname{公式}
  15. \begin{document}
  16. \end{document}
复制代码


代码如上,之前没加入asymptote包时没问题,加入这个包以后,先用xelatex my编译,然后用asy *.asy做出那些图,最后再用xelatex my编译。第一次编译时没出问题,第二次xelatex my时,就出现equationautorefname已经被定义的错误了,这个要怎么解决?

413

主题

1558

回帖

1万

积分

积分
11498

显示全部楼层

 楼主| abababa 发表于 2023-3-14 21:34
这个用renewcommand也不行,因为第一次编译时还没有定义,所以不能重定义。
最后的方法是调换引入包的顺序:
  1. \documentclass[12pt]{article}
  2. \usepackage{amsmath,bm,yhmath,amssymb,etoolbox,esvect,stmaryrd,cite,enumitem,extarrows,mathtools,ifthen}
  3. \usepackage[amsmath, thmmarks]{ntheorem}
  4. {
  5.         \theoremstyle{nonumberplain}
  6.         \theoremheaderfont{\indent\bfseries}
  7.         \theorembodyfont{\normalfont}
  8.         \theoremsymbol{\ensuremath{\Box}}
  9.         \newtheorem{proof}{证明}
  10. }
  11. \newcommand\equationautorefname{公式}
  12. \usepackage{pgf,tikz}
  13. \usepackage[inline]{asymptote}
  14. \usepackage{tkz-euclide}
  15. \begin{document}
  16. \end{document}
复制代码


把画图的那些全都调到最后面,这样能编译通过,暂时不知道会不会有其它问题。

手机版|悠闲数学娱乐论坛(第3版)

GMT+8, 2025-3-4 15:30

Powered by Discuz!

× 快速回复 返回顶部 返回列表