struct output_driver driver;
/* A hash table containing any Tex macros which need to be emitted. */
struct hmap macros;
+ bool require_graphics;
#ifdef HAVE_CAIRO
struct cell_color fg;
struct cell_color bg;
fh_get_file_name (fh)));
tex->chart_cnt = 1;
#ifdef HAVE_CAIRO
- parse_color (d, o, "background-color", "#FFFFFFFFFFFF", &tex->bg);
- parse_color (d, o, "foreground-color", "#000000000000", &tex->fg);
+ tex->bg = parse_color (opt (d, o, "background-color", "#FFFFFFFFFFFF"));
+ tex->fg = parse_color (opt (d, o, "foreground-color", "#000000000000"));
#endif
tex->file = fn_open (tex->handle, "w");
shipout (&tex->preamble_list, "%%%% Define the horizontal space between table columns\n");
shipout (&tex->preamble_list, "\\def\\psppcolumnspace{1mm}\n\n");
- shipout (&tex->preamble_list, "\\input graphicx\n\n");
-
char *ln = get_language ();
if (ln)
shipout (&tex->preamble_list, "%%%% Language is \"%s\"\n", ln);
}
hmap_destroy (&tex->macros);
+ if (tex->require_graphics)
+ shipout (&tex->preamble_list, "\\input graphicx\n\n");
+
post_process_tokens (tex->file, &tex->preamble_list);
shipout (&tex->token_list, "\n\\bye\n");
// printf ("The chart title is %s\n", title);
shipout (&tex->token_list, "\\includegraphics{%s}\n", file_name);
+ tex->require_graphics = true;
free (file_name);
}
}
shipout (&tex->token_list, "}\\par\n\n");
break;
- case TEXT_ITEM_EJECT_PAGE:
- /* Nothing to do. */
- break;
-
case TEXT_ITEM_SYNTAX:
/* So far as I'm aware, this can never happen. */
default: