]> git.lyx.org Git - lyx.git/blob - lib/templates/README.new_templates
Fix redundancy
[lyx.git] / lib / templates / README.new_templates
1 HOW TO CREATE A NEW TEMPLATE
2 ============================
3
4 Templates are almost usual LyX file that are saved by LyX itself.
5 The strength is on "almost".
6
7 LyX stores some properties in a file, for example:
8
9         \textclass dinbrief
10         \language german
11         \inputencoding default
12         \fontscheme default
13         \epsfig dvips
14         \papersize a4paper
15         \paperfontsize 12
16         \baselinestretch 1.00
17         \secnumdepth 3
18         \tocdepth 3
19         \paragraph_separation skip
20         \quotes_language german
21         \quotes_times 2
22         \paperorientation portrait
23         \papercolumns 9
24         \papersides 1
25         \paperpagestyle plain
26
27 Some of these may be very reasonable for a certain template. In the
28 case of a dinbrief-template this might be the papersize, the language
29 and the quotes-settings, since it is a german-only template.  But it
30 wouldn't make much sense to set the fontscheme or the inputencoding,
31 since a user might have customized this already like he/she wanted it
32 to be.
33
34 So please delete all the lines of a new template with your favorite
35 text editor (for example ed, ex or vi) that you don't want to set
36 explicit for this template. LyX will use the user's default-values
37 (defined in lyxrc) if a property isn't defined in the file itself.
38
39
40 DIRECTORY STRUCTURE & FILE NAMING
41 ==================================
42
43 The templates directory has the following structure
44
45 templates/[language/]category/[subcategory]
46
47 Please use the layout category (with identical spelling to assure translation)
48 as category subdirectory (e.g., "Letters"). See \DeclareCategory entry of the
49 layout which corresponds to your template. Substitute blanks by '_'.
50
51 If your template consists of one file only, and if there are no further templates
52 relating to your layout yet, use the layout name, as defined in \DeclareLaTeXClass,
53 as file name. Substitute blanks by '_' (e.g., My_Layout.lyx). In any case, use
54 a verbose, transparent name (do not use insider acronyms as file names).
55
56 If your template consists of multiple files, use an additional subdirectory.
57 Use the layout name, as defined in \DeclareLaTeXClass, as subcategory subfolder
58 name. Substitute blanks by '_' (e.g., My_Layout). Give the files verbose,
59 transparent names that clarify the function of the respective file in the templates
60 bundle. Use '_' instead of blanks.
61
62 The optional language subdirectory that immediately follows templates/ uses the
63 language code (e.g., 'de' for German). Use this if you provide a translation of
64 an existing English template.
65 The language subdirectory expands to the same subfolders than the English version
66 and uses the same [English) filename (e.g., templates/Letters/myletter.lyx > 
67 templates/fr/Letters/myletter.lyx).
68
69 If you add a new (sub)folder, you must create a new entry in Makefile.am.
70