]> git.lyx.org Git - lyx.git/blobdiff - lib/doc/Customization.lyx
Add to credit, sorry Edwin your 2c seem to be the only ones
[lyx.git] / lib / doc / Customization.lyx
index f0b6228b0defa93a5eba8d153f72bcf1a064f89b..a98dbcad3770ddc53f3961ab546a932453529d20 100644 (file)
@@ -1,5 +1,5 @@
 #LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
-\lyxformat 374
+\lyxformat 376
 \begin_document
 \begin_header
 \textclass scrbook
@@ -45,6 +45,7 @@
 \begin_modules
 logicalmkup
 \end_modules
+\maintain_unincluded_children false
 \begin_local_layout
 Format 7
 InsetLayout CharStyle:MenuItem
@@ -5305,8 +5306,9 @@ article.cls
 
 \end_inset
 
-, is contained in layout files.
+, is contained in `layout files'.
  Similarly, LyX itself does not know much about DocBook or XHTML.
+ What it knows is contained in layout files.
 \end_layout
 
 \begin_layout Standard
@@ -6415,7 +6417,7 @@ DeclareLyXModule{My Package}
 \end_layout
 
 \begin_layout LyX-Code
-Format 20
+Format 21
 \begin_inset Newline newline
 \end_inset
 
@@ -7505,12 +7507,12 @@ int
 This tag was introduced with LyX 1.4.0.
  Layout files from LyX 1.3.x and earlier don't have an explicit file format
  and are considered to be of format 1.
- The format for the present version of LyX is format 20.
+ The format for the present version of LyX is format 21.
  But each version of LyX is capable of reading earlier versions' layout
  files, just as they are capable of reading files produced by earlier versions
  of LyX.
  There is, however, no provision for converting to earlier formats.
- So LyX 1.6.x will not read layout files in format 20 but only files in format
+ So LyX 1.6.x will not read layout files in format 21 but only files in format
  11 or earlier.
 \end_layout
 
@@ -8081,6 +8083,33 @@ EndPreamble
 \begin_inset Flex CharStyle:Code
 status collapsed
 
+\begin_layout Plain Layout
+HTMLTOCSection
+\end_layout
+
+\end_inset
+
+ [
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+] The layout to use for the table of contents, bibliography, and so forth,
+ when the document is output to HTML.
+ For articles, this should normally be Section; for books, Chapter.
+ If it is not given, then LyX will attempt to figure out which layout to
+ use.
+\end_layout
+
+\begin_layout Description
+\begin_inset Flex CharStyle:Code
+status collapsed
+
 \begin_layout Plain Layout
 IfCounter
 \end_layout
@@ -8387,8 +8416,6 @@ PageStyle
 \end_inset
 
  [
-\emph on
-
 \begin_inset Flex CharStyle:Code
 status collapsed
 
@@ -8400,8 +8427,6 @@ plain
 
 \end_inset
 
-
-\emph default
 , 
 \begin_inset Flex CharStyle:Code
 status collapsed
@@ -8772,8 +8797,6 @@ Sides
 \end_inset
 
  [
-\emph on
-
 \begin_inset Flex CharStyle:Code
 status collapsed
 
@@ -8785,8 +8808,6 @@ status collapsed
 
 \end_inset
 
-
-\emph default
 , 
 \begin_inset Flex CharStyle:Code
 status collapsed
@@ -9923,8 +9944,6 @@ name "des:FreeSpacing"
 \end_inset
 
 [
-\emph on
-
 \begin_inset Flex CharStyle:Code
 status collapsed
 
@@ -9936,8 +9955,6 @@ status collapsed
 
 \end_inset
 
-
-\emph default
 , 
 \begin_inset Flex CharStyle:Code
 status collapsed
@@ -10152,8 +10169,6 @@ name "des:KeepEmpty"
 \end_inset
 
 [
-\emph on
-
 \begin_inset Flex CharStyle:Code
 status collapsed
 
@@ -10165,8 +10180,6 @@ status collapsed
 
 \end_inset
 
-
-\emph default
 , 
 \begin_inset Flex CharStyle:Code
 status collapsed
@@ -12022,8 +12035,6 @@ name "des:PathThru"
 \end_inset
 
 [
-\emph on
-
 \begin_inset Flex CharStyle:Code
 status collapsed
 
@@ -12035,8 +12046,6 @@ status collapsed
 
 \end_inset
 
-
-\emph default
 , 
 \begin_inset Flex CharStyle:Code
 status collapsed
@@ -12486,6 +12495,20 @@ string
 \begin_inset Flex CharStyle:Code
 status collapsed
 
+\begin_layout Plain Layout
+HTML*
+\end_layout
+
+\end_inset
+
+ These are used for XHTML output.
+ See 
+\end_layout
+
+\begin_layout Description
+\begin_inset Flex CharStyle:Code
+status collapsed
+
 \begin_layout Plain Layout
 LaTeXBuiltin
 \end_layout
@@ -13878,7 +13901,7 @@ reference "des:LatexType"
 status collapsed
 
 \begin_layout Plain Layout
-LyxType 
+LyxType
 \end_layout
 
 \end_inset
@@ -13926,6 +13949,62 @@ end
  (indicating a dummy definition ending definitions of charstyles, etc).
  This entry is required in and is only meaningful for Flex insets.
  Among other things, it determines on which menu this inset will appear.
+ Setting 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+LyXType
+\end_layout
+
+\end_inset
+
+ to 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+charstyle
+\end_layout
+
+\end_inset
+
+ will set 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+MultiPar
+\end_layout
+
+\end_inset
+
+ to false.
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+MultiPar
+\end_layout
+
+\end_inset
+
+ can be set to true for charstyle insets, if you wish, by setting it 
+\emph on
+after
+\emph default
+ you set the 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+LyXType
+\end_layout
+
+\end_inset
+
+.
 \end_layout
 
 \begin_layout Description
@@ -14246,12 +14325,30 @@ End
 status collapsed
 
 \begin_layout Plain Layout
-LabelString [string=""]
+LabelString
+\end_layout
+
+\end_inset
+
+ [
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+string
 \end_layout
 
 \end_inset
 
- when this is defined, this string defines how the counter is displayed.
+=
+\begin_inset Quotes erd
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+] When defined, this string defines how the counter is displayed.
  Setting this value sets 
 \begin_inset Flex CharStyle:Code
 status collapsed
@@ -14510,12 +14607,30 @@ arabic{counter}
 status collapsed
 
 \begin_layout Plain Layout
-LabelStringAppendix [string=""]
+LabelStringAppendix
+\end_layout
+
+\end_inset
+
+ [
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+string
 \end_layout
 
 \end_inset
 
- Same as 
+=
+\begin_inset Quotes erd
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+] Same as 
 \begin_inset Flex CharStyle:Code
 status collapsed
 
@@ -14532,6 +14647,58 @@ LabelString
 \begin_inset Flex CharStyle:Code
 status collapsed
 
+\begin_layout Plain Layout
+PrettyFormat
+\end_layout
+
+\end_inset
+
+ [
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+=
+\begin_inset Quotes erd
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+] A format for use with formatted references to this counter.
+ For example, one might want to have references to section numbers appear
+ as 
+\begin_inset Quotes eld
+\end_inset
+
+Section 2.4
+\begin_inset Quotes erd
+\end_inset
+
+.
+ The string should contain 
+\begin_inset Quotes eld
+\end_inset
+
+##
+\begin_inset Quotes erd
+\end_inset
+
+.
+ This will be replaced by the counter number itself.
+ So, for sections, it would be: Section ##.
+\end_layout
+
+\begin_layout Description
+\begin_inset Flex CharStyle:Code
+status collapsed
+
 \begin_layout Plain Layout
 Within
 \end_layout
@@ -14734,8 +14901,6 @@ Family
 \end_inset
 
  [
-\emph on
-
 \begin_inset Flex CharStyle:Code
 status collapsed
 
@@ -14747,8 +14912,6 @@ Roman
 
 \end_inset
 
-
-\emph default
 , 
 \begin_inset Flex CharStyle:Code
 status collapsed
@@ -14906,8 +15069,6 @@ Series
 \end_inset
 
  [
-\emph on
-
 \begin_inset Flex CharStyle:Code
 status collapsed
 
@@ -14919,8 +15080,6 @@ Medium
 
 \end_inset
 
-
-\emph default
 , 
 \begin_inset Flex CharStyle:Code
 status collapsed
@@ -14945,8 +15104,6 @@ Shape
 \end_inset
 
  [
-\emph on
-
 \begin_inset Flex CharStyle:Code
 status collapsed
 
@@ -14958,8 +15115,6 @@ Up
 
 \end_inset
 
-
-\emph default
 , 
 \begin_inset Flex CharStyle:Code
 status collapsed
@@ -15533,7 +15688,11 @@ HTMLForceCSS
 status collapsed
 
 \begin_layout Plain Layout
-0,1
+
+\emph on
+0
+\emph default
+,1
 \end_layout
 
 \end_inset
@@ -15763,7 +15922,11 @@ HTMLLabelFirst
 status collapsed
 
 \begin_layout Plain Layout
-0,1
+
+\emph on
+0
+\emph default
+,1
 \end_layout
 
 \end_inset
 .
 \end_layout
 
-\begin_layout Subsection
-InsetLayout XHTML
-\end_layout
-
-\begin_layout Standard
-The XHTML output of insets can also be controlled by information in layout
- files.
-\begin_inset Foot
+\begin_layout Description
+\begin_inset Flex CharStyle:Code
 status collapsed
 
 \begin_layout Plain Layout
-At present, this is true only for 
-\begin_inset Quotes eld
-\end_inset
+HTMLTitle
+\end_layout
 
-text
-\begin_inset Quotes erd
 \end_inset
 
- insets (insets you can type into) and is not true for 
-\begin_inset Quotes eld
-\end_inset
+ [
+\begin_inset Flex CharStyle:Code
+status collapsed
 
-command
-\begin_inset Quotes erd
-\end_inset
+\begin_layout Plain Layout
 
- insets (insets that are associated with dialog boxes).
+\emph on
+0
+\emph default
+,1
 \end_layout
 
 \end_inset
 
- Here, too, LyX tries to provide sensible defaults, and it constructs default
- CSS style rules.
- But everything can be customized.
-\end_layout
+] Marks this style as the one to be used to generate the 
+\begin_inset Flex CharStyle:Code
+status collapsed
 
-\begin_layout Standard
-The XHTML LyX outputs for an inset has the following form:
+\begin_layout Plain Layout
+<title>
 \end_layout
 
-\begin_layout LyX-Code
-<tag attr=
-\begin_inset Quotes erd
-\end_inset
-
-value
-\begin_inset Quotes erd
+\end_inset
+
+ tag for the XHTML file.
+ By default, it is false.
+ The 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+stdtitle.inc
+\end_layout
+
+\end_inset
+
+ file sets it to true for the 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+title
+\end_layout
+
+\end_inset
+
+ environment.
+\end_layout
+
+\begin_layout Subsection
+InsetLayout XHTML
+\end_layout
+
+\begin_layout Standard
+The XHTML output of insets can also be controlled by information in layout
+ files.
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+At present, this is true only for 
+\begin_inset Quotes eld
+\end_inset
+
+text
+\begin_inset Quotes erd
+\end_inset
+
+ insets (insets you can type into) and is not true for 
+\begin_inset Quotes eld
+\end_inset
+
+command
+\begin_inset Quotes erd
+\end_inset
+
+ insets (insets that are associated with dialog boxes).
+\end_layout
+
+\end_inset
+
+ Here, too, LyX tries to provide sensible defaults, and it constructs default
+ CSS style rules.
+ But everything can be customized.
+\end_layout
+
+\begin_layout Standard
+The XHTML LyX outputs for an inset has the following form:
+\end_layout
+
+\begin_layout LyX-Code
+<tag attr=
+\begin_inset Quotes erd
+\end_inset
+
+value
+\begin_inset Quotes erd
 \end_inset
 
 >
@@ -16423,15 +16646,204 @@ span
 .
 \end_layout
 
+\begin_layout Subsection
+Float XHTML
+\end_layout
+
+\begin_layout Standard
+The XHTML output for floats too can be controlled by layout information.
+ The output has the following form:
+\end_layout
+
+\begin_layout LyX-Code
+<tag attr=
+\begin_inset Quotes erd
+\end_inset
+
+value
+\begin_inset Quotes erd
+\end_inset
+
+>
+\end_layout
+
+\begin_layout LyX-Code
+Contents of the float.
+\end_layout
+
+\begin_layout LyX-Code
+</tag>
+\end_layout
+
+\begin_layout Standard
+The caption, if there is one, is a separate inset and will be output as
+ such.
+ Its appearance can be controlled via the InsetLayout for caption insets.
+\end_layout
+
 \begin_layout Description
-\begin_inset Note Note
-status open
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+HTMLAttr
+\end_layout
+
+\end_inset
+
+ [
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+] Specifies attribute information to be output with the main tag.
+ For example, 
+\begin_inset Quotes eld
+\end_inset
+
+
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+class=`myfloat' onclick=`\SpecialChar \ldots{}
+'
+\end_layout
+
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+.
+ By default, LyX will output 
+\begin_inset Quotes eld
+\end_inset
+
+
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+class=`float float-floattype'
+\end_layout
+
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+, where 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+floattype
+\end_layout
+
+\end_inset
+
+ is LyX's name for this type of float, as determined by the float delcaration
+ (see 
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "sub:Floats"
+
+\end_inset
+
+), though made lowercase and with non-alphanumeric characters converted
+ to underscores, for example: float-table.
+\end_layout
+
+\begin_layout Description
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+HTMLStyle
+\end_layout
+
+\end_inset
+
+ CSS style information to be included when this float is used.
+ Note that this will automatically be wrapped in a layout-generated 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+<style>
+\end_layout
+
+\end_inset
+
+ block, so only the CSS itself need be included.
+\end_layout
+
+\begin_layout Description
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+HTMLTag
+\end_layout
+
+\end_inset
+
+ [
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+] The tag to be used for this float, replacing 
+\begin_inset Quotes eld
+\end_inset
+
+
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+tag
+\end_layout
+
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+ in the example above.
+ The default is 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+div
+\end_layout
+
+\end_inset
+
+ and will rarely need changing.
+\end_layout
 
 \begin_layout Subsection
 LyX-generated CSS
 \end_layout
 
-\begin_layout Plain Layout
+\begin_layout Standard
 We have several times mentioned that LyX will generate default CSS style
  rules for both insets and paragraph styles, based upon the other layout
  information that is provided.
@@ -16439,9 +16851,129 @@ We have several times mentioned that LyX will generate default CSS style
  uses and how.
 \end_layout
 
+\begin_layout Standard
+At present, LyX auto-generates CSS only for font information, making use
+ of the 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+Family
+\end_layout
+
+\end_inset
+
+, 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+Series
+\end_layout
+
 \end_inset
 
+, 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+Shape
+\end_layout
+
+\end_inset
+
+, and 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+Size
+\end_layout
+
+\end_inset
+
+ specified in the 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+Font
+\end_layout
+
+\end_inset
+
+ declaration.
+ (See 
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "sub:Font-description"
+
+\end_inset
+
+.) The translation is mostly straightforward and obvious.
+ For example, 
+\begin_inset Quotes eld
+\end_inset
+
+
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+Family Sans
+\end_layout
+
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+ becomes 
+\begin_inset Quotes eld
+\end_inset
+
+
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+font-family: sans-serif;
+\end_layout
+
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+.
+ The correspondence of LyX sizes and CSS sizes is a little less obvious
+ but nonetheless intuitive.
+ See the 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+getSizeCSS()
+\end_layout
+
+\end_inset
 
+ function in 
+\begin_inset Flex URL
+status collapsed
+
+\begin_layout Plain Layout
+
+src/FontInfo.cpp
+\end_layout
+
+\end_inset
+
+ for the details.
 \end_layout
 
 \begin_layout Chapter