commit 91f5d90971a7a7eaaa6e7b748a8cd68f8a3bea93
Author: Juergen Spitzmueller <sp...@lyx.org>
Date:   Fri Oct 14 11:40:53 2016 +0200

    Fix label display in linguistic examples
    
    Ideally, we would use a proper counter here, but this seems to be
    impossible with the current counter mechanism.
    
    What we would need is a counter that is incremented when either of the
    layouts is used. Currently, the counter seems to be stepped only inside
    one layout.
    
    The current fix is a candidate for stable.
---
 lib/layouts/linguistics.module |   33 +++++++++++++++++++++++++++++++--
 1 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/lib/layouts/linguistics.module b/lib/layouts/linguistics.module
index c2f3df1..062d5ee 100644
--- a/lib/layouts/linguistics.module
+++ b/lib/layouts/linguistics.module
@@ -9,6 +9,33 @@
 
 Format 60
 
+# FIXME: It is currently not possible to share a
+# counter in layouts with STATIC and ENUMERATE
+# LabelType. The counters are not stepped properly.
+Counter example
+       Within               chapter
+#      LabelString          "(\arabic{example})"
+       LabelString          "Examples:"
+End
+
+Counter examplei
+       Within               chapter
+#      LabelString          "(\arabic{examplei})"
+       LabelString          "Examples:"
+End
+
+Counter subexample
+       Within               examplei
+#      LabelString          "\theexamplei (\alph{subexample})"
+       LabelString          "Subexample:"
+End
+
+Counter subexamplei
+       Within               examplei
+#      LabelString          "\theexamplei (\alph{subexamplei})"
+       LabelString          "Subexample:"
+End
+
 # single numbered example with covington.sty
 Style Numbered_Example_(multiline)
        LatexType             Environment
@@ -24,6 +51,7 @@ Style Numbered_Example_(multiline)
        Align                 Block
        AlignPossible         Block, Left
        LabelType             Static
+#      LabelCounter          "example"
        LabelString           "Example:"
        LabelFont
                Shape         Italic
@@ -46,7 +74,8 @@ Style Numbered_Examples_(consecutive)
        CopyStyle             Numbered_Example_(multiline)
        LatexType             Item_Environment
        LatexName             covexamples
-       LabelString           "Examples:"
+       LabelType             Enumerate
+       LabelCounter          "example"
        Argument item:1
                LabelString   "Custom Numbering|s"
                Tooltip       "Customize the numeration"
@@ -65,7 +94,7 @@ End
 Style Subexample
        CopyStyle             Numbered_Examples_(consecutive)
        LatexName             subexample
-       LabelString           "Subexample:"
+       LabelCounter          "subexample"
        Requires              covington,enumitem
        Preamble
                \newenvironment{subexample}{%

Reply via email to