]> git.lyx.org Git - features.git/blobdiff - src/graphics/PreviewLoader.cpp
Fix bug ##9627: Make the document name available to preview insets
[features.git] / src / graphics / PreviewLoader.cpp
index 914d7d00d13b9ba7220871b906f33f194a0b21b0..88320e4517b5106ce3cd1d13f7177b2a9a4cdcef 100644 (file)
@@ -639,6 +639,11 @@ void PreviewLoader::Impl::startLoading(bool wait)
        }
        of << "\\batchmode\n";
 
+       // Set \jobname of previews to the document name (see bug 9627)
+       of << "\\def\\jobname{"
+          << from_utf8(changeExtension(buffer_.latexName(true), ""))
+          << "}\n";
+
        LYXERR(Debug::LATEX, "Format = " << buffer_.params().getDefaultOutputFormat());
        string latexparam = "";
        bool docformat = !buffer_.params().default_output_format.empty()