The counters labelstring patch. Part 3: adapt some layout files and documentation

* numarticle.inc:
	* numreport.inc: 
	* stdcounter.inc:
	* stdsections.inc:
	* stdstarsections.inc:
	* stdclass.inc:
	* scrbook.layout:
	* amsmath.inc: adapt: remove most of the LabelString in layouts,
	add the necessary stuff to counters.

	* lib/doc/Customization.lyx: document the new stuff.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19604 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2007-08-16 11:16:07 +00:00
parent f756c02329
commit f86fc8d88c
9 changed files with 211 additions and 129 deletions

View File

@ -1,5 +1,5 @@
#LyX 1.5.0svn created this file. For more info see http://www.lyx.org/
\lyxformat 276
#LyX 1.6.0svn created this file. For more info see http://www.lyx.org/
\lyxformat 278
\begin_document
\begin_header
\textclass book
@ -41,8 +41,6 @@
\output_changes false
\author ""
\author ""
\author ""
\author ""
\end_header
\begin_body
@ -7426,7 +7424,7 @@ Settings
LabelCounter
\family default
\series default
is set, this string can be contain special formatting commands as explained
is set, this string can be contain the special formatting commands described
in Section\InsetSpace ~
\begin_inset LatexCommand ref
@ -7434,6 +7432,34 @@ reference "sec:counter"
\end_inset
.
For the sake of backwards compatibility, the string
\family typewriter
@
\emph on
style-name
\emph default
@
\family default
will be replaced by the expanded
\family typewriter
LabelString
\family default
of style
\family typewriter
\emph on
style-name
\family default
\emph default
.
This feature is now obsolete and should be replaced by the mechanisms of
Section\InsetSpace ~
\begin_inset LatexCommand ref
reference "sec:counter"
\end_inset
.
\end_layout
@ -8304,6 +8330,22 @@ string
] The heading used for the list of floats.
\end_layout
\begin_layout Standard
Note that defining a float with type
\family typewriter
\emph on
type
\family default
\emph default
automatically defines the corresponding counter with name
\family typewriter
\emph on
type
\family default
\emph default
.
\end_layout
\begin_layout Subsection
Character styles
\end_layout
@ -8459,9 +8501,7 @@ Input stdcounters.inc
\end_layout
\begin_layout Standard
The definition of counters is presently a bit primitive in LyX, since many
things are still hardcoded.
The following two parameters can be used:
The following parameters can be used:
\end_layout
\begin_layout Description
@ -8483,7 +8523,7 @@ string
\begin_inset Quotes erd
\end_inset
] The name of the counter
] The name of the counter.
\end_layout
\begin_layout Description
@ -8506,48 +8546,75 @@ string
\end_inset
] If this is set to the name of another counter, the present counter will
be reset everytime the other one is increased (is that unclear enough?).
be reset everytime the other one is increased.
For example,
\family typewriter
subsection
\family default
is numbered inside
\family typewriter
section
\family default
.
\end_layout
\begin_layout Standard
When a counter has been associated to a style, it is possible to use some
special constructs in
\begin_layout Description
\family typewriter
LabelSt
\series medium
LabelString [string=""]
\family default
r
\family typewriter
ing
\family default
and
\series default
when this is defined, this string defines how the counter is displayed.
Setting this value resets
\family typewriter
LabelStringAppendix
\family default
:
to the same value.
The following special constructs can be used in the string:
\end_layout
\begin_deeper
\begin_layout Itemize
\family typewriter
@
\emph on
style-name
\emph default
@
\backslash
thecounter
\family default
will be replaced the expanded
will be replaced by the expansion of the
\family typewriter
LabelString
\family default
of style
(or
\family typewriter
\emph on
style-name
LabelStringAppendix
\family default
) of the counter
\family typewriter
counter
\family default
\emph default
.
This is used for example to define the label of a subsection in terms of
the label of a section.
If these are empty, a default value is constructed as follows: if the counter
has a master counter
\family typewriter
master
\family default
, the string
\family typewriter
\backslash
themaster.
\backslash
arabic{counter}
\family default
is used; otherwise the string
\family typewriter
\backslash
arabic{counter}
\family default
is used.
\end_layout
\begin_layout Itemize
@ -8684,6 +8751,21 @@ hebrew
\end_layout
\end_deeper
\end_deeper
\begin_layout Description
\family typewriter
\series medium
LabelStringAppendix [string=""]
\family default
\series default
the same as
\family typewriter
LabelString
\family default
, for use in appendix.
\end_layout
\begin_layout Subsection
Font description
\end_layout

View File

@ -76,7 +76,7 @@ Style Theorem
AlignPossible Block, Left
LabelType Counter
LabelCounter theorem
LabelString "Theorem @Section@.\arabic{theorem}."
LabelString "Theorem \thetheorem."
Font
Shape Italic
Size Normal
@ -103,7 +103,7 @@ End
Style Corollary
CopyStyle Theorem
LatexName cor
LabelString "Corollary @Section@.\arabic{theorem}."
LabelString "Corollary \thetheorem."
Preamble
\theoremstyle{plain}
\newtheorem{cor}[thm]{Corollary}
@ -125,7 +125,7 @@ End
Style Lemma
CopyStyle Theorem
LatexName lem
LabelString "Lemma @Section@.\arabic{theorem}."
LabelString "Lemma \thetheorem."
Preamble
\theoremstyle{plain}
\newtheorem{lem}[thm]{Lemma}
@ -147,7 +147,7 @@ End
Style Proposition
CopyStyle Theorem
LatexName prop
LabelString "Proposition @Section@.\arabic{theorem}."
LabelString "Proposition \thetheorem."
Preamble
\theoremstyle{plain}
\newtheorem{prop}[thm]{Proposition}
@ -169,7 +169,7 @@ End
Style Conjecture
CopyStyle Theorem
LatexName conjecture
LabelString "Conjecture @Section@.\arabic{theorem}."
LabelString "Conjecture \thetheorem."
Preamble
\theoremstyle{plain}
\newtheorem{conjecture}[thm]{Conjecture}
@ -191,7 +191,7 @@ End
Style Criterion
CopyStyle Theorem
LatexName criterion
LabelString "Criterion @Section@.\arabic{theorem}."
LabelString "Criterion \thetheorem."
Preamble
\theoremstyle{plain}
\newtheorem{criterion}[thm]{Criterion}
@ -202,7 +202,7 @@ End
Style Algorithm
CopyStyle Theorem
LatexName algorithm
LabelString "Algorithm @Section@.\arabic{theorem}."
LabelString "Algorithm \thetheorem."
Preamble
\theoremstyle{plain}
\newtheorem{algorithm}[thm]{Algorithm}
@ -213,7 +213,7 @@ End
Style Fact
CopyStyle Theorem
LatexName fact
LabelString "Fact @Section@.\arabic{theorem}."
LabelString "Fact \thetheorem."
Preamble
\theoremstyle{plain}
\newtheorem{fact}[thm]{Fact}
@ -235,7 +235,7 @@ End
Style Axiom
CopyStyle Theorem
LatexName ax
LabelString "Axiom @Section@.\arabic{theorem}."
LabelString "Axiom \thetheorem."
Preamble
\theoremstyle{plain}
\newtheorem{ax}[thm]{Axiom}
@ -246,7 +246,7 @@ End
Style Definition
CopyStyle Theorem
LatexName defn
LabelString "Definition @Section@.\arabic{theorem}."
LabelString "Definition \thetheorem."
Font
Shape Up
EndFont
@ -276,7 +276,7 @@ End
Style Example
CopyStyle Definition
LatexName example
LabelString "Example @Section@.\arabic{theorem}."
LabelString "Example \thetheorem."
Preamble
\theoremstyle{definition}
\newtheorem{example}[thm]{Example}
@ -298,7 +298,7 @@ End
Style Condition
CopyStyle Definition
LatexName condition
LabelString "Condition @Section@.\arabic{theorem}."
LabelString "Condition \thetheorem."
Preamble
\theoremstyle{definition}
\newtheorem{condition}[thm]{Condition}
@ -320,7 +320,7 @@ End
Style Problem
CopyStyle Definition
LatexName problem
LabelString "Problem @Section@.\arabic{theorem}."
LabelString "Problem \thetheorem."
Preamble
\theoremstyle{definition}
\newtheorem{problem}[thm]{Problem}
@ -342,7 +342,7 @@ End
Style Exercise
CopyStyle Definition
LatexName xca
LabelString "Exercise @Section@.\arabic{theorem}."
LabelString "Exercise \thetheorem."
Preamble
\theoremstyle{definition}
%%Delete [section] for sequential numbering
@ -365,7 +365,7 @@ End
Style Remark
CopyStyle Theorem
LatexName rem
LabelString "Remark @Section@.\arabic{theorem}."
LabelString "Remark \thetheorem."
Font
Shape Up
Size Normal
@ -396,7 +396,7 @@ End
Style Claim
CopyStyle Remark
LatexName claim
LabelString "Claim @Section@.\arabic{theorem}."
LabelString "Claim \thetheorem."
Preamble
\theoremstyle{remark}
\newtheorem{claim}[thm]{Claim}
@ -418,7 +418,7 @@ End
Style Note
CopyStyle Remark
LatexName note
LabelString "Note @Section@.\arabic{theorem}."
LabelString "Note \thetheorem."
Preamble
\theoremstyle{remark}
\newtheorem{note}[thm]{Note}
@ -440,7 +440,7 @@ End
Style Notation
CopyStyle Remark
LatexName notation
LabelString "Notation @Section@.\arabic{theorem}."
LabelString "Notation \thetheorem."
Preamble
\theoremstyle{remark}
\newtheorem{notation}[thm]{Notation}
@ -462,7 +462,7 @@ End
Style Summary
CopyStyle Remark
LatexName summary
LabelString "Summary @Section@.\arabic{theorem}."
LabelString "Summary \thetheorem."
Preamble
\theoremstyle{remark}
\newtheorem{summary}[thm]{Summary}
@ -473,7 +473,7 @@ End
Style Acknowledgement
CopyStyle Remark
LatexName acknowledgement
LabelString "Acknowledgement @Section@.\arabic{theorem}."
LabelString "Acknowledgement \thetheorem."
Preamble
\theoremstyle{remark}
\newtheorem{acknowledgement}[thm]{Acknowledgement}
@ -495,7 +495,7 @@ End
Style Case
CopyStyle Remark
LatexName case
LabelString "Case @Section@.\arabic{theorem}."
LabelString "Case \thetheorem."
Preamble
\theoremstyle{remark}
\newtheorem{case}{Case} %%Numbering of Cases not keyed to sections
@ -506,7 +506,7 @@ End
Style Conclusion
CopyStyle Remark
LatexName conclusion
LabelString "Conclusion @Section@.\arabic{theorem}."
LabelString "Conclusion \thetheorem."
Preamble
\theoremstyle{remark}
\newtheorem{conclusion}[thm]{Conclusion}

View File

@ -2,54 +2,15 @@
# This include file contains label definitions for an article-like numbering.
Format 4
Style Part
LabelType Counter
LabelCounter part
LabelString "Part \Roman{part}"
TocLevel 0
End
Style Section
LabelType Counter
LabelCounter section
# appendix applies to sections.
Counter
Name section
Within "none"
LabelString "\arabic{section}"
LabelStringAppendix "\Alph{section}"
TocLevel 1
End
Style Subsection
LabelType Counter
LabelCounter subsection
LabelString "@Section@.\arabic{subsection}"
LabelStringAppendix "@Section@.\arabic{subsection}"
TocLevel 2
End
Style Subsubsection
LabelType Counter
LabelCounter subsubsection
LabelString "@Subsection@.\arabic{subsubsection}"
LabelStringAppendix "@Subsection@.\arabic{subsubsection}"
TocLevel 3
End
Style Paragraph
LabelType Counter
LabelCounter paragraph
LabelString "@Subsubsection@.\arabic{paragraph}"
LabelStringAppendix "@Subsubsection@.\arabic{paragraph}"
TocLevel 4
End
Style Subparagraph
LabelType Counter
LabelCounter subparagraph
LabelString "@Paragraph@.\arabic{subparagraph}"
LabelStringAppendix "@Paragraph@.\arabic{subparagraph}"
TocLevel 5
End

View File

@ -2,24 +2,48 @@
# This include file contains label definitions for a report-like numbering.
Format 4
Input numarticle.inc
Style Part
TocLevel -1
End
Counter
Name chapter
Within ""
LabelString "\arabic{chapter}"
LabelStringAppendix "\Alph{chapter}"
End
Style Chapter
LabelType Counter
LabelCounter chapter
LabelString "Chapter \arabic{chapter}"
LabelStringAppendix "Appendix \Alph{chapter}"
TocLevel 0
Counter
Name section
Within chapter
LabelString ""
End
Float
Type table
NumberWithin chapter
End
Style Section
LabelString "\arabic{chapter}.\arabic{section}"
LabelStringAppendix "\Alph{chapter}.\arabic{section}"
Float
Type figure
NumberWithin chapter
End
Float
Type algorithm
NumberWithin chapter
End
Counter
Name listing
Within chapter
End
Counter
Name footnote
Within chapter
LabelString "\arabic{footnote}"
End

View File

@ -14,8 +14,7 @@ NoStyle Abstract
Style Chapter
LabelString "\arabic{chapter}"
LabelStringAppendix "\Alph{chapter}"
LabelString "\thechapter"
End

View File

@ -37,6 +37,8 @@ Style Standard
End
Input stdfloats.inc
Input stdcounters.inc
Input stdinsets.inc
Input stdlists.inc
Input stdsections.inc
@ -45,5 +47,3 @@ Input stdtitle.inc
Input stdstruct.inc
Input lyxmacros.inc
Input stdlayouts.inc
Input stdfloats.inc
Input stdcounters.inc

View File

@ -7,6 +7,7 @@
Format 4
Counter
Name part
LabelString "\Roman{part}"
End
Counter
@ -62,25 +63,13 @@ Counter
End
Counter
Name figure
End
Counter
Name table
End
Counter
Name algorithm
Name listing
End
Counter
Name equation
End
Counter
Name listing
End
Counter
Name footnote
End

View File

@ -10,6 +10,10 @@
Format 4
Style Part
Margin Dynamic
LabelString "Part \thepart"
LabelType Counter
TocLevel 0
LabelCounter part
LatexType Command
LatexName part
NeedProtect 1
@ -30,6 +34,11 @@ End
Style Chapter
Margin Static
LabelString "Chapter \thechapter"
LabelStringAppendix "Appendix \thechapter"
LabelType Counter
LabelCounter chapter
TocLevel 0
LatexType Command
LatexName chapter
NeedProtect 1
@ -50,6 +59,9 @@ End
Style Section
Margin Dynamic
LabelType Counter
LabelCounter section
TocLevel 1
LatexType Command
LatexName section
NeedProtect 1
@ -71,6 +83,8 @@ End
Style Subsection
CopyStyle Section
LabelCounter subsection
TocLevel 2
LatexName subsection
TopSep 0.9
BottomSep 0.5
@ -84,6 +98,8 @@ End
Style Subsubsection
CopyStyle Subsection
LabelCounter subsubsection
TocLevel 3
LatexName subsubsection
TopSep 0.7
BottomSep 0.4
@ -96,6 +112,8 @@ End
Style Paragraph
CopyStyle Subsubsection
LabelCounter paragraph
TocLevel 4
LatexName paragraph
TopSep 0.4
BottomSep 0
@ -104,6 +122,8 @@ End
Style Subparagraph
CopyStyle Paragraph
LabelCounter subparagraph
TocLevel 5
LatexName subparagraph
NextNoIndent 0
LeftMargin MM

View File

@ -15,6 +15,7 @@ Style Part*
Margin Static
LatexName part*
LabelType No_Label
LabelCounter ""
End
@ -23,6 +24,7 @@ Style Chapter*
Margin Static
LatexName chapter*
LabelType No_Label
LabelCounter ""
OptionalArgs 0
End
@ -32,6 +34,7 @@ Style Section*
Margin Static
LatexName section*
LabelType No_Label
LabelCounter ""
OptionalArgs 0
End
@ -41,6 +44,7 @@ Style Subsection*
Margin Static
LatexName subsection*
LabelType No_Label
LabelCounter ""
OptionalArgs 0
End
@ -50,6 +54,7 @@ Style Subsubsection*
Margin Static
LatexName subsubsection*
LabelType No_Label
LabelCounter ""
OptionalArgs 0
End
@ -59,6 +64,7 @@ Style Paragraph*
Margin Static
LatexName paragraph*
LabelType No_Label
LabelCounter ""
OptionalArgs 0
End
@ -68,5 +74,6 @@ Style Subparagraph*
Margin Static
LatexName subparagraph*
LabelType No_Label
LabelCounter ""
OptionalArgs 0
End