Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

一个因未知原因而产生的奇怪报错, 未在用户群得到答案 #231

Closed
SakuraiMeteroa opened this issue Nov 27, 2022 · 1 comment

Comments

@SakuraiMeteroa
Copy link

准备在VSCode上使用ElegantBook模板写一个新的笔记时, 根据个人以往习惯, 于导言区使用了如下命令 :
\usepackage{xeCJK,amssymb,amsmath,extarrows,mathrsfs,tikz,latexsym,inputenc,yhmath,graphicx}
\usetikzlibrary{graphs}
\usetikzlibrary{cd}
\makeatletter
\newcommand{\rmnum}[1]{\romannumeral #1}
\newcommand{\Rmnum}[1]{\expandafter@slowromancap\romannumeral #1@}
编译后出现了如下报错 (以往在VSCode上使用ElegantBook模板写笔记时, 并未出现该报错):
image
点记报错提示后显示内容为
image
想知道报错产生的原因及解决办法, 谢谢!

@syvshc
Copy link
Contributor

syvshc commented Nov 27, 2022

首先不要有个人习惯, 宏包按需加载, 然后涉及的 yhmath 的问题, 请阅读手册以下部分

另外在 3.08 版本中,有用户反馈模板在和 \lstinline{yhmath} 以及 \lstinline{esvect} 等宏包搭配使用的时候会出现报错:
\begin{lstlisting}
LaTeX Error:
Too many symbol fonts declared.
\end{lstlisting}
原因是在使用 \lstinline{newtxmath} 宏包时,重新定义了数学字体用于大型操作符,达到了 {\heiti 最多 16 个数学字体} 的上限,在调用其他宏包的时候,无法新增数学字体。为了减少调用非常用宏包,在此给出如何调用 \lstinline{yhmath} 以及 \lstinline{esvect} 宏包的方法。
请在 \lstinline{elegantbook.cls} 内搜索 \lstinline{yhmath} 或者 \lstinline{esvect},将你所需要的宏包加载语句\textit{取消注释}即可。
\begin{lstlisting}
%%% use yhmath pkg, uncomment following code
% \let\oldwidering\widering
% \let\widering\undefined
% \RequirePackage{yhmath}
% \let\widering\oldwidering
%%% use esvect pkg, uncomment following code
% \RequirePackage{esvect}
\end{lstlisting}

@syvshc syvshc closed this as completed Nov 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants