X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fextension%2Finternal%2Flatex-text-renderer.cpp;h=fd99afe31b71f2fedd8c9dd503d97e277ce4d44d;hb=9dc68827cbd515262ecb8d5ae8547d9e82c72e00;hp=d944de71ad22bdde1aa0c59e63ac7b039a3d0899;hpb=072de79e6270f4137fa48a8a73491e8a0904d8f8;p=inkscape.git diff --git a/src/extension/internal/latex-text-renderer.cpp b/src/extension/internal/latex-text-renderer.cpp index d944de71a..fd99afe31 100644 --- a/src/extension/internal/latex-text-renderer.cpp +++ b/src/extension/internal/latex-text-renderer.cpp @@ -1,5 +1,3 @@ -#define EXTENSION_INTERNAL_LATEX_TEXT_RENDERER_CPP - /** \file * Rendering LaTeX file (pdf/eps/ps+latex output) * @@ -9,6 +7,8 @@ * Authors: * Johan Engelen * Miklos Erdelyi + * Jon A. Cruz + * Abhishek Sharma * * Copyright (C) 2006-2010 Authors * @@ -51,14 +51,14 @@ namespace Internal { /** * This method is called by the PDF, EPS and PS output extensions. - * @param filename This should be the filename without extension to which the tex code should be written. Output goes to .tex. + * @param filename This should be the filename without '_tex' extension to which the tex code should be written. Output goes to _tex, note the underscore instead of period. */ bool latex_render_document_text_to_file( SPDocument *doc, gchar const *filename, const gchar * const exportId, bool exportDrawing, bool exportCanvas, bool pdflatex) { - doc->ensure_up_to_date(); + doc->ensureUpToDate(); SPItem *base = NULL; @@ -70,7 +70,7 @@ latex_render_document_text_to_file( SPDocument *doc, gchar const *filename, } else { // we want to export the entire document from root - base = SP_ITEM(sp_document_root(doc)); + base = SP_ITEM(doc->getRoot()); pageBoundingBox = !exportDrawing; } @@ -132,7 +132,7 @@ LaTeXTextRenderer::setTargetFile(gchar const *filename) { _filename = g_path_get_basename(filename); - gchar *filename_ext = g_strdup_printf("%s.tex", filename); + gchar *filename_ext = g_strdup_printf("%s_tex", filename); Inkscape::IO::dump_fopen_call(filename_ext, "K"); FILE *osf = Inkscape::IO::fopen_utf8name(filename_ext, "w+"); if (!osf) { @@ -176,12 +176,12 @@ LaTeXTextRenderer::setTargetFile(gchar const *filename) { static char const preamble[] = "%% To include the image in your LaTeX document, write\n" -"%% \\input{.tex}\n" +"%% \\input{.pdf_tex}\n" "%% instead of\n" "%% \\includegraphics{.pdf}\n" "%% To scale the image, write\n" -"%% \\def{\\svgwidth}{}\n" -"%% \\input{.tex}\n" +"%% \\def\\svgwidth{}\n" +"%% \\input{.pdf_tex}\n" "%% instead of\n" "%% \\includegraphics[width=]{.pdf}\n" "%%\n" @@ -190,7 +190,7 @@ static char const preamble[] = "%% installed) using\n" "%% \\usepackage{import}\n" "%% in the preamble, and then including the image with\n" -"%% \\import{}{.tex}\n" +"%% \\import{}{.pdf_tex}\n" "%% Alternatively, one can specify\n" "%% \\graphicspath{{/}}\n" "%% \n" @@ -490,8 +490,9 @@ LaTeXTextRenderer::setupDocument(SPDocument *doc, bool pageBoundingBox, SPItem * { // The boundingbox calculation here should be exactly the same as the one by CairoRenderer::setupDocument ! - if (!base) - base = SP_ITEM(sp_document_root(doc)); + if (!base) { + base = SP_ITEM(doc->getRoot()); + } Geom::OptRect d; if (pageBoundingBox) { @@ -578,4 +579,4 @@ LaTeXTextRenderer::pop_transform() fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :