]> git.lyx.org Git - lyx.git/commitdiff
Adapt forest (linguistic structure tree) to new syntax of the package
authorJuergen Spitzmueller <spitz@lyx.org>
Sun, 21 Feb 2016 10:54:25 +0000 (11:54 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Sun, 21 Feb 2016 10:54:25 +0000 (11:54 +0100)
while maintaining backwards compatibility (#9967).

lib/examples/de/linguistics.lyx
lib/examples/es/linguistics.lyx
lib/examples/fr/linguistics.lyx
lib/examples/linguistics.lyx
lib/layouts/linguistics.module

index c655294f463af708bf77e2070958e5ef8d0fd727..eeb5b4e744717fb8d7b325bcbe6482f4f799cd9a 100644 (file)
@@ -9,6 +9,28 @@
 %% Kommentieren Sie das Folgende aus, um Tableaux-Überschriften zu erzeugen:
 %\floatstyle{plaintop}
 %\restylefloat{tableau}
+
+% Rückwärtskompatibilität zu forest 1.x
+% Wenn Sie forest 2.0.1 oder neuer verwenden,
+% können Sie das Folgende löschen.
+\@ifpackageloaded{forest}{%
+  \@ifpackagelater{forest}{2016/02/20}{}{%
+    \forestset{
+      roof/.style={edge path={\noexpand\path[\forestoption{edge}]%
+          (.north west)--(!u.south)--(.north east)--cycle
+          \forestoption{edge label};
+        }
+      },
+      sn edges/.style={
+        for tree={parent anchor=south, child anchor=north},
+      },
+      linguistics preamble/.style={sn edges, baseline, for tree={align=center}}
+    }
+    \preto\forest@do{%
+      \forestOpreto{\forest@root}{given options}{linguistics preamble,}%
+    }
+  }
+}{}
 \end_preamble
 \use_default_options false
 \begin_modules
@@ -1737,8 +1759,64 @@ roofs
 \begin_inset Quotes gld
 \end_inset
 
+roof
+\begin_inset Quotes grd
+\end_inset
+
+
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+\noindent
+Bitte beachten Sie, dass die Option 
+\begin_inset Quotes gld
+\end_inset
+
+roof
+\begin_inset Quotes grd
+\end_inset
+
+ erst ab Version 2.0 des Pakets 
+\family sans
+forest
+\family default
+ verfügbar ist.
+ Für frühere Versionen haben wir in den Vorspann dieses Dokuments Code eingefügt
+, die die Verwendung dennoch gestattet.
+ Wenn Ihre Version des Pakets 
+\family sans
+forest
+\family default
+ kleiner ist als 2.0 und Sie 
+\begin_inset Quotes gld
+\end_inset
+
+roof
+\begin_inset Quotes grd
+\end_inset
+
+ verwenden wollen, müssen Sie diesen Code in den Vorspann Ihres Dokuments
+ kopieren.
+ Statt dessen können Sie auch die alte Option 
+\begin_inset Quotes gld
+\end_inset
+
 triangle
 \begin_inset Quotes grd
+\end_inset
+
+ (statt 
+\begin_inset Quotes gld
+\end_inset
+
+roof
+\begin_inset Quotes grd
+\end_inset
+
+) verwenden.
+\end_layout
+
 \end_inset
 
  erzeugt werden (beachten Sie, dass Kommata eine spezielle Bedeutung haben;
@@ -1750,7 +1828,7 @@ triangle
 status open
 
 \begin_layout Plain Layout
-[VP [DP[Hans]] [V' [V[schickt]] [DP[Maria]] [DP[einen weiteren Brief, triangle]]
+[VP [DP[Hans]] [V' [V[schickt]] [DP[Maria]] [DP[einen weiteren Brief, roof]]
  ] ]
 \end_layout
 
index 674b0f738aaebb9097b97d3bf9b04aa188708abd..03b9f36184f0172aad5337adef9d3c56572db6fa 100644 (file)
 
 %% Uncomment the following to translate the float caption label
 %\floatname{tableau}{Cuadro}
+
+% Backwards compatibility for forest 1.x
+% If you use forest 2.0.1 or later, you can delete this
+\@ifpackageloaded{forest}{%
+  \@ifpackagelater{forest}{2016/02/20}{}{%
+    \forestset{
+      roof/.style={edge path={\noexpand\path[\forestoption{edge}]%
+          (.north west)--(!u.south)--(.north east)--cycle
+          \forestoption{edge label};
+        }
+      },
+      sn edges/.style={
+        for tree={parent anchor=south, child anchor=north},
+      },
+      linguistics preamble/.style={sn edges, baseline, for tree={align=center}}
+    }
+    \preto\forest@do{%
+      \forestOpreto{\forest@root}{given options}{linguistics preamble,}%
+    }
+  }
+}{}
 \end_preamble
 \use_default_options false
 \begin_modules
@@ -1773,8 +1794,57 @@ Las cubiertas se pueden generar fácilmente con la opción
 \begin_inset Quotes fld
 \end_inset
 
-triangle
+roof
 \begin_inset Quotes frd
+\end_inset
+
+
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+\noindent
+
+\lang english
+Note that the 
+\begin_inset Quotes eld
+\end_inset
+
+roof
+\begin_inset Quotes erd
+\end_inset
+
+ option only exists as of 
+\family sans
+forest
+\family default
+ version 2.0.
+ We have added some code to the preamble of this manual to support previous
+ versions.
+ If you use a 
+\family sans
+forest
+\family default
+ version < 2.0, you either need to copy this code to your preamble or use
+ the old option 
+\begin_inset Quotes eld
+\end_inset
+
+triangle
+\begin_inset Quotes erd
+\end_inset
+
+ instead of 
+\begin_inset Quotes eld
+\end_inset
+
+roof
+\begin_inset Quotes erd
+\end_inset
+
+.
+\end_layout
+
 \end_inset
 
  (atención al significado de la coma, pues marca opciones):
@@ -1782,11 +1852,10 @@ triangle
 
 \begin_layout Standard
 \begin_inset Flex Structure Tree
-status collapsed
+status open
 
 \begin_layout Plain Layout
-[VP [DP[John]] [V' [V[sent]] [DP[Mary]] [DP[another letter, triangle]] ]
- ]
+[VP [DP[John]] [V' [V[sent]] [DP[Mary]] [DP[another letter, roof]] ] ]
 \end_layout
 
 \end_inset
index 4cde60d5cb2a3b87fd752c3773baddc278e7f8eb..311c04c0ce82509e85686a4dcf7781f3e39eddc5 100644 (file)
@@ -9,6 +9,27 @@
 %% Uncomment the following for Tableaux captions on top:
 %\floatstyle{plaintop}
 %\restylefloat{tableau}
+
+% Backwards compatibility for forest 1.x
+% If you use forest 2.0.1 or later, you can delete this
+\@ifpackageloaded{forest}{%
+  \@ifpackagelater{forest}{2016/02/20}{}{%
+    \forestset{
+      roof/.style={edge path={\noexpand\path[\forestoption{edge}]%
+          (.north west)--(!u.south)--(.north east)--cycle
+          \forestoption{edge label};
+        }
+      },
+      sn edges/.style={
+        for tree={parent anchor=south, child anchor=north},
+      },
+      linguistics preamble/.style={sn edges, baseline, for tree={align=center}}
+    }
+    \preto\forest@do{%
+      \forestOpreto{\forest@root}{given options}{linguistics preamble,}%
+    }
+  }
+}{}
 \end_preamble
 \use_default_options false
 \begin_modules
@@ -1733,8 +1754,57 @@ Les toits peuvent être facilement engendrés via l'option
 \begin_inset Quotes fld
 \end_inset
 
-triangle
+roof
 \begin_inset Quotes frd
+\end_inset
+
+
+\begin_inset Foot
+status open
+
+\begin_layout Plain Layout
+\noindent
+
+\lang english
+Note that the 
+\begin_inset Quotes eld
+\end_inset
+
+roof
+\begin_inset Quotes erd
+\end_inset
+
+ option only exists as of 
+\family sans
+forest
+\family default
+ version 2.0.
+ We have added some code to the preamble of this manual to support previous
+ versions.
+ If you use a 
+\family sans
+forest
+\family default
+ version < 2.0, you either need to copy this code to your preamble or use
+ the old option 
+\begin_inset Quotes eld
+\end_inset
+
+triangle
+\begin_inset Quotes erd
+\end_inset
+
+ instead of 
+\begin_inset Quotes eld
+\end_inset
+
+roof
+\begin_inset Quotes erd
+\end_inset
+
+.
+\end_layout
+
 \end_inset
 
  (notez que la virgule a une signification spéciale, puisqu’elle marque
@@ -1746,8 +1816,7 @@ triangle
 status open
 
 \begin_layout Plain Layout
-[VP [DP[John]] [V' [V[sent]] [DP[Mary]] [DP[another letter, triangle]] ]
- ]
+[VP [DP[John]] [V' [V[sent]] [DP[Mary]] [DP[another letter, roof]] ] ]
 \end_layout
 
 \end_inset
index 596f39143fdacc4a650437686a63adc537c41843..114cbcb7667ed08bb5088eeb662a27947981b44f 100644 (file)
@@ -9,6 +9,27 @@
 %% Uncomment the following for Tableaux captions on top:
 %\floatstyle{plaintop}
 %\restylefloat{tableau}
+
+% Backwards compatibility for forest 1.x
+% If you use forest 2.0.1 or later, you can delete this
+\@ifpackageloaded{forest}{%
+  \@ifpackagelater{forest}{2016/02/20}{}{%
+    \forestset{
+      roof/.style={edge path={\noexpand\path[\forestoption{edge}]%
+          (.north west)--(!u.south)--(.north east)--cycle
+          \forestoption{edge label};
+        }
+      },
+      sn edges/.style={
+        for tree={parent anchor=south, child anchor=north},
+      },
+      linguistics preamble/.style={sn edges, baseline, for tree={align=center}}
+    }
+    \preto\forest@do{%
+      \forestOpreto{\forest@root}{given options}{linguistics preamble,}%
+    }
+  }
+}{}
 \end_preamble
 \use_default_options false
 \begin_modules
@@ -1639,7 +1660,7 @@ If you view the PDF output, you will see that the input
 \begin_layout Standard
 expands to a real structure tree.
  To view the result within the \SpecialChar LyX
- workarea, you can simply embed the Structure
+ work area, you can simply embed the Structure
  Tree inset into a Preview inset (
 \family sans
 Insert\SpecialChar menuseparator
@@ -1677,11 +1698,58 @@ Roofs can be easily generated by means of the
 \begin_inset Quotes eld
 \end_inset
 
+roof
+\begin_inset Quotes erd
+\end_inset
+
+ option
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+\noindent
+Note that the 
+\begin_inset Quotes eld
+\end_inset
+
+roof
+\begin_inset Quotes erd
+\end_inset
+
+ option only exists as of 
+\family sans
+forest
+\family default
+ version 2.0.
+ We have added some code to the preamble of this manual to support previous
+ versions.
+ If you use a 
+\family sans
+forest
+\family default
+ version < 2.0, you either need to copy this code to your preamble or use
+ the old option 
+\begin_inset Quotes eld
+\end_inset
+
 triangle
 \begin_inset Quotes erd
 \end_inset
 
- option (note that the comma has special meaning, as it marks options):
+ instead of 
+\begin_inset Quotes eld
+\end_inset
+
+roof
+\begin_inset Quotes erd
+\end_inset
+
+.
+\end_layout
+
+\end_inset
+
+ (note that the comma has special meaning, as it marks options):
 \end_layout
 
 \begin_layout Standard
@@ -1689,8 +1757,7 @@ triangle
 status open
 
 \begin_layout Plain Layout
-[VP [DP[John]] [V' [V[sent]] [DP[Mary]] [DP[another letter, triangle]] ]
- ]
+[VP [DP[John]] [V' [V[sent]] [DP[Mary]] [DP[another letter, roof]] ] ]
 \end_layout
 
 \end_inset
index d93885abc875cc6e6ea54333d7fca1150b7cd796..c911a5942365e84ffea0631b8c995da7d4dde6c5 100644 (file)
@@ -151,6 +151,12 @@ InsetLayout Flex:Structure_Tree
        Requires              forest
        ResetsFont            true
        PassThruChars         []
+       Preamble
+       % Load forest linguistics library, if available
+       \@ifpackagelater{forest}{2016/02/20}{%
+       \useforestlibrary*{linguistics}
+       }{}
+       EndPreamble
 End
 
 
@@ -167,7 +173,7 @@ InsetLayout Flex:Expression
                \newcommand{\lingexpr}[1]{\emph{#1}}
        EndPreamble
        InToc                 true
-       ResetsFont true
+       ResetsFont            true
 End
 
 
@@ -183,7 +189,7 @@ InsetLayout Flex:Concepts
                \newcommand{\lingconcept}[1]{\textsc{#1}}
        EndPreamble
        InToc                 true
-       ResetsFont true
+       ResetsFont            true
 End
 
 
@@ -197,7 +203,7 @@ InsetLayout Flex:Meaning
                \newcommand{\lingmeaning}[1]{\enquote*{#1}}
        EndPreamble
        InToc                 true
-       ResetsFont true
+       ResetsFont            true
 End