From 05984039c0b6e58c20b63611d6f81f24d6eb69e4 Mon Sep 17 00:00:00 2001 From: Benedikt Reinartz Date: Sat, 4 Mar 2017 10:49:07 +0100 Subject: [PATCH] Pass the doc directory to a renderframe command. Useful when placing additional files (Lilypond or Latex) close to the document. --- scribus/pageitem_latexframe.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scribus/pageitem_latexframe.cpp b/scribus/pageitem_latexframe.cpp index 28f3e94297..e3a11652ec 100644 --- a/scribus/pageitem_latexframe.cpp +++ b/scribus/pageitem_latexframe.cpp @@ -288,6 +288,9 @@ void PageItem_LatexFrame::runApplication() full_command.replace("%dir", QString("\"%1\"").arg(QDir::toNativeSeparators(QDir::tempPath()))); latex->setWorkingDirectory(QDir::tempPath()); + QFileInfo fi(doc()->DocName); + full_command.replace("$scribus_doc_dir$", fi.dir().absolutePath()); + double lDpi = realDpi()/72.0; full_command.replace("$scribus_height_px$", QString::number(qRound(m_height*lDpi))); full_command.replace("$scribus_width_px$", QString::number(qRound(m_width*lDpi)));