Missing $ inserted — Math symbol outside math mode
A _, ^ or math command appears in running text, or a formula is not closed, so TeX inserted a $.
Fix
Escape _ as \_ in text, or put the formula inside $…$.
Example
Reproduced on TeX Live 2026 by CI · pdflatex · corpus/underscore-in-text
Underscore in a file name outside math
main.tex\documentclass{article}
\begin{document}
\section{Data}
The measurements are stored in output_file.csv next to the scripts.
\end{document}\documentclass{article}
\begin{document}
\section{Data}
The measurements are stored in output\_file.csv next to the scripts.
\end{document}main.log! Missing $ inserted.
<inserted text>
$
l.4 The measurements are stored in output_
file.csv next to the scripts.
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.
! Missing $ inserted.
<inserted text>
$
l.5 \end{document}
…