]> git.lyx.org Git - features.git/commitdiff
tex2lyx: support for sideway floats including their starred (wide) counterparts
authorUwe Stöhr <uwestoehr@web.de>
Wed, 26 Oct 2011 03:23:31 +0000 (03:23 +0000)
committerUwe Stöhr <uwestoehr@web.de>
Wed, 26 Oct 2011 03:23:31 +0000 (03:23 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40003 a592a061-630c-0410-9148-cb99ea01b6c8

src/tex2lyx/TODO.txt
src/tex2lyx/preamble.cpp
src/tex2lyx/test/test-structure.tex
src/tex2lyx/text.cpp

index 1204caa4c2f506ec2bd8e9506c3e93ac43f96ee3..39d78665d013fd690b136db7920fd0b5bf82bfeb 100644 (file)
@@ -17,7 +17,6 @@ Format LaTeX feature                        LyX feature
 226    nothing (impossible to import)       InsetBranch, \branch...\end_branch
 226    transformations                      InsetExternal
 228    draft                                InsetExternal
-231    sidewaysfigure/sidewaystable         InsetFloat
 232    bibtopic                             InsetBibTeX
 248    booktabs.sty                         InsetTabular
 254    esint.sty                            \use_esint
@@ -35,8 +34,6 @@ Format LaTeX feature                        LyX feature
 299    hyperlink types                      InsetHyperlink
 309    \nocite                              InsetCitation
 310    \nocite{*}                           InsetBibtex
-312    rotfloat.sty                         InsetFloat
-312    wide sideways{figure,table}          InsetFloat
 316    subfig.sty (subfloats)               InsetFloat
 317    floating placements                  InsetWrap
 322    ?                                    local layout
index 6eb0b273ce3fa395830907cd2b8fd8f0c91d410f..964d062ada03464bc9abb07479e98f73bb6c8e29 100644 (file)
@@ -646,6 +646,9 @@ void handle_package(Parser &p, string const & name, string const & opts,
                ; // Ignore this, the geometry settings are made by the \geometry
                  // command. This command is handled below.
 
+       else if (name == "rotfloat")
+               ; // ignore this
+
        else if (is_known(name, known_languages))
                h_language = name;
 
index b79e7ab53f0288b044c5e69a44cfb8cadc30c43c..d71b5c3cd250ce69d5c8da6e40ac07e627a3dc72 100644 (file)
@@ -74,6 +74,20 @@ An environment
 \caption[s\noun{ho}rt]{this \emph{is} a caption}
 \end{figure}
 
+\begin{sidewaystable*}
+\caption{rotated table, spanning all columns}
+
+\centering{}%
+\begin{tabular}{|c|c|}
+\hline 
+a  & b\tabularnewline
+\hline 
+\hline 
+d  & c\tabularnewline
+\hline 
+\end{tabular}
+\end{sidewaystable*}
+
 A paragraph\footnote{hello} with a footnote and another
 one\footnote{hello
 
index 9870b57c07eed6fe3a931461a4c4b9031a53e4ab..aed44d71d47271e12eeeeec4db7796d685337315 100644 (file)
@@ -1075,6 +1075,36 @@ void parse_environment(Parser & p, ostream & os, bool outer,
                p.skip_spaces();
        }
 
+       else if (unstarred_name == "sidewaystable") {
+               eat_whitespace(p, os, parent_context, false);
+               parent_context.check_layout(os);
+               begin_inset(os, "Float table\n");
+               os << "wide " << convert<string>(is_starred)
+                  << "\nsideways true"
+                  << "\nstatus open\n\n";
+               parse_text_in_inset(p, os, FLAG_END, outer, parent_context);
+               end_inset(os);
+               // We don't need really a new paragraph, but
+               // we must make sure that the next item gets a \begin_layout.
+               parent_context.new_paragraph(os);
+               p.skip_spaces();
+       }
+
+       else if (unstarred_name == "sidewaysfigure") {
+               eat_whitespace(p, os, parent_context, false);
+               parent_context.check_layout(os);
+               begin_inset(os, "Float figure\n");
+               os << "wide " << convert<string>(is_starred)
+                  << "\nsideways true"
+                  << "\nstatus open\n\n";
+               parse_text_in_inset(p, os, FLAG_END, outer, parent_context);
+               end_inset(os);
+               // We don't need really a new paragraph, but
+               // we must make sure that the next item gets a \begin_layout.
+               parent_context.new_paragraph(os);
+               p.skip_spaces();
+       }
+
        else if (name == "minipage") {
                eat_whitespace(p, os, parent_context, false);
                parse_box(p, os, 0, FLAG_END, outer, parent_context, "", "", name);