解决Sagemath Latex输出渲染错误

在jupyter notebook中使用sagemath,并且使用%display latex输出时,出现

ParseError: KaTeX parse error: \newcommand{\Bold} attempting to redefine \Bold; use \renewcommand

解决

from sage.misc.latex_macros import sage_configurable_latex_macros
global sage_configurable_latex_macros
marco = "\\newcommand{\\Bold}[1]{\\mathbf{#1}}"
if marco in sage_configurable_latex_macros: sage_configurable_latex_macros.remove(marco)

解决Sagemath Latex输出渲染错误
https://yzzzf.xyz/2023/11/17/sagemath-KaTex-error/
Author
Zifan Ying
Posted on
November 16, 2023
Licensed under