latex - ``\nabla'' 符号错误地显示为黑色光盘

标签 latex report symbolic-math tex calculus

我正在编写一份报告,其中包含一个涉及梯度的方程。所以我需要像这样打印出 nabla 符号:

The ideal nabla symbol I want

但实际上,当我尝试输入 nabla 符号时,我终于得到了一张黑色光盘:

The actual nabla symbol as a result

不知道是不是我代码的问题:

$\nabla_{w}\mathcal{L}(w, b, a)$

关于背景细节,我在macOS 10.14.6上使用TeXShop4.38,软件包如下:

\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{txfonts}
\usepackage{fdsymbol}
\usepackage{graphicx}
\graphicspath{{secret}}
\DeclareMathOperator*{\argmax}{argmax}
\DeclareMathOperator*{\argsup}{argsup}

谁能帮我解决这个问题吗?非常感谢!

最佳答案

您可以通过创建一个最小示例(即重现问题所需的最少量代码)来找到此类问题的根本原因。在你的情况下,这将是:

\documentclass{article}
\usepackage{fdsymbol}
\begin{document}
$\nabla_{w}\mathcal{L}(w, b, a)$
\end{document}

事实上,fdsymbol 的文档指出它不包含 \nabla 的符号。一种简单的解决方案是在fdsymbol之后加载txfonts。或者,您可以更新到更现代的 newtxtextnewtxmath:

\documentclass{article}
\usepackage[full]{textcomp}
\usepackage{fdsymbol}
\usepackage{newtxtext,newtxmath}
\begin{document}
$\nabla_{w}\mathcal{L}(w, b, a)$
\end{document}

结果:

enter image description here

注释:

  • 需要 textcomp,因为 dfdsymbolnewtxtext 加载具有不同的选项。
  • 您必须自行决定在这种情况下是否仍然需要 fdsymbol

关于latex - ``\nabla'' 符号错误地显示为黑色光盘,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58023304/

相关文章:

latex - 使用带有 markdown 的 pandoc 在第四个嵌套级别嵌套得太深?

latex - 如何在 Latex 中更改幻灯片上的图像?

.net - 在 .NET 中生成简单报告的模板引擎

matlab - fsolve 和solve/vpasolve 之间的区别

python - 同情运行时错误 : maximum recursion depth exceeded when solving equation with logarithms

r - knitr:在 do.call(grid.arrange, list_of_plots) 时禁止立即绘图

emacs latex Hook 未运行

css - 更改 APEX 5 经典报告中的排序图标

c# - 数据库集成和报告生成器

algorithm - 使用 symfun/subsindex 的 MATLAB 错误