]> git.lyx.org Git - lyx.git/commitdiff
*** empty log message ***
authorAndré Pönitz <poenitz@gmx.net>
Wed, 12 Feb 2003 13:33:30 +0000 (13:33 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Wed, 12 Feb 2003 13:33:30 +0000 (13:33 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6122 a592a061-630c-0410-9148-cb99ea01b6c8

src/tex2lyx/tex2lyx.C

index 2e9cc232bc47d1d77cd4a130dbeafa5868b650e4..04a73f9f3d0bda788a4d38f8991a44dc3595419f 100644 (file)
@@ -187,6 +187,7 @@ bool is_heading(string const & name)
 bool is_latex_command(string const & name)
 {
        return
+               name == "cite" ||
                name == "label" ||
                name == "index" ||
                name == "printindex";
@@ -205,6 +206,12 @@ void end_inset(ostream & os)
 }
 
 
+string curr_env()
+{
+       return active_environments.empty() ? string() : active_environments.top();
+}
+
+
 void handle_ert(ostream & os, string const & s)
 {
        begin_inset(os, "ERT");
@@ -224,7 +231,7 @@ void handle_par(ostream & os)
        if (active_environments.empty())
                return;
        os << "\n\\layout ";
-       string s = active_environments.top();
+       string s = curr_env();
        if (s == "document") {
                os << "Standard\n\n";
                return;
@@ -426,8 +433,12 @@ void parse(Parser & p, ostream & os, unsigned flags, mode_type mode)
                        os << wrap("macroarg", string(1, n.character()));
                }
 
-               else if (t.cat() == catActive)
-                       os << wrap("active", string(1, t.character()));
+               else if (t.cat() == catActive) {
+                       if (t.character() == '~')
+                               os << (curr_env() == "lyxcode" ? ' ' : '~');
+                       else
+                               os << t.asInput();
+               }
 
                else if (t.cat() == catBegin) {
                        os << '{';
@@ -553,9 +564,9 @@ void parse(Parser & p, ostream & os, unsigned flags, mode_type mode)
                        if (flags & FLAG_END) {
                                // eat environment name
                                string const name = p.getArg('{', '}');
-                               if (name != active_environments.top())
+                               if (name != curr_env())
                                        p.error("\\end{" + name + "} does not match \\begin{"
-                                               + active_environments.top() + "}");
+                                               + curr_env() + "}");
                                active_environments.pop();
                                if (name == "document" || name == "abstract")
                                        ;