diff --git a/src/extension/internal/latex-text-renderer.cpp b/src/extension/internal/latex-text-renderer.cpp
index d944de71ad22bdde1aa0c59e63ac7b039a3d0899..fd99afe31b71f2fedd8c9dd503d97e277ce4d44d 100644 (file)
-#define EXTENSION_INTERNAL_LATEX_TEXT_RENDERER_CPP
-
/** \file
* Rendering LaTeX file (pdf/eps/ps+latex output)
*
/** \file
* Rendering LaTeX file (pdf/eps/ps+latex output)
*
* Authors:
* Johan Engelen <goejendaagh@zonnet.nl>
* Miklos Erdelyi <erdelyim@gmail.com>
* Authors:
* Johan Engelen <goejendaagh@zonnet.nl>
* Miklos Erdelyi <erdelyim@gmail.com>
+ * Jon A. Cruz <jon@joncruz.org>
+ * Abhishek Sharma
*
* Copyright (C) 2006-2010 Authors
*
*
* Copyright (C) 2006-2010 Authors
*
/**
* This method is called by the PDF, EPS and PS output extensions.
/**
* 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 <filename>.tex.
+ * @param filename This should be the filename without '_tex' extension to which the tex code should be written. Output goes to <filename>_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)
{
*/
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;
SPItem *base = NULL;
}
else {
// we want to export the entire document from root
}
else {
// we want to export the entire document from root
- base = SP_ITEM(sp_document_root(doc));
+ base = SP_ITEM(doc->getRoot());
pageBoundingBox = !exportDrawing;
}
pageBoundingBox = !exportDrawing;
}
_filename = g_path_get_basename(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) {
Inkscape::IO::dump_fopen_call(filename_ext, "K");
FILE *osf = Inkscape::IO::fopen_utf8name(filename_ext, "w+");
if (!osf) {
static char const preamble[] =
"%% To include the image in your LaTeX document, write\n"
static char const preamble[] =
"%% To include the image in your LaTeX document, write\n"
-"%% \\input{<filename>.tex}\n"
+"%% \\input{<filename>.pdf_tex}\n"
"%% instead of\n"
"%% \\includegraphics{<filename>.pdf}\n"
"%% To scale the image, write\n"
"%% instead of\n"
"%% \\includegraphics{<filename>.pdf}\n"
"%% To scale the image, write\n"
-"%% \\def{\\svgwidth}{<desired width>}\n"
-"%% \\input{<filename>.tex}\n"
+"%% \\def\\svgwidth{<desired width>}\n"
+"%% \\input{<filename>.pdf_tex}\n"
"%% instead of\n"
"%% \\includegraphics[width=<desired width>]{<filename>.pdf}\n"
"%%\n"
"%% instead of\n"
"%% \\includegraphics[width=<desired width>]{<filename>.pdf}\n"
"%%\n"
"%% installed) using\n"
"%% \\usepackage{import}\n"
"%% in the preamble, and then including the image with\n"
"%% installed) using\n"
"%% \\usepackage{import}\n"
"%% in the preamble, and then including the image with\n"
-"%% \\import{<path to file>}{<filename>.tex}\n"
+"%% \\import{<path to file>}{<filename>.pdf_tex}\n"
"%% Alternatively, one can specify\n"
"%% \\graphicspath{{<path to file>/}}\n"
"%% \n"
"%% Alternatively, one can specify\n"
"%% \\graphicspath{{<path to file>/}}\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 !
{
// 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) {
Geom::OptRect d;
if (pageBoundingBox) {
fill-column:99
End:
*/
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 :