This patch adapts the layout file documentation to the current file format and documents manual conversion. I left out a lot of whitespace that was added by current LyX in order to make the patch readable. The only place where I am not sure if it is correct is the character style documentation. It would be nice if somebody could look at this one.
Comments? Georg
diff -p -r -U 3 -X excl.tmp lyx-1.4-clean/lib/doc/ChangeLog lyx-1.4-cvs/lib/doc/ChangeLog --- lyx-1.4-clean/lib/doc/ChangeLog 2005-10-05 20:46:07.000000000 +0200 +++ lyx-1.4-cvs/lib/doc/ChangeLog 2005-10-25 22:20:04.587814400 +0200 @@ -1,3 +1,7 @@ +2005-10-25 Georg Baum <[EMAIL PROTECTED]> + + * Customization.lyx: update layout file documentation + 2005-10-03 Georg Baum <[EMAIL PROTECTED]> * depend.py, Makefile.am: Don't use TOCs both as variable name and diff -p -r -U 3 -X excl.tmp lyx-1.4-clean/lib/doc/Customization.lyx lyx-1.4-cvs/lib/doc/Customization.lyx --- lyx-1.4-clean/lib/doc/Customization.lyx 2005-07-18 21:11:30.000000000 +0200 +++ lyx-1.4-cvs/lib/doc/Customization.lyx 2005-10-25 22:18:38.231942488 +0200 @@ -5803,18 +5466,42 @@ econfigure \end_layout \begin_layout Subsection +File format +\end_layout + +\begin_layout Standard +The first non-comment line must contain the file format number: +\end_layout + +\begin_layout Description + +\family typewriter +\series medium +Format +\family default +\series default + [ +\family typewriter +int +\family default +] This tag was introduced with LyX 1.4.0 (layout files of LyX 1.3.x and earlier + don't have an explicit file format). + The file format that is documented here is +\family typewriter +2 +\family default +. +\end_layout +\begin_layout Subsection General text class parameters \end_layout \begin_layout Standard - These are the general parameters which describe the form of the entire document: \end_layout \begin_layout Standard - - \begin_inset ERT status inlined @@ -5963,50 +5647,6 @@ dialog. \begin_layout Description - -\family typewriter -\series medium -MaxCounter -\family default -\series default - [ -\family typewriter -\emph on -Counter_Chapter -\emph default -, Counter_Section, Counter_Subsection, Counter_Subsubsection, Counter_Paragraph, - -\newline -Counter_Subparagraph, Counter_EnumI, Counter_EnumII, -\newline -Counter_EnumIII, Counter_EnumIV -\family default -] The highest level of automatic enumeration. - Useful values are -\family typewriter -Counter_Chapter -\family default - for a book or report and -\family typewriter -Counter_Section -\family default - for an article. - If there is no enumeration needed at all, for example inside a letter class, - -\family typewriter -MaxCounter -\family default - should be set to -\family typewriter -Counter_EnumI -\family default -. - -\end_layout - -\begin_layout Description - - \family typewriter \series medium ClassOptions\SpecialChar \ldots{} @@ -6329,6 +5956,24 @@ NoFloat \begin_layout Description +\family typewriter +\series medium +CharStyle\SpecialChar \ldots{} +End +\series default + +\family default +This section defines a new character style. + See Section\InsetSpace ~ + +\begin_inset LatexCommand \ref{sec:charstyle} + +\end_inset + + for a description. +\end_layout + +\begin_layout Description \family typewriter \series medium @@ -7111,17 +6721,8 @@ No_Label \emph default , Manual, Static, Top_Environment, \newline -Centered_Top_Environment, Sensitive, Counter_Chapter, -\newline -Counter_Section, Counter_Subsection, Counter_Subsubsection, -\newline -Counter_Paragraph, Counter_Subparagraph, Counter_EnumI, -\family default - -\family typewriter - -\newline -Counter_EnumII, Counter_EnumIII, Counter_EnumIV +Centered_Top_Environment, Sensitive, + Counter \family default ] \newline @@ -7200,13 +6801,42 @@ Sensitive means the (hardcoded) label string depends on the kind of float. The \family typewriter -Counter_xxx +Counter \family default - label types should be self explanatory. + label type defines automatically numbered labels. \end_layout \begin_layout Description +\family typewriter +\series medium +LabelCounter +\family default +\series default + [ +\family typewriter +Chapter, Section, Subsection, Subsubsection, +\newline +Paragraph, Subparagraph, EnumI, + EnumII, EnumIII, EnumIV +\family default +] +\newline +The name of the counter for automatic numbering. + This must be given if +\family typewriter +\series medium +Labeltype +\family default +\series default + is +\family typewriter +Counter +\family default +. +\end_layout + +\begin_layout Description \family typewriter \series medium @@ -7280,39 +6908,66 @@ aragraph\InsetSpace ~ Settings \family default dialog. - When the labeltype is + When \family typewriter -Counter_ -\emph on -xxx +\series medium +LabelCounter \family default -\emph default -, this string is prepended to the counter. +\series default + is set, this string is prepended to the counter. \end_layout \begin_layout Description - \family typewriter \series medium -EndLabeltype +LabelStringAppendix \family default \series default [ \family typewriter -\emph on -No_Label -\emph default -, Box, Filled_Box, Static +string="" \family default -] The type of label that stands at the end of the paragraph (or sequence - of paragraphs if +] This is used inside the appendix instead of \family typewriter -LatexType +LabelString \family default - is +. +\end_layout + +\begin_layout Description + \family typewriter -Environment +\series medium +TocLevel [int] +\family default +\series default + The level of the style in the table of contents. + This is used for automatic numbering of counters. +\end_layout + +\begin_layout Description + +\family typewriter +\series medium +EndLabeltype +\family default +\series default + [ +\family typewriter +\emph on +No_Label +\emph default +, Box, Filled_Box, Static +\family default +] The type of label that stands at the end of the paragraph (or sequence + of paragraphs if +\family typewriter +LatexType +\family default + is +\family typewriter +Environment \family default , \family typewriter @@ -7680,14 +7323,12 @@ setspace.sty \begin_layout Description - \family typewriter \series medium Font -\series default -[ \family default - The font used for both the text body +\series default +The font used for both the text body \emph on and \emph default @@ -8143,13 +7762,131 @@ string \end_layout \begin_layout Subsection - -Counters +Character styles \end_layout \begin_layout Standard +\begin_inset LatexCommand \label{sec:charstyle} + +\end_inset + +You can define character styles since version 1.4.0 of LyX. + The +\family typewriter +CharStyle +\family default + section can contain the following entries: +\end_layout + +\begin_layout Description + +\family typewriter +\series medium +Font +\family default +\series default +The font used for both the text body +\emph on +and +\emph default + the label. + See section\InsetSpace ~ +\begin_inset LatexCommand \ref{sec:fonts} + +\end_inset +. + Note that defining this font automatically defines the +\family typewriter +LabelFont +\family default + to the same value. +\end_layout + +\begin_layout Description + +\family typewriter +\series medium +LabelFont +\family default +\series default + The font used for the label. + See section\InsetSpace ~ + +\begin_inset LatexCommand \ref{sec:fonts} + +\end_inset + +. +\end_layout + +\begin_layout Description + +\family typewriter +\series medium +LatexName +\family default +\series default + The name of the corresponding LaTeX stuff. + Either the environment or command name. +\end_layout + +\begin_layout Description + +\family typewriter +\series medium +LatexParam +\family default +\series default + The optional parameter for the corresponding +\family typewriter +\series medium +LatexName +\family default +\series default + stuff. + This parameter cannot be changed from within LyX. +\end_layout + +\begin_layout Description + +\family typewriter +\series medium +LatexType +\family default +\series default + See section\InsetSpace ~ + +\begin_inset LatexCommand \ref{sec:style} + +\end_inset + +. +\end_layout + +\begin_layout Description + +\family typewriter +\series medium +Preamble\SpecialChar \ldots{} +EndPreamble +\family default +\series default + See section\InsetSpace ~ + +\begin_inset LatexCommand \ref{sec:style} + +\end_inset + + +\end_layout + +\begin_layout Subsection +Counters +\end_layout + +\begin_layout Standard \begin_inset LatexCommand \label{sec:counter} \end_inset @@ -8360,8 +8081,78 @@ none ] \end_layout -\begin_layout Section +\begin_layout Subsection +Upgrading old layout files +\end_layout + +\begin_layout Standard +The file format of layout files changes from time to time, so old layout + files need to be converted. + This process has been automated in LyX 1.4.0: If LyX reads an old format + layout file it will call the conversion tool +\family typewriter +$LyXDir/scripts/layout2layout.py +\family default + and convert it to a temporary file in current format. + The original file is left untouched, so that you can still use it with + LyX 1.3.x. + If you want to convert the layout file permanently, just call the converter + by hand: +\end_layout + +\begin_layout LyX-Code +python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout +\end_layout + +\begin_layout Standard +Then copy +\family typewriter +myclassnew.layout +\family default + to +\family typewriter +$UserDir/layouts/ +\family default +. +\end_layout + +\begin_layout Standard +The automatic conversion does only handle syntax changes. + It cannot handle the case where the contents of included files was changed. + For example, layout files based on +\family typewriter +book.layout +\family default + need to include +\family typewriter +numreport.inc +\family default + in addition to +\family typewriter +stdclass.inc +\family default +. + If you get error messages about undefined counters, try to convert your + file with +\family typewriter +layout2layout.py +\family default + and then add one of +\family typewriter +numarticle.inc +\family default +, +\family typewriter +numreport.inc +\family default + and +\family typewriter +numrevtex.inc +\family default +. +\end_layout +\begin_layout Section Creating Templates \begin_inset LatexCommand \label{sec:templates}