我正在写论文的一章,我需要引用我在其中找到一个图片的网页。图片显示正常,我的问题出在标题上。我想我遇到了网址下划线的问题。浏览此网站时,我看到有人建议使用 hyperref 包,然后用 \url{} 将网址括起来。但是,我这样做了,仍然收到相同的“插入缺失 $”错误。我找不到任何其他解决方案来解决这个问题,我不确定我哪里出了问题,但非常感谢任何帮助。
'''
\documentclass{report}
\usepackage{graphicx}
\usepackage[hidelinks]{hyperref}
\def\UrlFont{\em}
\begin{document}
\chapter{A Brief Introduction}
\section{The first section}
Several paragraph intro
\subsection{The first subsection}
Several paragraph explanantion
\begin{figure}
{\centering
\includegraphics[scale=0.55]{example-image.png} \par
}
\caption[The electromagnetic spectrum]{The electromagnetic spectrum. Taken
from the Encyclopaedia Britannica,
\url{www.britannica.com/science/electromagnetic-spectrum}.}
\label{Fig21}
\end{figure}
\begin{figure}
{\centering
\includegraphics[scale=0.4]{example-image.png} \par
}
\caption[The sun's spectrum]{The sun's spectrum. Here \lambda represents
wavelength measured in nanometers (nm) and irradiance the amount of light
energy from the sun hitting one square meter of another object. The wave
peaks at approximately 500 nm, corresponding to green light in the visible
range. Taken from NASA,
\url{www.nasa.gov/mission_pages/sdo/science/solar-irradiance.html}.}
\label{Fig22}
\end{figure}
\end{document}
'''
错误:缺少 $ 插入“$...pages/sdo/science/solar-irradiance.html}.}”
编辑:我根据评论中的指示更新了此处的代码。一切都编译正确,直到我将我的解释重新添加到标题中。第一幅图像工作正常,但第二幅图像出现错误并停止编译器。
答案1
该错误与你的 url 或 hyperref 无关
Here \lambda represents
应该是
Here $\lambda$ represents