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/ #LyX 1.6.0svn created this file. For more info see http://www.lyx.org/
\lyxformat 276 \lyxformat 278
\begin_document \begin_document
\begin_header \begin_header
\textclass book \textclass book
@ -39,10 +39,8 @@
\paperpagestyle headings \paperpagestyle headings
\tracking_changes false \tracking_changes false
\output_changes false \output_changes false
\author "" \author ""
\author "" \author ""
\author ""
\author ""
\end_header \end_header
\begin_body \begin_body
@ -7426,7 +7424,7 @@ Settings
LabelCounter LabelCounter
\family default \family default
\series 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 ~ in Section\InsetSpace ~
\begin_inset LatexCommand ref \begin_inset LatexCommand ref
@ -7434,6 +7432,34 @@ reference "sec:counter"
\end_inset \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 \end_layout
@ -8304,6 +8330,22 @@ string
] The heading used for the list of floats. ] The heading used for the list of floats.
\end_layout \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 \begin_layout Subsection
Character styles Character styles
\end_layout \end_layout
@ -8459,9 +8501,7 @@ Input stdcounters.inc
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard
The definition of counters is presently a bit primitive in LyX, since many The following parameters can be used:
things are still hardcoded.
The following two parameters can be used:
\end_layout \end_layout
\begin_layout Description \begin_layout Description
@ -8483,7 +8523,7 @@ string
\begin_inset Quotes erd \begin_inset Quotes erd
\end_inset \end_inset
] The name of the counter ] The name of the counter.
\end_layout \end_layout
\begin_layout Description \begin_layout Description
@ -8506,48 +8546,75 @@ string
\end_inset \end_inset
] If this is set to the name of another counter, the present counter will ] 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 \end_layout
\begin_layout Standard \begin_layout Description
When a counter has been associated to a style, it is possible to use some
special constructs in
\family typewriter \family typewriter
LabelSt \series medium
LabelString [string=""]
\family default \family default
r \series default
\family typewriter when this is defined, this string defines how the counter is displayed.
ing Setting this value resets
\family default
and
\family typewriter \family typewriter
LabelStringAppendix LabelStringAppendix
\family default \family default
: to the same value.
The following special constructs can be used in the string:
\end_layout \end_layout
\begin_deeper
\begin_layout Itemize \begin_layout Itemize
\family typewriter \family typewriter
@
\emph on \backslash
style-name thecounter
\emph default
@
\family default \family default
will be replaced the expanded will be replaced by the expansion of the
\family typewriter \family typewriter
LabelString LabelString
\family default \family default
of style (or
\family typewriter \family typewriter
\emph on LabelStringAppendix
style-name \family default
) of the counter
\family typewriter
counter
\family default \family default
\emph default
. .
This is used for example to define the label of a subsection in terms of If these are empty, a default value is constructed as follows: if the counter
the label of a section. 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 \end_layout
\begin_layout Itemize \begin_layout Itemize
@ -8684,6 +8751,21 @@ hebrew
\end_layout \end_layout
\end_deeper \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 \begin_layout Subsection
Font description Font description
\end_layout \end_layout

View File

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

View File

@ -2,54 +2,15 @@
# This include file contains label definitions for an article-like numbering. # This include file contains label definitions for an article-like numbering.
Format 4 Format 4
Style Part
LabelType Counter
LabelCounter part
LabelString "Part \Roman{part}"
TocLevel 0
End
# appendix applies to sections.
Style Section Counter
LabelType Counter Name section
LabelCounter section Within "none"
LabelString "\arabic{section}" LabelString "\arabic{section}"
LabelStringAppendix "\Alph{section}" LabelStringAppendix "\Alph{section}"
TocLevel 1
End 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. # This include file contains label definitions for a report-like numbering.
Format 4 Format 4
Input numarticle.inc
Style Part Style Part
TocLevel -1 TocLevel -1
End End
Counter
Name chapter
Within ""
LabelString "\arabic{chapter}"
LabelStringAppendix "\Alph{chapter}"
End
Style Chapter Counter
LabelType Counter Name section
LabelCounter chapter Within chapter
LabelString "Chapter \arabic{chapter}" LabelString ""
LabelStringAppendix "Appendix \Alph{chapter}" End
TocLevel 0
Float
Type table
NumberWithin chapter
End End
Style Section Float
LabelString "\arabic{chapter}.\arabic{section}" Type figure
LabelStringAppendix "\Alph{chapter}.\arabic{section}" NumberWithin chapter
End 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 Style Chapter
LabelString "\arabic{chapter}" LabelString "\thechapter"
LabelStringAppendix "\Alph{chapter}"
End End

View File

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

View File

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

View File

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

View File

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