From 766eb3f02c69ef3fea1845b53a153bfbe9e5f55a Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Fri, 24 Aug 2018 08:50:32 +0200 Subject: [PATCH] tex2lyx: support rotated longtable --- src/tex2lyx/Context.cpp | 2 +- src/tex2lyx/Context.h | 2 ++ src/tex2lyx/TODO.txt | 1 - src/tex2lyx/table.cpp | 5 ++++- src/tex2lyx/text.cpp | 48 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 55 insertions(+), 3 deletions(-) diff --git a/src/tex2lyx/Context.cpp b/src/tex2lyx/Context.cpp index cc95a1fc6d..5112401b08 100644 --- a/src/tex2lyx/Context.cpp +++ b/src/tex2lyx/Context.cpp @@ -85,7 +85,7 @@ Context::Context(bool need_layout_, new_layout_allowed(true), merging_hyphens_allowed(true), textclass(textclass_), layout(layout_), parent_layout(parent_layout_), - font(font_) + font(font_), rotlongtable(false) { if (!layout) layout = &textclass.defaultLayout(); diff --git a/src/tex2lyx/Context.h b/src/tex2lyx/Context.h index e48bdf35d6..4fd1ff28bb 100644 --- a/src/tex2lyx/Context.h +++ b/src/tex2lyx/Context.h @@ -165,6 +165,8 @@ public: TeXFont font; /// font attributes of normal text static TeXFont normalfont; + /// A rotated longtable + bool rotlongtable; private: void begin_layout(std::ostream & os, Layout const * const & l); diff --git a/src/tex2lyx/TODO.txt b/src/tex2lyx/TODO.txt index b348b29e8e..dc761361a8 100644 --- a/src/tex2lyx/TODO.txt +++ b/src/tex2lyx/TODO.txt @@ -39,7 +39,6 @@ Format LaTeX feature LyX feature 526 Plural and capitalized refstyles InsetRef 546 Landscape support \begin{landscape}...\end{landscape} \begin_inset Flex Landscape (see #11259) - with longtable content: 555 V column type (varwidth package) Automatically detected with newlines, paragraph breaks and environment content in cells of rows 563 InsetArgument listpreamble: All content between \begin{env} and first \item of a list diff --git a/src/tex2lyx/table.cpp b/src/tex2lyx/table.cpp index 2007c1c539..c432a2c35f 100644 --- a/src/tex2lyx/table.cpp +++ b/src/tex2lyx/table.cpp @@ -16,6 +16,7 @@ #include "tex2lyx.h" +#include "Context.h" #include "Preamble.h" #include "support/lassert.h" @@ -1415,7 +1416,9 @@ void handle_tabular(Parser & p, ostream & os, string const & name, //cerr << "// output what we have\n"; // output what we have - string const rotate = "0"; + string rotate = "0"; + if (is_long_tabular && context.rotlongtable) + rotate = "90"; os << "\n\n"; os << "