From 2332239082db6a33ee66bb08491c1e9cf099f9b6 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Tue, 18 Dec 2018 09:53:00 +0100 Subject: preview works --- src/gui/latexprocess.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/gui/latexprocess.cpp') diff --git a/src/gui/latexprocess.cpp b/src/gui/latexprocess.cpp index f81e883..20b22a4 100644 --- a/src/gui/latexprocess.cpp +++ b/src/gui/latexprocess.cpp @@ -18,7 +18,7 @@ LatexProcess::LatexProcess(PreviewWindow *preview, QObject *parent) : QObject(pa connect(_proc, SIGNAL(finished(int)), this, SLOT(finished(int))); // for debug purposes - _workingDir.setAutoRemove(false); + // _workingDir.setAutoRemove(false); } void LatexProcess::makePreview(QString tikz) @@ -57,9 +57,9 @@ void LatexProcess::makePreview(QString tikz) f.open(QIODevice::WriteOnly); QTextStream tex(&f); tex << "\\documentclass{article}\n"; - tex << "\\usepackage[active,tightpage]{preview}\n"; - tex << "\\PreviewEnvironment{tikzpicture}\n"; tex << "\\usepackage{tikzit}\n"; + tex << "\\usepackage[graphics,active,tightpage]{preview}\n"; + tex << "\\PreviewEnvironment{tikzpicture}\n"; tex << "\\input{" + tikzit->styleFile() + "}\n"; tex << "\\begin{document}\n\n"; tex << tikz; @@ -89,7 +89,7 @@ void LatexProcess::finished(int exitCode) if (exitCode == 0) { QString pdf = _workingDir.path() + "/preview.pdf"; _output->appendPlainText("\n\nSUCCESSFULLY GENERATED: " + pdf + "\n"); - //_preview->setPdf(pdf); + _preview->setPdf(pdf); emit previewFinished(); } else { _output->appendPlainText("\n\npdflatex RETURNED AN ERROR\n"); -- cgit v1.2.3