diff --git a/doc/macroprocessor/macroprocessor.tex b/doc/macroprocessor/macroprocessor.tex
index 2586f5fe010efc0d134d1422aa88d6f81dcfde22..4120717327660153d0bf7c67cf661a1bcc3b0920 100644
--- a/doc/macroprocessor/macroprocessor.tex
+++ b/doc/macroprocessor/macroprocessor.tex
@@ -633,7 +633,7 @@ end;
 \begin{frame}
   \frametitle{Macro-related command line options}
   \begin{itemize}
-  \item \texttt{savemacro}: Useful for debugging or learning purposes, saves the output of the macro processor. If your \texttt{.mod} file is called \texttt{file.mod}, the output is saved to \texttt{file-macroexp.mod}.
+  \item \texttt{savemacro}: Useful for debugging or learning purposes, saves the output of the macro processor. If your \texttt{.mod} file is called \texttt{file.mod}, the output is saved to \texttt{file\_macroexp.mod}.
   \item NB: \texttt{savemacro=filename} allows a user-defined file name
   \item \texttt{linemacro}: In the output of \texttt{savemacro}, print line numbers where the macro directives were placed.
   \item \texttt{onlymacro}: Stops processing after the macro processing step.
diff --git a/src/MacroExpandModFile.cc b/src/MacroExpandModFile.cc
index 0cebcb2dc36f75f7d8999c21dcfe66b2b3f86097..88f7e42da914428f2b7540b4bd6f576e5ff648bc 100644
--- a/src/MacroExpandModFile.cc
+++ b/src/MacroExpandModFile.cc
@@ -41,7 +41,7 @@ macroExpandModFile(const filesystem::path& filename, const istream& modfile, boo
   if (save_macro)
     {
       if (save_macro_file.empty())
-        save_macro_file = filename.stem().string() + "-macroexp.mod";
+        save_macro_file = filename.stem().string() + "_macroexp.mod";
       ofstream macro_output_file {save_macro_file};
       if (macro_output_file.fail())
         {