]> git.lyx.org Git - features.git/commitdiff
Increase tex2lyx output format to 401.
authorGeorg Baum <georg.baum@post.rwth-aachen.de>
Sat, 22 Oct 2011 16:58:32 +0000 (16:58 +0000)
committerGeorg Baum <georg.baum@post.rwth-aachen.de>
Sat, 22 Oct 2011 16:58:32 +0000 (16:58 +0000)
400: Convert \lyxline to new InsetLine syntax
401: Nothing to do (empty lyx2lyx conversion)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39919 a592a061-630c-0410-9148-cb99ea01b6c8

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

index eac7c41b59375e7de4bb9f68602073fc9810ff03..8cb0e6929bc37afecc31992c2edeb572aa5413f2 100644 (file)
@@ -93,4 +93,6 @@ Format LaTeX feature                        LyX feature
 395    page sizes C0-6                      \papersize
 396    nameref.sty                          InsetRef
 399    automatic mathdots loading           \use_mathdots
+400    other rules than \lyxline            InsetLine
+401    feyn.sty                             InsetMathDiagram
 
index 6af9b64c9ec1232789d319e197d2f8cba784dbc3..cbdbb5de6ea146a6b945c84ca221594df16934d9 100644 (file)
@@ -49,6 +49,7 @@ const char * const modules_placeholder = "\001modules\001";
 // needed to handle encodings with babel
 bool one_language = true;
 string h_inputencoding = "auto";
+string h_paragraph_separation    = "indent";
 
 namespace {
 
@@ -207,7 +208,6 @@ string h_paperorientation        = "portrait";
 string h_notefontcolor;
 string h_secnumdepth             = "3";
 string h_tocdepth                = "3";
-string h_paragraph_separation    = "indent";
 string h_defskip                 = "medskip";
 string h_paragraph_indentation   = "default";
 string h_quotes_language         = "english";
index d2b84cb14b01dfc62dd1b10072e5999aa8967718..546c9211a8af3bf9b990730a2de5b425cf346c7a 100644 (file)
@@ -53,6 +53,7 @@ extern std::string babel2lyx(std::string const & language);
 extern std::map<std::string, std::vector<std::string> > used_packages;
 extern const char * const modules_placeholder;
 extern std::string h_inputencoding;
+extern std::string h_paragraph_separation;
 
 /// in text.cpp
 std::string translate_len(std::string const &);
@@ -165,7 +166,7 @@ extern bool noweb_mode;
 /// Did we recognize any pdflatex-only construct?
 extern bool pdflatex;
 /// LyX format that is created by tex2lyx
-int const LYX_FORMAT = 399;
+int const LYX_FORMAT = 401;
 
 /// path of the master .tex file
 extern std::string getMasterFilePath();
index 85df00324a620f82ef5ce2409e862ece700479ad..930b318c53e8e7e2360c98079c49f7c882c74c50 100644 (file)
@@ -2427,8 +2427,30 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
                }
 
                else if (t.cs() == "lyxline") {
+                       // swallow size argument (it is not used anyway)
+                       p.getArg('{', '}');
+                       if (!context.atParagraphStart()) {
+                               // so our line is in the middle of a paragraph
+                               // we need to add a new line, lest this line
+                               // follow the other content on that line and
+                               // run off the side of the page
+                               // FIXME: This may create an empty paragraph,
+                               //        but without that it would not be
+                               //        possible to set noindent below.
+                               //        Fortunately LaTeX does not care
+                               //        about the empty paragraph.
+                               context.new_paragraph(os);
+                       }
+                       if (h_paragraph_separation == "indent") {
+                               // we need to unindent, lest the line be too long
+                               context.add_par_extra_stuff("\\noindent\n");
+                       }
                        context.check_layout(os);
-                       os << "\\lyxline";
+                       begin_command_inset(os, "line", "rule");
+                       os << "offset \"0.5ex\"\n"
+                             "width \"100line%\"\n"
+                             "height \"1pt\"\n";
+                       end_inset(os);
                }
 
                else if (is_known(t.cs(), known_phrases) ||