Changeset View
Changeset View
Standalone View
Standalone View
src/lib/latexrenderer.cpp
Context not available. | |||||
26 | #include <QFileInfo> | 26 | #include <QFileInfo> | ||
---|---|---|---|---|---|
27 | #include <QEventLoop> | 27 | #include <QEventLoop> | ||
28 | #include <QTemporaryFile> | 28 | #include <QTemporaryFile> | ||
29 | #include <KColorScheme> | ||||
29 | 30 | | |||
30 | #include <config-cantorlib.h> | 31 | #include <config-cantorlib.h> | ||
31 | #include "settings.h" | 32 | #include "settings.h" | ||
Context not available. | |||||
47 | "\\usepackage{latexsym,amsfonts,amssymb,ulem} \n "\ | 48 | "\\usepackage{latexsym,amsfonts,amssymb,ulem} \n "\ | ||
48 | "\\usepackage[dvips]{graphicx} \n "\ | 49 | "\\usepackage[dvips]{graphicx} \n "\ | ||
49 | "\\usepackage[utf8]{inputenc} \n "\ | 50 | "\\usepackage[utf8]{inputenc} \n "\ | ||
51 | "\\usepackage{xcolor} \n "\ | ||||
50 | "\\setlength\\textwidth{5in} \n "\ | 52 | "\\setlength\\textwidth{5in} \n "\ | ||
51 | "\\setlength{\\parindent}{0pt} \n "\ | 53 | "\\setlength{\\parindent}{0pt} \n "\ | ||
52 | "%1 \n "\ | 54 | "%1 \n "\ | ||
55 | "\\pagecolor[rgb]{%2,%3,%4} \n "\ | ||||
53 | "\\pagestyle{empty} \n "\ | 56 | "\\pagestyle{empty} \n "\ | ||
54 | "\\begin{document} \n "\ | 57 | "\\begin{document} \n "\ | ||
55 | "%2 \n "\ | 58 | "\\color[rgb]{%5,%6,%7} \n "\ | ||
59 | "%8 \n "\ | ||||
56 | "\\end{document}\n"); | 60 | "\\end{document}\n"); | ||
57 | 61 | | |||
58 | static const QLatin1String eqnHeader("\\begin{eqnarray*}%1\\end{eqnarray*} \n "); | 62 | static const QLatin1String eqnHeader("\\begin{eqnarray*}%1\\end{eqnarray*} \n "); | ||
Context not available. | |||||
177 | QTemporaryFile *texFile=new QTemporaryFile(dir + QLatin1String("/cantor_tex-XXXXXX.tex")); | 181 | QTemporaryFile *texFile=new QTemporaryFile(dir + QLatin1String("/cantor_tex-XXXXXX.tex")); | ||
178 | texFile->open(); | 182 | texFile->open(); | ||
179 | 183 | | |||
184 | KColorScheme scheme(QPalette::Active); | ||||
185 | const QColor &backgroundColor=scheme.background().color(); | ||||
186 | const QColor &foregroundColor=scheme.foreground().color(); | ||||
180 | QString expressionTex=tex; | 187 | QString expressionTex=tex; | ||
181 | expressionTex=expressionTex.arg(d->header); | 188 | expressionTex=expressionTex.arg(d->header) | ||
189 | .arg(backgroundColor.redF()).arg(backgroundColor.greenF()).arg(backgroundColor.blueF()) | ||||
190 | .arg(foregroundColor.redF()).arg(foregroundColor.greenF()).arg(foregroundColor.blueF()); | ||||
182 | if(isEquationOnly()) | 191 | if(isEquationOnly()) | ||
183 | { | 192 | { | ||
184 | switch(equationType()) | 193 | switch(equationType()) | ||
Context not available. |