#include <klfbackend.h>
Static Public Member Functions | |
| static klfOutput | getLatexFormula (const klfInput &in, const klfSettings &settings) |
Classes | |
| struct | klfInput |
| Specific input to KLFBackend::getLatexFormula(). More... | |
| struct | klfOutput |
| KLFBackend::getLatexFormula() result. More... | |
| struct | klfSettings |
| General settings for KLFBackend::getLatexFormula(). More... | |
The main engine for KLatexFormula, providing core functionality of transforming LaTeX code into graphics.
Don't instanciate this class, use the static function KLFBackend::getLatexFormula() to do all the processing.
Definition at line 66 of file klfbackend.h.
|
||||||||||||
|
The call to process everything. Pass on a valid klfInput input object, as well as a klfSettings object filled with your input and settings, and you will get output in klfOutput. If an error occurs, klfOutput::status is non-zero and klfOutput::errorstr contains an explicit (NOT locale translated) error in human-readable form. Usage example: ... // these could have been declared at some more global scope KLFBackend::klfSettings settings; settings.tempdir = "/tmp"; settings.klfclspath = "/opt/kde3/share/apps/klatexformula/"; settings.latexexec = "latex"; settings.dvipsexec = "dvips"; settings.gsexec = "gs"; settings.epstopdfexec = "epstopdf"; settings.lborderoffset = 1; settings.tborderoffset = 1; settings.rborderoffset = 3; settings.bborderoffset = 1; KLFBackend::klfInput input; input.latex = "\\int_{\\Sigma}\\!(\\vec{\\nabla}\\times\\vec u)\\,d\\vec S = \\oint_C \\vec{u}\\cdot d\\vec r"; input.mathmode = "\\[ ... \\]"; input.preamble = "\\usepackage{somerequiredpackage}\n"; input.fg_color = qRgb(255, 128, 128); // light blue input.bg_color = qRgba(0, 0, 80, 255); // dark blue, opaque input.dpi = 300; KLFBackend::klfOutput out = KLFBackend::getLatexFormula(input, settings); myLabel->setPixmap(QPixmap(out.result)); // write contents of 'out.pdfdata' to a file to get a PDF file (for example) { QFile fpdf(fname); fpdf.open(IO_WriteOnly | IO_Raw); fpdf.writeBlock(*dataptr); } ... Definition at line 62 of file klfbackend.cpp. References KLFBackend::klfOutput::epsdata, KLFBackend::klfOutput::errorstr, KLFBackend::klfInput::latex, KLFBackend::klfOutput::pdfdata, KLFBackend::klfOutput::pngdata, KLFBackend::klfOutput::result, KLFBackend::klfOutput::status, and KLFBackend::klfSettings::tempdir. |
1.4.6