## LatexilaTemplatesDefault

LatexilaTemplatesDefault — Default templates

## Functions

LatexilaTemplatesDefault * | latexila_templates_default_get_instance ()
gchar * | latexila_templates_default_get_contents ()

## Types and Values

| LatexilaTemplatesDefault

## Object Hierarchy

        GObject
        ╰── GtkListStore
            ╰── LatexilaTemplatesDefault

## Implemented Interfaces

LatexilaTemplatesDefault implements GtkTreeModel, GtkTreeDragSource, GtkTreeDragDest, GtkTreeSortable and GtkBuildable.

## Includes

    #include <latexila.h>

## Description

LatexilaTemplatesDefault is a singleton class that stores information about default templates. In LaTeXila, new documents are created from templates. There are a few default templates available, and personal templates can be created (see LatexilaTemplatesPersonal).

Each LaTeX user has probably different needs, and has a different set of templates. So it's better to keep a short list of default templates. It would be useless to have a hundred default templates, since anyway they would most probably not fit many users. For example each user has a different preamble, with different packages, configured differently, etc.

In the git repository, default templates are located in the data/templates/ directory. The templates are stored in XML format, with some chunks that are translatable or not. For example the babel package (or equivalent) is added to the preamble when LaTeXila is run in another language than English (and if a translation is available for that other language). Also, the letter template can be completely translated, using even a different document class that is more suitable for the target language.

## Functions

### latexila_templates_default_get_instance ()

    LatexilaTemplatesDefault *
    latexila_templates_default_get_instance
                                   (void);

Gets the instance of the LatexilaTemplatesDefault singleton.

#### Returns

the instance of LatexilaTemplatesDefault.

[transfer none]

### latexila_templates_default_get_contents ()

    gchar *
    latexila_templates_default_get_contents
                                   (LatexilaTemplatesDefault *templates,
                                    GtkTreePath *path);

Gets the contents of a default template.

TODO load contents asynchronously.

#### Parameters

templates | the LatexilaTemplatesDefault instance. |
path | the GtkTreePath of a default template. |

#### Returns

the default template's contents. Free with `g_free()`.

## Types and Values

### LatexilaTemplatesDefault

    typedef struct _LatexilaTemplatesDefault LatexilaTemplatesDefault;

## See Also

LatexilaTemplatesPersonal