1 /* 2 * templates.h 3 * 4 * Copyright 2009-2012 Frank Lanitz <frank(at)frank(dot)uvena(dot)de> 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 * MA 02110-1301, USA. 20 */ 21 22 #ifndef GLATEXTEMPLATES_H 23 #define GLATEXTEMPLATES_H 24 25 #include "latex.h" 26 27 /* Add an enum entry for every new build in templates which are not 28 * the TEMPLATE_LATEX_BEAMER and TEMPLATE_LATEX_LETTER. 29 * Anyway, you sould prefer to add new templates not by patching this 30 * code but by providing a template as described in documentation. 31 * However, whenever adding a new template here, please ensure 32 * LATEX_WIZARD_TEMPLATE_END is the last entry as it will trigger 33 * the custom templates.*/ 34 enum { 35 LATEX_WIZARD_TEMPLATE_DEFAULT = 0, 36 LATEX_WIZARD_TEMPLATE_END 37 }; 38 39 40 #define TEMPLATE_LATEX "\ 41 \\documentclass[{CLASSOPTION}]{{DOCUMENTCLASS}}\n\ 42 {GEOMETRY}\ 43 {ENCODING}\ 44 {TITLE}\ 45 {AUTHOR}\ 46 {DATE}\ 47 \\begin{document}\n\ 48 \n\ 49 \\end{document}\n" 50 51 #define TEMPLATE_LATEX_LETTER "\ 52 \\documentclass[{CLASSOPTION}]{{DOCUMENTCLASS}}\n\ 53 {ENCODING}\ 54 \\address{}\n\ 55 {DATE}\ 56 {TITLE}\ 57 {AUTHOR}\ 58 \\begin{document}\n\ 59 \\begin{letter}{}\n\ 60 \\opening{{OPENING}}\n\n\ 61 \\closing{{CLOSING}}\n\ 62 \\end{letter}\n\ 63 \\end{document}\n" 64 65 #define TEMPLATE_LATEX_BEAMER "\ 66 \\documentclass[]{{DOCUMENTCLASS}}\n\ 67 \\usetheme{default}\n\ 68 {ENCODING}\ 69 {TITLE}\ 70 {AUTHOR}\ 71 {DATE}\ 72 \\begin{document}\n\ 73 \\frame{\\titlepage}\n\ 74 \\begin{frame}\n\ 75 \\end{frame}\n\ 76 \\end{document}\n" 77 78 GString *glatex_get_template_from_file(gchar *filepath); 79 GPtrArray *glatex_init_custom_templates(void); 80 GList *glatex_get_template_list_from_config_dir(void); 81 void glatex_free_template_entry(TemplateEntry *template, gpointer *data); 82 void glatex_add_templates_to_combobox(GPtrArray *templates, GtkWidget *combobox); 83 84 #endif 85