]> git.lyx.org Git - features.git/commitdiff
Covington now provides subexamples itself
authorJuergen Spitzmueller <spitz@lyx.org>
Sat, 8 Sep 2018 07:50:48 +0000 (09:50 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Sat, 8 Sep 2018 07:50:48 +0000 (09:50 +0200)
Candidate for stable.

lib/layouts/linguistics.module

index ead4a422553c19e7e4a49abcdb2462a3fb1c3289..c26f7da51b6ff1285d0cf340115552eeed8a6040 100644 (file)
@@ -95,20 +95,26 @@ Style Numbered_Examples_(consecutive)
 End
 
 
-# multiple numbered example with covington.sty
+# multiple numbered examples with covington.sty
 Style Subexample
        CopyStyle             Numbered_Examples_(consecutive)
-       LatexName             subexample
+       LatexName             covsubexamples
        LabelCounter          "subexample"
        StepMasterCounter     true
-       Requires              covington,enumitem
+       Requires              covington
        Preamble
-               \newenvironment{subexample}{%
-                       \begin{example}\begin{enumerate}[leftmargin=1.7em]
-                       \renewcommand\theenumi{\alph{enumi}}
-                       \renewcommand\labelenumi{(\theenumi)}
-                       \renewcommand\p@enumi{\theequation\,}}%
-                       {\end{enumerate}\end{example}}
+               % Backwards compatibility with covington < 1.6
+               % This code can be removed eventually
+               \@ifundefined{covsubexamples}{%
+                       \newenvironment{covsubexamples}{%
+                               \addtolength{\examplenumbersep}{-0.5em}%
+                               \begin{covexample}%
+                               \begin{enumerate}
+                               \renewcommand\theenumi{\alph{enumi}}
+                               \renewcommand\labelenumi{(\theenumi)}
+                               \renewcommand\p@enumi{\theequation\,}}%
+                       {\end{enumerate}\end{covexample}}
+               }{}
        EndPreamble
 End