]> git.lyx.org Git - lyx.git/blobdiff - src/BufferParams.cpp
Get InsetCollapsable working, at least to some extent.
[lyx.git] / src / BufferParams.cpp
index 9aae6e7d2b4b6c3e2d3dfc523257d83462dba496..2dd4817e3e541fae1db1aedee68ac0a8683c1ab3 100644 (file)
@@ -1445,7 +1445,7 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
                lyxpreamble += oss.str();
        }
        
-       // Will be surrounded by \makeatletter and \makeatother when needed
+       // Will be surrounded by \makeatletter and \makeatother when not empty
        docstring atlyxpreamble;
 
        // Some macros LyX will need
@@ -1464,7 +1464,7 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
                        + tmppreamble + '\n';
 
        /* the user-defined preamble */
-       if (!preamble.empty())
+       if (!containsOnly(preamble, " \n\t"))
                // FIXME UNICODE
                atlyxpreamble += "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% "
                        "User specified LaTeX commands.\n"
@@ -1521,11 +1521,9 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
        if (!bullets_def.empty())
                atlyxpreamble += bullets_def + "}\n\n";
 
-       if (atlyxpreamble.find(from_ascii("@")) != docstring::npos)
+       if (!atlyxpreamble.empty())
                lyxpreamble += "\n\\makeatletter\n"
                        + atlyxpreamble + "\\makeatother\n\n";
-       else
-               lyxpreamble += '\n' + atlyxpreamble;
 
        // We try to load babel late, in case it interferes with other packages.
        // Jurabib and Hyperref have to be called after babel, though.