]> git.lyx.org Git - features.git/commitdiff
recognize \lyxdot and fix \def commands with %-newline combinations
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Fri, 30 Apr 2004 11:50:54 +0000 (11:50 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Fri, 30 Apr 2004 11:50:54 +0000 (11:50 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8715 a592a061-630c-0410-9148-cb99ea01b6c8

src/tex2lyx/ChangeLog
src/tex2lyx/preamble.C
src/tex2lyx/text.C

index 2898830900cfc7dcf3eb06bd61d2dc69391102e9..0ebb27f340f1a4e7966c8b064967295aa79e3b8d 100644 (file)
@@ -1,3 +1,10 @@
+2004-04-30  Georg Baum  <Georg.Baum@post.rwth-aachen.de>
+
+       * preamble.C: recognize \lyxdot
+       * text.C (parse_text): translate \lyxdot in graphics file names
+       * text.C (handle_ert): translate '\n' (fixes %-newline combinations
+       in \def commands)
+
 2004-03-26  Georg Baum  <Georg.Baum@post.rwth-aachen.de>
 
        * text.C (parse_text): handle vspaces like '1cm' correctly
index cd43c63a8417afbc6c3612dd3ddf666abcc2369c..7d61b0aeeae5d06f670b7a8d6a6dd3e541dc2c67 100644 (file)
@@ -253,6 +253,7 @@ LyXTextClass const parse_preamble(Parser & p, ostream & os, string const & force
                            && name != "\\lyxline"
                            && name != "\\lyxaddress"
                            && name != "\\lyxrightaddress"
+                           && name != "\\lyxdot"
                            && name != "\\boldsymbol"
                            && name != "\\lyxarrow") {
                                ostringstream ss;
index 5280682583f0a85b966a93f9860affc13c889576..e6f4227e800bb4f0e586c2d944c4200b9e0c156f 100644 (file)
@@ -29,6 +29,7 @@
 using lyx::support::rtrim;
 using lyx::support::suffixIs;
 using lyx::support::contains;
+using lyx::support::subst;
 
 using std::cerr;
 using std::endl;
@@ -119,7 +120,7 @@ bool splitLatexLength(string const & len, string & value, string & unit)
                return false;
        const string::size_type i = len.find_first_not_of(" -+0123456789.,");
        //'4,5' is a valid LaTeX length number. Change it to '4.5'
-       string const length = lyx::support::subst(len, ',', '.');
+       string const length = subst(len, ',', '.');
        if (i == string::npos)
                return false;
        if (i == 0) {
@@ -258,6 +259,8 @@ void handle_ert(ostream & os, string const & s, Context & context, bool check_la
        for (string::const_iterator it = s.begin(), et = s.end(); it != et; ++it) {
                if (*it == '\\')
                        os << "\n\\backslash \n";
+               else if (*it == '\n')
+                       os << "\n\\newline \n";
                else
                        os << *it;
        }
@@ -914,7 +917,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
 
                else if (t.cs() == "includegraphics") {
                        map<string, string> opts = split_map(p.getArg('[', ']'));
-                       string name = p.verbatim_item();
+                       string name = subst(p.verbatim_item(), "\\lyxdot ", ".");
 
                        context.check_layout(os);
                        begin_inset(os, "Graphics ");