]> git.lyx.org Git - lyx.git/blob - lib/templates/README.new_templates
Add some notes.
[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. Note the handling of special characters
50 below.
51
52 If your template consists of one file only, and if there are no further templates
53 relating to your layout yet, use the layout name, as defined in \DeclareLaTeXClass,
54 as file name. In any case, use a verbose, transparent name (do not use insider
55 acronyms as file names). Note the handling of special characters below.
56
57 If your template consists of multiple files, use an additional subdirectory.
58 Use the layout name, as defined in \DeclareLaTeXClass, as subcategory subfolder
59 name. Give the files verbose, transparent names that clarify the function of the
60 respective file in the templates bundle. Note the handling of special characters below.
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
70 NB: SPECIAL CHARACTERS IN FILE AND DIRECTORY NAMES:
71 ===================================================
72
73 The following characters in file and directory names must be substituted, since they break
74 LyX building with autotools:
75
76 * Blanks by '_' (e.g., My_Layout.lyx)
77 * Parentheses by %28 and %29 (e.g., My_Layout_%28v._1%29.lyx)
78 * Apersands by %26 (e.g., Journal_of_This_%26_That.lyx)
79
80 The substitution characters will be replaced again for LyX for translation and GUI display.
81
82
83 THINGS TO CHECK BEFORE COMMITTING:
84 ==================================
85
86 New files must be added to Makefile.am. If you add a new (sub)folder, you must also create a new category
87 in Makefile.am (cf. phdthesistemplatesdir and dist_dehandoutexamples_DATA as example). 
88
89 Please make sure before you commit (in a text editor) that the example that the file has the correct
90 \origin specification. It should begin with /buildlyxdir/ and then point towards the subdirectory
91 your file is in, e.g.
92 \origin /buildlyxdir/templates/es/Presentations/
93 This is particularly important if your file includes other files (such as graphics, bibliographies,
94 children).
95
96