From 6da25359f0799fddfdf0aaf6e88000a9d2e41cea Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Mon, 27 Dec 2010 18:03:26 +0000 Subject: [PATCH] Increase tex2lyx output format to 330. 324: Create newline inset in new syntax 325: Nothing to do (tex2lyx does not support the japanese language) 326-327: Nothing to do (empty lyx2lyx conversion) 328: Nothing to do (tex2lyx did never support embedding of files) 329-330: Nothing to do (empty lyx2lyx conversion) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37011 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/tex2lyx/tex2lyx.h | 2 +- src/tex2lyx/text.cpp | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/tex2lyx/tex2lyx.h b/src/tex2lyx/tex2lyx.h index c547cf328c..b0ee0f720a 100644 --- a/src/tex2lyx/tex2lyx.h +++ b/src/tex2lyx/tex2lyx.h @@ -114,7 +114,7 @@ extern CommandMap known_math_environments; /// extern bool noweb_mode; /// LyX format that is created by tex2lyx -int const LYX_FORMAT = 323; +int const LYX_FORMAT = 330; /// path of the master .tex file extern std::string getMasterFilePath(); diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index 5b3f825a91..392b24a9f2 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -1168,8 +1168,12 @@ void parse_noweb(Parser & p, ostream & os, Context & context) // at all. if (t.cat() == catEscape) os << subst(t.asInput(), "\\", "\n\\backslash\n"); - else - os << subst(t.asInput(), "\n", "\n\\newline\n"); + else { + ostringstream oss; + begin_inset(oss, "Newline newline"); + end_inset(oss); + os << subst(t.asInput(), "\n", oss.str()); + } // The scrap chunk is ended by an @ at the beginning of a line. // After the @ the line may contain a comment and/or // whitespace, but nothing else. @@ -2556,14 +2560,17 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, handle_ert(os, "\\\\*" + p.getOpt(), context); } else { - os << "\n\\newline\n"; + begin_inset(os, "Newline newline"); + end_inset(os); } } else if (t.cs() == "newline" || t.cs() == "linebreak") { context.check_layout(os); - os << "\n\\" << t.cs() << "\n"; + begin_inset(os, "Newline "); + os << t.cs(); + end_inset(os); skip_spaces_braces(p); } -- 2.39.2