From f3462bff432feef773f99bab7d5ae208d077ddb1 Mon Sep 17 00:00:00 2001 From: Johan Engelen Date: Mon, 22 Feb 2010 20:33:37 +0100 Subject: [PATCH] - change cmdline option to --export-latex. - change source file names to reflect that it is "generic" latex renderer - make latex export work for EPS and PS aswell --- inkscape.pod | 13 +-- src/extension/internal/Makefile_insert | 4 +- src/extension/internal/cairo-ps-out.cpp | 79 +++++++++++++--- .../internal/cairo-renderer-pdf-out.cpp | 50 +--------- ...x-renderer.cpp => latex-text-renderer.cpp} | 91 +++++++++++++------ ...latex-renderer.h => latex-text-renderer.h} | 12 ++- src/main.cpp | 16 ++-- 7 files changed, 159 insertions(+), 106 deletions(-) rename src/extension/internal/{pdflatex-renderer.cpp => latex-text-renderer.cpp} (87%) rename src/extension/internal/{pdflatex-renderer.h => latex-text-renderer.h} (82%) diff --git a/inkscape.pod b/inkscape.pod index fed3dfb51..52b76b4a9 100644 --- a/inkscape.pod +++ b/inkscape.pod @@ -32,7 +32,7 @@ options: -P, --export-ps=FILENAME -E, --export-eps=FILENAME -A, --export-pdf=FILENAME - --export-pdf-latex + --export-latex -T, --export-text-to-path --export-ignore-filters @@ -268,13 +268,14 @@ The default export area is page; you can set it to drawing by --export-area-draw specify --export-id to export a single object (all other are hidden); in that case export area is that object's bounding box, but can be set to page by --export-area-page. -=item B<--export-pdf-latex> +=item B<--export-latex> +(for PS, EPS, and PDF export) Used for creating images for LaTeX documents, where the image's text is typeset by LaTeX. -When exporting to PDF format, this option splits the output into a PDF file -(as specified by --export-pdf) and a LaTeX file. Text will not be output in -the PDF file, but instead will appear in the LaTeX file. This LaTeX file -includes the PDF. Inputting (\input{image.tex}) the LaTeX file in your LaTeX +When exporting to PDF/PS/EPS format, this option splits the output into a PDF/PS/EPS file +(e.g. as specified by --export-pdf) and a LaTeX file. Text will not be output in +the PDF/PS/EPS file, but instead will appear in the LaTeX file. This LaTeX file +includes the PDF/PS/EPS. Inputting (\input{image.tex}) the LaTeX file in your LaTeX document will show the image and all text will be typeset by LaTeX. See the resulting LaTeX file for more information. Also see GNUPlot's `epslatex' output terminal. diff --git a/src/extension/internal/Makefile_insert b/src/extension/internal/Makefile_insert index 881b3ec22..3c1ce7f43 100644 --- a/src/extension/internal/Makefile_insert +++ b/src/extension/internal/Makefile_insert @@ -109,8 +109,8 @@ ink_common_sources += \ extension/internal/javafx-out.h \ extension/internal/gdkpixbuf-input.h \ extension/internal/gdkpixbuf-input.cpp \ - extension/internal/pdflatex-renderer.h \ - extension/internal/pdflatex-renderer.cpp \ + extension/internal/latex-text-renderer.h \ + extension/internal/latex-text-renderer.cpp \ extension/internal/pdfinput/svg-builder.h \ extension/internal/pdfinput/svg-builder.cpp \ extension/internal/pdfinput/pdf-parser.h \ diff --git a/src/extension/internal/cairo-ps-out.cpp b/src/extension/internal/cairo-ps-out.cpp index 737bb2885..6f22dbdc7 100644 --- a/src/extension/internal/cairo-ps-out.cpp +++ b/src/extension/internal/cairo-ps-out.cpp @@ -21,6 +21,7 @@ #include "cairo-ps-out.h" #include "cairo-render-context.h" #include "cairo-renderer.h" +#include "latex-text-renderer.h" #include #include "extension/system.h" #include "extension/print.h" @@ -61,7 +62,8 @@ bool CairoEpsOutput::check (Inkscape::Extension::Extension * /*module*/) } static bool -ps_print_document_to_file(SPDocument *doc, gchar const *filename, unsigned int level, bool texttopath, bool filtertobitmap, int resolution, const gchar * const exportId, bool exportDrawing, bool exportCanvas, bool eps = false) +ps_print_document_to_file(SPDocument *doc, gchar const *filename, unsigned int level, bool texttopath, bool omittext, + bool filtertobitmap, int resolution, const gchar * const exportId, bool exportDrawing, bool exportCanvas, bool eps = false) { sp_document_ensure_up_to_date(doc); @@ -93,6 +95,7 @@ ps_print_document_to_file(SPDocument *doc, gchar const *filename, unsigned int l ctx->setPSLevel(level); ctx->setEPS(eps); ctx->setTextToPath(texttopath); + renderer->_omitText = omittext; ctx->setFilterToBitmap(filtertobitmap); ctx->setBitmapResolution(resolution); @@ -146,6 +149,14 @@ CairoPsOutput::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar con new_textToPath = mod->get_param_bool("textToPath"); } catch(...) {} + bool new_textToLaTeX = FALSE; + try { + new_textToLaTeX = mod->get_param_bool("textToLaTeX"); + } + catch(...) { + g_warning("Parameter might not exist"); + } + bool new_blurToBitmap = FALSE; try { new_blurToBitmap = mod->get_param_bool("blurToBitmap"); @@ -171,13 +182,29 @@ CairoPsOutput::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar con new_exportId = mod->get_param_string("exportId"); } catch(...) {} - gchar * final_name; - final_name = g_strdup_printf("> %s", filename); - ret = ps_print_document_to_file(doc, final_name, level, new_textToPath, new_blurToBitmap, new_bitmapResolution, new_exportId, new_areaDrawing, new_areaPage); - g_free(final_name); + // Create PS + { + gchar * final_name; + final_name = g_strdup_printf("> %s", filename); + ret = ps_print_document_to_file(doc, final_name, level, new_textToPath, new_textToLaTeX, new_blurToBitmap, new_bitmapResolution, new_exportId, new_areaDrawing, new_areaPage); + g_free(final_name); - if (!ret) - throw Inkscape::Extension::Output::save_failed(); + if (!ret) + throw Inkscape::Extension::Output::save_failed(); + } + + // Create LaTeX file (if requested) + if (new_textToLaTeX) { + gchar * tex_filename; + //strip filename of ".ps", do not add ".tex" here. + gsize n = g_str_has_suffix(filename, ".ps") ? strlen(filename)-3 : strlen(filename); + tex_filename = g_strndup(filename, n); + ret = latex_render_document_text_to_file(doc, tex_filename, new_exportId, new_areaDrawing, new_areaPage); + g_free(tex_filename); + + if (!ret) + throw Inkscape::Extension::Output::save_failed(); + } } @@ -210,6 +237,14 @@ CairoEpsOutput::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar co new_textToPath = mod->get_param_bool("textToPath"); } catch(...) {} + bool new_textToLaTeX = FALSE; + try { + new_textToLaTeX = mod->get_param_bool("textToLaTeX"); + } + catch(...) { + g_warning("Parameter might not exist"); + } + bool new_blurToBitmap = FALSE; try { new_blurToBitmap = mod->get_param_bool("blurToBitmap"); @@ -235,13 +270,29 @@ CairoEpsOutput::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar co new_exportId = mod->get_param_string("exportId"); } catch(...) {} - gchar * final_name; - final_name = g_strdup_printf("> %s", filename); - ret = ps_print_document_to_file(doc, final_name, level, new_textToPath, new_blurToBitmap, new_bitmapResolution, new_exportId, new_areaDrawing, new_areaPage, true); - g_free(final_name); + // Create EPS + { + gchar * final_name; + final_name = g_strdup_printf("> %s", filename); + ret = ps_print_document_to_file(doc, final_name, level, new_textToPath, new_textToLaTeX, new_blurToBitmap, new_bitmapResolution, new_exportId, new_areaDrawing, new_areaPage, true); + g_free(final_name); - if (!ret) - throw Inkscape::Extension::Output::save_failed(); + if (!ret) + throw Inkscape::Extension::Output::save_failed(); + } + + // Create LaTeX file (if requested) + if (new_textToLaTeX) { + gchar * tex_filename; + //strip filename of ".eps", do not add ".tex" here. + gsize n = g_str_has_suffix(filename, ".eps") ? strlen(filename)-4 : strlen(filename); + tex_filename = g_strndup(filename, n); + ret = latex_render_document_text_to_file(doc, tex_filename, new_exportId, new_areaDrawing, new_areaPage); + g_free(tex_filename); + + if (!ret) + throw Inkscape::Extension::Output::save_failed(); + } } @@ -280,6 +331,7 @@ CairoPsOutput::init (void) #endif "\n" "false\n" + "false\n" "true\n" "90\n" "true\n" @@ -317,6 +369,7 @@ CairoEpsOutput::init (void) #endif "\n" "false\n" + "false\n" "true\n" "90\n" "true\n" diff --git a/src/extension/internal/cairo-renderer-pdf-out.cpp b/src/extension/internal/cairo-renderer-pdf-out.cpp index 594389c60..1dcfbdf1d 100644 --- a/src/extension/internal/cairo-renderer-pdf-out.cpp +++ b/src/extension/internal/cairo-renderer-pdf-out.cpp @@ -5,8 +5,9 @@ * Authors: * Ted Gould * Ulf Erikson + * Johan Engelen * - * Copyright (C) 2004-2006 Authors + * Copyright (C) 2004-2010 Authors * * Released under GNU GPL, read the file 'COPYING' for more information */ @@ -20,7 +21,7 @@ #include "cairo-renderer-pdf-out.h" #include "cairo-render-context.h" #include "cairo-renderer.h" -#include "pdflatex-renderer.h" +#include "latex-text-renderer.h" #include #include "extension/system.h" #include "extension/print.h" @@ -110,49 +111,6 @@ pdf_render_document_to_file(SPDocument *doc, gchar const *filename, unsigned int return ret; } -static bool -latex_render_document_text_to_file( SPDocument *doc, gchar const *filename, - const gchar * const exportId, bool exportDrawing, bool exportCanvas) -{ - sp_document_ensure_up_to_date(doc); - -/* Start */ - - SPItem *base = NULL; - - bool pageBoundingBox = true; - if (exportId && strcmp(exportId, "")) { - // we want to export the given item only - base = SP_ITEM(doc->getObjectById(exportId)); - pageBoundingBox = exportCanvas; - } - else { - // we want to export the entire document from root - base = SP_ITEM(sp_document_root(doc)); - pageBoundingBox = !exportDrawing; - } - - if (!base) - return false; - - /* Create renderer */ - PDFLaTeXRenderer *renderer = new PDFLaTeXRenderer(); - - bool ret = renderer->setTargetFile(filename); - if (ret) { - /* Render document */ - bool ret = renderer->setupDocument(doc, pageBoundingBox, base); - if (ret) { - renderer->renderItem(base); - } - } - - delete renderer; - - return ret; -} - - /** \brief This function calls the output module with the filename \param mod unused @@ -287,7 +245,7 @@ CairoRendererPdfOutput::init (void) "<_item value='PDF14'>" N_("PDF 1.4") "\n" "\n" "false\n" - "false\n" + "false\n" "true\n" "90\n" "false\n" diff --git a/src/extension/internal/pdflatex-renderer.cpp b/src/extension/internal/latex-text-renderer.cpp similarity index 87% rename from src/extension/internal/pdflatex-renderer.cpp rename to src/extension/internal/latex-text-renderer.cpp index b70bac107..83bb7c52d 100644 --- a/src/extension/internal/pdflatex-renderer.cpp +++ b/src/extension/internal/latex-text-renderer.cpp @@ -62,7 +62,7 @@ #include "helper/png-write.h" #include "helper/pixbuf-ops.h" -#include "pdflatex-renderer.h" +#include "latex-text-renderer.h" #include "extension/system.h" #include "io/sys.h" @@ -97,12 +97,52 @@ struct SPMaskView { NRRect bbox; }; + namespace Inkscape { namespace Extension { namespace Internal { +bool +latex_render_document_text_to_file( SPDocument *doc, gchar const *filename, + const gchar * const exportId, bool exportDrawing, bool exportCanvas) +{ + sp_document_ensure_up_to_date(doc); + + SPItem *base = NULL; + + bool pageBoundingBox = true; + if (exportId && strcmp(exportId, "")) { + // we want to export the given item only + base = SP_ITEM(doc->getObjectById(exportId)); + pageBoundingBox = exportCanvas; + } + else { + // we want to export the entire document from root + base = SP_ITEM(sp_document_root(doc)); + pageBoundingBox = !exportDrawing; + } + + if (!base) + return false; + + /* Create renderer */ + LaTeXTextRenderer *renderer = new LaTeXTextRenderer(); + + bool ret = renderer->setTargetFile(filename); + if (ret) { + /* Render document */ + bool ret = renderer->setupDocument(doc, pageBoundingBox, base); + if (ret) { + renderer->renderItem(base); + } + } + + delete renderer; + + return ret; +} -PDFLaTeXRenderer::PDFLaTeXRenderer(void) +LaTeXTextRenderer::LaTeXTextRenderer(void) : _stream(NULL), _filename(NULL), _width(0), @@ -111,7 +151,7 @@ PDFLaTeXRenderer::PDFLaTeXRenderer(void) push_transform(Geom::identity()); } -PDFLaTeXRenderer::~PDFLaTeXRenderer(void) +LaTeXTextRenderer::~LaTeXTextRenderer(void) { if (_stream) { writePostamble(); @@ -135,11 +175,11 @@ PDFLaTeXRenderer::~PDFLaTeXRenderer(void) * @return Returns true when succesfull */ bool -PDFLaTeXRenderer::setTargetFile(gchar const *filename) { +LaTeXTextRenderer::setTargetFile(gchar const *filename) { if (filename != NULL) { while (isspace(*filename)) filename += 1; - _filename = g_strdup(filename); + _filename = g_path_get_basename(filename); gchar *filename_ext = g_strdup_printf("%s.tex", filename); Inkscape::IO::dump_fopen_call(filename_ext, "K"); @@ -161,8 +201,9 @@ PDFLaTeXRenderer::setTargetFile(gchar const *filename) { } fprintf(_stream, "%%%% Creator: Inkscape %s, www.inkscape.org\n", PACKAGE_STRING); - fprintf(_stream, "%%%% PDF + LaTeX output extension by Johan Engelen, 2010\n"); - fprintf(_stream, "%%%% Accompanies %s.pdf\n", _filename); + fprintf(_stream, "%%%% PDF/EPS/PS + LaTeX output extension by Johan Engelen, 2010\n"); + fprintf(_stream, "%%%% Accompanies image file '%s' (pdf, eps, ps)\n", _filename); + fprintf(_stream, "%%%%"); /* flush this to test output stream as early as possible */ if (fflush(_stream)) { if (ferror(_stream)) { @@ -206,18 +247,18 @@ static char const postamble[] = "\\endgroup \n"; void -PDFLaTeXRenderer::writePreamble() +LaTeXTextRenderer::writePreamble() { fprintf(_stream, "%s", preamble); } void -PDFLaTeXRenderer::writePostamble() +LaTeXTextRenderer::writePostamble() { fprintf(_stream, "%s", postamble); } void -PDFLaTeXRenderer::sp_group_render(SPItem *item) +LaTeXTextRenderer::sp_group_render(SPItem *item) { SPGroup *group = SP_GROUP(item); @@ -232,7 +273,7 @@ PDFLaTeXRenderer::sp_group_render(SPItem *item) } void -PDFLaTeXRenderer::sp_use_render(SPItem *item) +LaTeXTextRenderer::sp_use_render(SPItem *item) { /* bool translated = false; @@ -256,7 +297,7 @@ PDFLaTeXRenderer::sp_use_render(SPItem *item) } void -PDFLaTeXRenderer::sp_text_render(SPItem *item) +LaTeXTextRenderer::sp_text_render(SPItem *item) { SPText *textobj = SP_TEXT (item); @@ -315,7 +356,7 @@ PDFLaTeXRenderer::sp_text_render(SPItem *item) } void -PDFLaTeXRenderer::sp_flowtext_render(SPItem *item) +LaTeXTextRenderer::sp_flowtext_render(SPItem *item) { /* SPFlowtext *group = SP_FLOWTEXT(item); @@ -332,7 +373,7 @@ PDFLaTeXRenderer::sp_flowtext_render(SPItem *item) } void -PDFLaTeXRenderer::sp_root_render(SPItem *item) +LaTeXTextRenderer::sp_root_render(SPItem *item) { SPRoot *root = SP_ROOT(item); @@ -345,7 +386,7 @@ PDFLaTeXRenderer::sp_root_render(SPItem *item) } void -PDFLaTeXRenderer::sp_item_invoke_render(SPItem *item) +LaTeXTextRenderer::sp_item_invoke_render(SPItem *item) { // Check item's visibility if (item->isHidden()) { @@ -373,7 +414,7 @@ PDFLaTeXRenderer::sp_item_invoke_render(SPItem *item) } void -PDFLaTeXRenderer::setStateForItem(SPItem const *item) +LaTeXTextRenderer::setStateForItem(SPItem const *item) { /* SPStyle const *style = SP_OBJECT_STYLE(item); @@ -396,7 +437,7 @@ PDFLaTeXRenderer::setStateForItem(SPItem const *item) } void -PDFLaTeXRenderer::renderItem(SPItem *item) +LaTeXTextRenderer::renderItem(SPItem *item) { // ctx->pushState(); // setStateForItem(ctx, item); @@ -420,7 +461,7 @@ PDFLaTeXRenderer::renderItem(SPItem *item) } bool -PDFLaTeXRenderer::setupDocument(SPDocument *doc, bool pageBoundingBox, SPItem *base) +LaTeXTextRenderer::setupDocument(SPDocument *doc, bool pageBoundingBox, SPItem *base) { // The boundingbox calculation here should be exactly the same as the one by CairoRenderer::setupDocument ! @@ -458,9 +499,7 @@ PDFLaTeXRenderer::setupDocument(SPDocument *doc, bool pageBoundingBox, SPItem *b os << " \\begin{picture}(" << _width << "," << _height << ")%\n"; // strip pathname, as it is probably desired. Having a specific path in the TeX file is not convenient. - gchar *figurefile = g_path_get_basename(_filename); - os << " \\put(0,0){\\includegraphics[width=\\unitlength]{" << figurefile << ".pdf}}%\n"; - g_free(figurefile); + os << " \\put(0,0){\\includegraphics[width=\\unitlength]{" << _filename << "}}%\n"; fprintf(_stream, "%s", os.str().c_str()); @@ -468,13 +507,13 @@ PDFLaTeXRenderer::setupDocument(SPDocument *doc, bool pageBoundingBox, SPItem *b } Geom::Matrix const & -PDFLaTeXRenderer::transform() +LaTeXTextRenderer::transform() { return _transform_stack.top(); } void -PDFLaTeXRenderer::push_transform(Geom::Matrix const &tr) +LaTeXTextRenderer::push_transform(Geom::Matrix const &tr) { if(_transform_stack.size()){ Geom::Matrix tr_top = _transform_stack.top(); @@ -485,7 +524,7 @@ PDFLaTeXRenderer::push_transform(Geom::Matrix const &tr) } void -PDFLaTeXRenderer::pop_transform() +LaTeXTextRenderer::pop_transform() { _transform_stack.pop(); } @@ -495,7 +534,7 @@ PDFLaTeXRenderer::pop_transform() // Apply an SVG clip path void -PDFLaTeXRenderer::applyClipPath(CairoRenderContext *ctx, SPClipPath const *cp) +LaTeXTextRenderer::applyClipPath(CairoRenderContext *ctx, SPClipPath const *cp) { g_assert( ctx != NULL && ctx->_is_valid ); @@ -550,7 +589,7 @@ PDFLaTeXRenderer::applyClipPath(CairoRenderContext *ctx, SPClipPath const *cp) // Apply an SVG mask void -PDFLaTeXRenderer::applyMask(CairoRenderContext *ctx, SPMask const *mask) +LaTeXTextRenderer::applyMask(CairoRenderContext *ctx, SPMask const *mask) { g_assert( ctx != NULL && ctx->_is_valid ); diff --git a/src/extension/internal/pdflatex-renderer.h b/src/extension/internal/latex-text-renderer.h similarity index 82% rename from src/extension/internal/pdflatex-renderer.h rename to src/extension/internal/latex-text-renderer.h index 93c06b114..a3c419015 100644 --- a/src/extension/internal/pdflatex-renderer.h +++ b/src/extension/internal/latex-text-renderer.h @@ -2,7 +2,7 @@ #define EXTENSION_INTERNAL_PDF_LATEX_RENDERER_H_SEEN /** \file - * Declaration of PDFLaTeXRenderer, used for rendering the accompanying LaTeX file when saving PDF output + LaTeX + * Declaration of LaTeXTextRenderer, used for rendering the accompanying LaTeX file when saving PDF output + LaTeX */ /* * Authors: @@ -36,10 +36,12 @@ namespace Inkscape { namespace Extension { namespace Internal { -class PDFLaTeXRenderer { +bool latex_render_document_text_to_file(SPDocument *doc, gchar const *filename, const gchar * const exportId, bool exportDrawing, bool exportCanvas); + +class LaTeXTextRenderer { public: - PDFLaTeXRenderer(); - virtual ~PDFLaTeXRenderer(); + LaTeXTextRenderer(); + virtual ~LaTeXTextRenderer(); bool setTargetFile(gchar const *filename); @@ -48,7 +50,7 @@ public: // void applyClipPath(CairoRenderContext *ctx, SPClipPath const *cp); // void applyMask(CairoRenderContext *ctx, SPMask const *mask); - /** Initializes the PDFLaTeXRenderer according to the specified + /** Initializes the LaTeXTextRenderer according to the specified SPDocument. Important to set the boundingbox to the pdf boundingbox */ bool setupDocument(SPDocument *doc, bool pageBoundingBox, SPItem *base); diff --git a/src/main.cpp b/src/main.cpp index 6b87df194..4bb5dfdc1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -143,7 +143,7 @@ enum { SP_ARG_EXPORT_PS, SP_ARG_EXPORT_EPS, SP_ARG_EXPORT_PDF, - SP_ARG_EXPORT_PDF_LATEX, + SP_ARG_EXPORT_LATEX, #ifdef WIN32 SP_ARG_EXPORT_EMF, #endif //WIN32 @@ -182,7 +182,7 @@ static gchar *sp_export_dpi = NULL; static gchar *sp_export_area = NULL; static gboolean sp_export_area_drawing = FALSE; static gboolean sp_export_area_page = FALSE; -static gboolean sp_export_pdf_latex = FALSE; +static gboolean sp_export_latex = FALSE; static gchar *sp_export_width = NULL; static gchar *sp_export_height = NULL; static gchar *sp_export_id = NULL; @@ -226,7 +226,7 @@ static void resetCommandlineGlobals() { sp_export_area = NULL; sp_export_area_drawing = FALSE; sp_export_area_page = FALSE; - sp_export_pdf_latex = FALSE; + sp_export_latex = FALSE; sp_export_width = NULL; sp_export_height = NULL; sp_export_id = NULL; @@ -375,9 +375,9 @@ struct poptOption options[] = { N_("Export document to a PDF file"), N_("FILENAME")}, - {"export-pdf-latex", 0, - POPT_ARG_NONE, &sp_export_pdf_latex, SP_ARG_EXPORT_PDF_LATEX, - N_("Export PDF without text. Besides the PDF, a LaTeX file is exported, putting the text on top of the PDF file. Include the result in LaTeX like: \\input{latexfile.tex}"), + {"export-latex", 0, + POPT_ARG_NONE, &sp_export_latex, SP_ARG_EXPORT_LATEX, + N_("Export PDF/PS/EPS without text. Besides the PDF/PS/EPS, a LaTeX file is exported, putting the text on top of the PDF/PS/EPS file. Include the result in LaTeX like: \\input{latexfile.tex}"), NULL}, #ifdef WIN32 @@ -654,7 +654,7 @@ main(int argc, char **argv) || !strncmp(argv[i], "--export-eps", 12) || !strcmp(argv[i], "-A") || !strncmp(argv[i], "--export-pdf", 12) - || !strncmp(argv[i], "--export-pdf-latex", 18) + || !strncmp(argv[i], "--export-latex", 14) #ifdef WIN32 || !strcmp(argv[i], "-M") || !strncmp(argv[i], "--export-emf", 12) @@ -1527,7 +1527,7 @@ static void do_export_ps_pdf(SPDocument* doc, gchar const* uri, char const* mime (*i)->set_param_bool("textToPath", FALSE); } - if (sp_export_pdf_latex) { + if (sp_export_latex) { (*i)->set_param_bool("textToLaTeX", TRUE); } else { (*i)->set_param_bool("textToLaTeX", FALSE); -- 2.30.2