From 750bcd9858aab49946604e275d1bfecb4917c4a2 Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Fri, 30 Apr 2004 11:50:54 +0000 Subject: [PATCH] recognize \lyxdot and fix \def commands with %-newline combinations git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8715 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/tex2lyx/ChangeLog | 7 +++++++ src/tex2lyx/preamble.C | 1 + src/tex2lyx/text.C | 7 +++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/tex2lyx/ChangeLog b/src/tex2lyx/ChangeLog index 2898830900..0ebb27f340 100644 --- a/src/tex2lyx/ChangeLog +++ b/src/tex2lyx/ChangeLog @@ -1,3 +1,10 @@ +2004-04-30 Georg Baum + + * 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 * text.C (parse_text): handle vspaces like '1cm' correctly diff --git a/src/tex2lyx/preamble.C b/src/tex2lyx/preamble.C index cd43c63a84..7d61b0aeea 100644 --- a/src/tex2lyx/preamble.C +++ b/src/tex2lyx/preamble.C @@ -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; diff --git a/src/tex2lyx/text.C b/src/tex2lyx/text.C index 5280682583..e6f4227e80 100644 --- a/src/tex2lyx/text.C +++ b/src/tex2lyx/text.C @@ -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 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 "); -- 2.39.2