From: Juergen Spitzmueller Date: Wed, 18 Apr 2018 14:20:19 +0000 (+0200) Subject: Add a floating landscape inset X-Git-Tag: lyx-2.4.0dev-acb2ca7b~3613 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=97e1806c4aaf643aeb0c4cb018c703c7d9a1aa44;p=features.git Add a floating landscape inset --- diff --git a/lib/chkconfig.ltx b/lib/chkconfig.ltx index 7dc6812030..95a72ff7df 100644 --- a/lib/chkconfig.ltx +++ b/lib/chkconfig.ltx @@ -271,6 +271,7 @@ \TestPackage{a0poster} \TestPackage{accents} \TestPackage{achicago} +\TestPackage{afterpage} \TestPackage{algorithm} \TestPackage{algorithm2e} \TestPackage{amsmath} diff --git a/lib/doc/LaTeXConfig.lyx b/lib/doc/LaTeXConfig.lyx index 9b95b3b259..6bbbe2b077 100644 --- a/lib/doc/LaTeXConfig.lyx +++ b/lib/doc/LaTeXConfig.lyx @@ -6280,6 +6280,39 @@ literal "false" . \end_layout +\begin_layout Subsection +Landscape module +\end_layout + +\begin_layout Subsubsection +afterpage +\end_layout + +\begin_layout Description +Found: +\begin_inset Info +type "package" +arg "afterpage" +\end_inset + + +\end_layout + +\begin_layout Description +CTAN: +\family typewriter +macros/latex/required/tools/ +\end_layout + +\begin_layout Description +Notes: The package +\family sans +afterpage +\family default + provides a command to shift content after the next page break (used for + gloating landscape). +\end_layout + \begin_layout Subsection Linguistics module \end_layout diff --git a/lib/layouts/landscape.module b/lib/layouts/landscape.module index 15ca77be4c..c6f081ba6e 100644 --- a/lib/layouts/landscape.module +++ b/lib/layouts/landscape.module @@ -21,3 +21,12 @@ InsetLayout Flex:Landscape EndFont Requires lscape End + +InsetLayout Flex:Landscape_(Floating) + CopyStyle Flex:Landscape + LatexType none + LabelString "Landscape (floating)" + LeftDelim \afterpage{\begin{landscape}
+ RightDelim
\end{landscape}} + Requires lscape,afterpage +End diff --git a/lib/lyx2lyx/lyx_2_4.py b/lib/lyx2lyx/lyx_2_4.py index 17821ec80b..c4b023b605 100644 --- a/lib/lyx2lyx/lyx_2_4.py +++ b/lib/lyx2lyx/lyx_2_4.py @@ -170,8 +170,14 @@ def revert_lscape(document): i += 1 continue - document.body[j - 2 : j + 1] = put_cmd_in_ert("\\end{landscape}") - document.body[i : i + 4] = put_cmd_in_ert("\\begin{landscape}") + if document.body[i] == "\\begin_inset Flex Landscape (Floating)": + document.body[j - 2 : j + 1] = put_cmd_in_ert("\\end{landscape}}") + document.body[i : i + 4] = put_cmd_in_ert("\\afterpage{\\begin{landscape}") + add_to_preamble(document, ["\\usepackage{afterpage}"]) + else: + document.body[j - 2 : j + 1] = put_cmd_in_ert("\\end{landscape}") + document.body[i : i + 4] = put_cmd_in_ert("\\begin{landscape}") + add_to_preamble(document, ["\\usepackage{pdflscape}"]) # no need to reset i diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index 0f91e89107..dddfc2e666 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -971,6 +971,7 @@ char const * simplefeatures[] = { "varwidth", "footnote", "tablefootnote", + "afterpage", }; char const * bibliofeatures[] = {