]> git.lyx.org Git - features.git/commitdiff
tex2lyx: support for the LaTeX command \rule
authorUwe Stöhr <uwestoehr@web.de>
Mon, 24 Oct 2011 21:07:00 +0000 (21:07 +0000)
committerUwe Stöhr <uwestoehr@web.de>
Mon, 24 Oct 2011 21:07:00 +0000 (21:07 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39957 a592a061-630c-0410-9148-cb99ea01b6c8

src/tex2lyx/TODO.txt
src/tex2lyx/test/test-insets.tex
src/tex2lyx/text.cpp

index be58261958e88a601ba06e6221710c0e049c826f..ee6172e891364e4649a9f0e210569de14719de39 100644 (file)
@@ -79,7 +79,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 a6a5cdfe3af72cdcb60e8df82f4ab5b91f394945..82299ac717d78a5e738821984820c5d4919b9f9e 100644 (file)
@@ -273,6 +273,7 @@ Now use them all:
 The following tow don't work, but they should???
 %\macros{x} \macrot{x}
 
+
 \section{Special formattings\index{Special formattings}}
 
 \subsection{LyX line}
@@ -289,8 +290,20 @@ test
 
 {\Huge \lyxline{\Huge}}{\Huge \par}
 
+
+\subsection{rules}
+
+test\rule[0.001\textwidth]{1\columnwidth}{0.05\textheight}
+
 test
 
+\rule[0.5ex]{1\columnwidth}{1pt}
+
+\noindent \rule{1ex}{0.5cc}test
+
+\textcolor{red}{\rule[-4ex]{5in}{1cm}}
+
+
 \subsection{Line breaks}
 
 They can also or be broken by a newline\\
index d59081a10be25615b91cf0fc0a0024feaee0d650..758ddc120b8c900c8a2a60d215e1e7a9853d2a17 100644 (file)
@@ -2470,6 +2470,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 &&