Dear all,

Lyx can load class.layout and class.cls if they are *not* available
systemwide. The logic in bufferparams.cpp is

// look up in the class list
pair<bool, lyx::textclass_type> pp = textclasslist.numberOfClass(classname);
// if found
if (pp.first) {
        textclass = pp.second;
} else {
    // LOAD from current directory
}
// However, the latex class may not be available even if it is found
in class list. (displayed as unavailable)
if (!getTextClass().isTextClassAvailable())

In case that textclass is listed, but unavailable, lyx should look for
a local copy. The attached simple patch does this. Can I apply?

Index: src/BufferParams.cpp
===================================================================
--- src/BufferParams.cpp        (revision 21683)
+++ src/BufferParams.cpp        (working copy)
@@ -458,7 +458,8 @@
                        textclasslist.numberOfClass(classname);
                if (pp.first) {
                        textclass = pp.second;
-               } else {
+               }
+               if (!pp.first || !getTextClass().isTeXClassAvailable()) {
                        // if text class does not exist, try to load it from 
filepath
                        pp = textclasslist.addTextClass(classname, filepath);
                        if (pp.first) {

Reply via email to