commit 97e1806c4aaf643aeb0c4cb018c703c7d9a1aa44
Author: Juergen Spitzmueller <[email protected]>
Date: Wed Apr 18 16:20:19 2018 +0200
Add a floating landscape inset
---
lib/chkconfig.ltx | 1 +
lib/doc/LaTeXConfig.lyx | 33 +++++++++++++++++++++++++++++++++
lib/layouts/landscape.module | 9 +++++++++
lib/lyx2lyx/lyx_2_4.py | 10 ++++++++--
src/LaTeXFeatures.cpp | 1 +
5 files changed, 52 insertions(+), 2 deletions(-)
diff --git a/lib/chkconfig.ltx b/lib/chkconfig.ltx
index 7dc6812..95a72ff 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 9b95b3b..6bbbe2b 100644
--- a/lib/doc/LaTeXConfig.lyx
+++ b/lib/doc/LaTeXConfig.lyx
@@ -6281,6 +6281,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 15ca77b..c6f081b 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}<br/>
+ RightDelim <br/>\end{landscape}}
+ Requires lscape,afterpage
+End
diff --git a/lib/lyx2lyx/lyx_2_4.py b/lib/lyx2lyx/lyx_2_4.py
index 17821ec..c4b023b 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 0f91e89..dddfc2e 100644
--- a/src/LaTeXFeatures.cpp
+++ b/src/LaTeXFeatures.cpp
@@ -971,6 +971,7 @@ char const * simplefeatures[] = {
"varwidth",
"footnote",
"tablefootnote",
+ "afterpage",
};
char const * bibliofeatures[] = {