From: Juergen Spitzmueller Date: Sun, 21 Feb 2016 10:54:25 +0000 (+0100) Subject: Adapt forest (linguistic structure tree) to new syntax of the package X-Git-Tag: 2.2.0rc1~128 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;ds=sidebyside;h=f60a152a29e1dfe05cbc9038677cf846279d7b06;p=lyx.git Adapt forest (linguistic structure tree) to new syntax of the package while maintaining backwards compatibility (#9967). --- diff --git a/lib/examples/de/linguistics.lyx b/lib/examples/de/linguistics.lyx index c655294f46..eeb5b4e744 100644 --- a/lib/examples/de/linguistics.lyx +++ b/lib/examples/de/linguistics.lyx @@ -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 diff --git a/lib/examples/es/linguistics.lyx b/lib/examples/es/linguistics.lyx index 674b0f738a..03b9f36184 100644 --- a/lib/examples/es/linguistics.lyx +++ b/lib/examples/es/linguistics.lyx @@ -12,6 +12,27 @@ %% 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 diff --git a/lib/examples/fr/linguistics.lyx b/lib/examples/fr/linguistics.lyx index 4cde60d5cb..311c04c0ce 100644 --- a/lib/examples/fr/linguistics.lyx +++ b/lib/examples/fr/linguistics.lyx @@ -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 diff --git a/lib/examples/linguistics.lyx b/lib/examples/linguistics.lyx index 596f39143f..114cbcb766 100644 --- a/lib/examples/linguistics.lyx +++ b/lib/examples/linguistics.lyx @@ -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 diff --git a/lib/layouts/linguistics.module b/lib/layouts/linguistics.module index d93885abc8..c911a59423 100644 --- a/lib/layouts/linguistics.module +++ b/lib/layouts/linguistics.module @@ -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