unicode-math 並重新定義內建數學指令

unicode-math 並重新定義內建數學指令

我正在嘗試重新定義數學命令(比如說),以便它總是使用以下技巧\int做更多的事情(比如說):\int lolhttps://tex.stackexchange.com/a/47353/15659

,現在我想unicode-math在 LuaLaTeX 中使用該包,但它不再起作用了。


最小工作範例:

\documentclass[11pt,a4paper]{article}

\usepackage{unicode-math}

\let\oldint\int
\renewcommand\int{\oldint lol}

\begin{document}

\begin{equation}
\mathbf{B}\left(P\right)=\frac{\mu_0}{4\pi}\int\frac{\mathbf{I}\times\hat{r}'}{r'^2}dl
\end{equation}

\end{document}

答案1

unicode-math由於技術原因,與定義符號含義相關的大部分工作都是在開始文件中執行的。特別是,\int是其中定義的符號之一。所以使用

\AtBeginDocument{%
  \let\oldint\int
  \renewcommand\int{\oldint lol}%
}

相關內容