]> git.lyx.org Git - lyx.git/commitdiff
Fix problem of unwanted spaces caused by macro definitions
authorJuergen Spitzmueller <spitz@lyx.org>
Sun, 29 Jul 2018 13:16:44 +0000 (15:16 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Tue, 31 Jul 2018 06:49:50 +0000 (08:49 +0200)
Patch by Gilbert J. M. Forkel

Fixes: #11216
(cherry picked from commit 372712cfd99269cfcaf57ebb86048c1457e38075)

src/mathed/InsetMathMacroTemplate.cpp
status.23x

index a2fc064c00581cf68fd61cd46fdffbb3d8b79542..8435d4819bc7654fb84a70f1033631587e669b99 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
index f3c13c5a2108f8584dcf58953e6710557721012e..8facaa766f45268f6702e1482e1d6ed590b761cb 100644 (file)
@@ -164,6 +164,8 @@ What's new
 
 - Correctly strike-out deleted math immediately following a float (bug 11174).
 
+- Fix problem with unwanted spaces caused by math macro definitions (bug 11216).
+
 
 * LYX2LYX