]> git.lyx.org Git - features.git/commitdiff
backporting tex2lyx: the \rule support
authorUwe Stöhr <uwestoehr@web.de>
Wed, 26 Oct 2011 01:42:56 +0000 (01:42 +0000)
committerUwe Stöhr <uwestoehr@web.de>
Wed, 26 Oct 2011 01:42:56 +0000 (01:42 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@39996 a592a061-630c-0410-9148-cb99ea01b6c8

src/tex2lyx/TODO.txt
src/tex2lyx/text.cpp

index 6d2556d5292ce1d9279f6f5dc3c923d77500b936..2b3abc5c19ec17e101bf5103d04d80ef32ebe93d 100644 (file)
@@ -81,7 +81,6 @@ Format LaTeX feature                        LyX feature
 394    \makebox                             InsetBox use_makebox
 396    nameref.sty                          InsetRef
 399    automatic mathdots loading           \use_mathdots
-400    other rules than \lyxline            InsetLine
 401    feyn.sty                             InsetMathDiagram
 402    \addcontentsline                     InsetBibtex bibtotoc option
 404    refstyle.sty                         InsetRef
index be0f1a9126a3a4cfec5b03e199f6b0bac840ae9f..697e14754fdc332b7cd8c639936c5753c24bf392 100644 (file)
@@ -2472,6 +2472,24 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
                        end_inset(os);
                }
 
+               else if (t.cs() == "rule") {
+                       string offset = "";
+                       string width;
+                       string thickness;
+                       if (p.hasOpt())
+                               offset = p.getArg('[', ']');
+                       width = p.getArg('{', '}');
+                       thickness = p.getArg('{', '}');
+                                       
+                       context.check_layout(os);
+                       begin_command_inset(os, "line", "rule");
+                       if (!offset.empty())
+                               os << "offset \"" << translate_len(offset) << "\"\n";
+                       os << "width \"" << translate_len(width) << "\"\n"
+                                 "height \"" << translate_len(thickness) << "\"\n";
+                       end_inset(os);
+               }
+
                else if (is_known(t.cs(), known_phrases) ||
                         (t.cs() == "protect" &&
                          p.next_token().cat() == catEscape &&