]> git.lyx.org Git - features.git/commitdiff
Increase tex2lyx output format to 319.
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Sun, 19 Dec 2010 20:23:55 +0000 (20:23 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Sun, 19 Dec 2010 20:23:55 +0000 (20:23 +0000)
311:     Nothing to do (tex2lyx produced already the new format, because it
         uses the current layout files. This is also a reason why it should
 not lag behind too much with the format.)
312:     Nothing to do (empty lyx2lyx conversion)
313:     Nothing to do (tex2lyx does not know about modules)
314-315: Nothing to do (empty lyx2lyx conversion)
316:     Nothing to do (tex2lyx does not know subfigures)
317-318: Nothing to do (empty lyx2lyx conversion)
319:     Convert horizontal spaces to new format (and convert some newly
         supported spaces)

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

src/tex2lyx/test/box-color-size-space-align.tex
src/tex2lyx/tex2lyx.h
src/tex2lyx/text.cpp

index 17bdf06e04d982e70260f4a2234ac2c8809499d7..c97ccc92f5e2da4d39ea3f0d38e71ddd15436189 100644 (file)
@@ -285,6 +285,12 @@ raggedleft 2 raggedleft 2 raggedleft 2 raggedleft 2 raggedleft 2
 
 Lines can have an hfill \hfill in the middle.
 Lines can have a protected hfill \hspace*{\fill} in the middle.
+Lines can have a dotted fill \dotfill in the middle.
+Lines can have a rule fill \hrulefill in the middle.
+Lines can have a left arrow fill \leftarrowfill in the middle.
+Lines can have a right arrow fill \rightarrowfill in the middle.
+Lines can have a upbrace fill \upbracefill in the middle.
+Lines can have a downbrace fill \downbracefill in the middle.
 Lines can have space \hspace{2cm} in the middle.
 Lines can have protected space \hspace*{2cm} in the middle.
 
@@ -294,8 +300,18 @@ Interword\ a
 
 Thin\,a
 
+Medium\:a
+
+Thick\;a
+
 NegThin\negthinspace{}a
 
+NegMed\negmedspace{}a
+
+NegThick\negthickspace{}a
+
+enspace\enspace{}a
+
 enskip\enskip{}a
 
 quad\quad{}a
index 7af46e40a96939af4a66719b01fa9ed5e2ba7e88..ec88d582fd189bcac107eb755e91d912857f1b7f 100644 (file)
@@ -114,7 +114,7 @@ extern CommandMap known_math_environments;
 ///
 extern bool noweb_mode;
 /// LyX format that is created by tex2lyx
-int const LYX_FORMAT = 310;
+int const LYX_FORMAT = 319;
 
 /// path of the master .tex file
 extern std::string getMasterFilePath();
index 46d4b127fa5bb833640703d61ab6e77a7e1f2d22..637a60919789c49f7974cf8f9fdeb3bc2f1f3836 100644 (file)
@@ -192,12 +192,14 @@ char const * const known_tex_extensions[] = {"tex", 0};
 
 /// spaces known by InsetSpace
 char const * const known_spaces[] = { " ", "space", ",", "thinspace", "quad",
-"qquad", "enspace", "enskip", "negthinspace", 0};
+"qquad", "enspace", "enskip", "negthinspace", "hfill", "dotfill", "hrulefill",
+"leftarrowfill", "rightarrowfill", "upbracefill", "downbracefill", 0};
 
 /// the same as known_spaces with .lyx names
 char const * const known_coded_spaces[] = { "space{}", "space{}",
 "thinspace{}", "thinspace{}", "quad{}", "qquad{}", "enspace{}", "enskip{}",
-"negthinspace{}", 0};
+"negthinspace{}", "hfill{}", "dotfill{}", "hrulefill{}", "leftarrowfill{}",
+"rightarrowfill{}", "upbracefill{}", "downbracefill{}", 0};
 
 
 /// splits "x=z, y=b" into a map and an ordered keyword vector
@@ -710,7 +712,8 @@ void parse_box(Parser & p, ostream & os, unsigned flags, bool outer,
                        p.skip_spaces();
                        // We add a protected space if something real follows
                        if (p.good() && p.next_token().cat() != catComment) {
-                               os << "\\InsetSpace ~\n";
+                               begin_inset(os, "Space ~\n");
+                               end_inset(os);
                        }
                }
 #endif
@@ -1453,8 +1456,10 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
                        if (t.character() == '~') {
                                if (context.layout->free_spacing)
                                        os << ' ';
-                               else
-                                       os << "\\InsetSpace ~\n";
+                               else {
+                                       begin_inset(os, "Space ~\n");
+                                       end_inset(os);
+                               }
                        } else
                                os << t.cs();
                }
@@ -1937,13 +1942,6 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
                                           context);
                }
 
-               else if (t.cs() == "hfill") {
-                       context.check_layout(os);
-                       os << "\n\\hfill\n";
-                       skip_braces(p);
-                       p.skip_spaces();
-               }
-
                else if (t.cs() == "makeindex" || t.cs() == "maketitle") {
                        // FIXME: Somehow prevent title layouts if
                        // "maketitle" was not found
@@ -2677,9 +2675,10 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
                else if (is_known(t.cs(), known_spaces)) {
                        char const * const * where = is_known(t.cs(), known_spaces);
                        context.check_layout(os);
-                       os << "\\InsetSpace ";
+                       begin_inset(os, "Space ");
                        os << '\\' << known_coded_spaces[where - known_spaces]
                           << '\n';
+                       end_inset(os);
                        // LaTeX swallows whitespace after all spaces except
                        // "\\,". We have to do that here, too, because LyX
                        // adds "{}" which would make the spaces significant.