]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathMacroTemplate.cpp
de.po
[lyx.git] / src / mathed / InsetMathMacroTemplate.cpp
index a2fc064c00581cf68fd61cd46fdffbb3d8b79542..2dc2b98b03a536bf14c02969df0f459877876611 100644 (file)
@@ -1217,7 +1217,7 @@ int InsetMathMacroTemplate::write(WriteStream & os, bool overwriteRedefinition)
                        //   \global\def\long\foo#1#2{#1,#2}
                        // We use the \long prefix as this is the equivalent to \newcommand.
                        // We cannot use \newcommand directly because \global does not work with it.
-                       os << "\\global\\long\\def\\" << name();
+                       os << "\n\\global\\long\\def\\" << name();
                        docstring param = from_ascii("#0");
                        for (int i = 1; i <= numargs_; ++i) {
                                param[1] = '0' + i;
@@ -1249,7 +1249,7 @@ int InsetMathMacroTemplate::write(WriteStream & os, bool overwriteRedefinition)
 
        if (os.latex()) {
                // writing .tex. done.
-               os << "\n";
+               os << "%\n";
                ++num_lines;
        } else {
                // writing .lyx, write special .tex export only if necessary
@@ -1292,11 +1292,13 @@ bool InsetMathMacroTemplate::validName() const
                return false;*/
 
        // valid characters?
-       for (size_t i = 0; i < n.size(); ++i) {
-               if (!(n[i] >= 'a' && n[i] <= 'z')
-                   && !(n[i] >= 'A' && n[i] <= 'Z')
-                   && n[i] != '*')
-                       return false;
+       if (n.size() > 1) {
+               for (size_t i = 0; i < n.size(); ++i) {
+                       if (!(n[i] >= 'a' && n[i] <= 'z')
+                           && !(n[i] >= 'A' && n[i] <= 'Z')
+                           && n[i] != '*')
+                               return false;
+               }
        }
 
        return true;