// You should also run the development/tools/updatelayouts.py script,
// to update the format of all of our layout files.
//
-int const LAYOUT_FORMAT = 105; // spitz: ParskipHalf and ParskipFull class options
+int const LAYOUT_FORMAT = 106; // spitz: CiteEngineType notes
// Layout format for the current lyx file format. Controls which format is
int const type = readCiteEngineType(lexrc);
bool authoryear = (type & ENGINE_TYPE_AUTHORYEAR);
bool numerical = (type & ENGINE_TYPE_NUMERICAL);
+ bool notes = (type & ENGINE_TYPE_NOTES);
bool defce = (type & ENGINE_TYPE_DEFAULT);
if (rt == CITE_ENGINE) {
authoryear = getCiteStyles(ENGINE_TYPE_AUTHORYEAR).empty();
if (numerical)
numerical = getCiteStyles(ENGINE_TYPE_NUMERICAL).empty();
+ if (notes)
+ numerical = getCiteStyles(ENGINE_TYPE_NOTES).empty();
if (defce)
defce = getCiteStyles(ENGINE_TYPE_DEFAULT).empty();
}
cite_styles_[ENGINE_TYPE_AUTHORYEAR].clear();
if (numerical)
cite_styles_[ENGINE_TYPE_NUMERICAL].clear();
+ if (notes)
+ cite_styles_[ENGINE_TYPE_NOTES].clear();
if (defce)
cite_styles_[ENGINE_TYPE_DEFAULT].clear();
}
class_cite_styles_[ENGINE_TYPE_AUTHORYEAR].push_back(cs);
if (numerical)
class_cite_styles_[ENGINE_TYPE_NUMERICAL].push_back(cs);
+ if (notes)
+ class_cite_styles_[ENGINE_TYPE_NOTES].push_back(cs);
if (defce)
class_cite_styles_[ENGINE_TYPE_DEFAULT].push_back(cs);
} else {
cite_styles_[ENGINE_TYPE_AUTHORYEAR].push_back(cs);
if (numerical)
cite_styles_[ENGINE_TYPE_NUMERICAL].push_back(cs);
+ if (notes)
+ cite_styles_[ENGINE_TYPE_NOTES].push_back(cs);
if (defce)
cite_styles_[ENGINE_TYPE_DEFAULT].push_back(cs);
}
// except if we have already a style to add something to
bool apply_ay = !add;
bool apply_num = !add;
+ bool apply_notes = !add;
bool apply_def = !add;
if (add) {
if (type & ENGINE_TYPE_AUTHORYEAR)
apply_ay = !getCiteStyles(ENGINE_TYPE_AUTHORYEAR).empty();
if (type & ENGINE_TYPE_NUMERICAL)
apply_num = !getCiteStyles(ENGINE_TYPE_NUMERICAL).empty();
+ if (type & ENGINE_TYPE_NOTES)
+ apply_num = !getCiteStyles(ENGINE_TYPE_NOTES).empty();
if (type & ENGINE_TYPE_DEFAULT)
apply_def = !getCiteStyles(ENGINE_TYPE_DEFAULT).empty();
}
cite_styles_[ENGINE_TYPE_AUTHORYEAR].push_back(ciss);
else if (cis.first == ENGINE_TYPE_NUMERICAL && apply_num)
cite_styles_[ENGINE_TYPE_NUMERICAL].push_back(ciss);
+ else if (cis.first == ENGINE_TYPE_NOTES && apply_notes)
+ cite_styles_[ENGINE_TYPE_NOTES].push_back(ciss);
else if (cis.first == ENGINE_TYPE_DEFAULT && apply_def)
cite_styles_[ENGINE_TYPE_DEFAULT].push_back(ciss);
}
class_cite_styles_[ENGINE_TYPE_AUTHORYEAR].clear();
if (type & ENGINE_TYPE_NUMERICAL && apply_num)
class_cite_styles_[ENGINE_TYPE_NUMERICAL].clear();
+ if (type & ENGINE_TYPE_NOTES && apply_notes)
+ class_cite_styles_[ENGINE_TYPE_NOTES].clear();
if (type & ENGINE_TYPE_DEFAULT && apply_def)
class_cite_styles_[ENGINE_TYPE_DEFAULT].clear();
return getout;
int TextClass::readCiteEngineType(Lexer & lexrc) const
{
static_assert(ENGINE_TYPE_DEFAULT ==
- (ENGINE_TYPE_AUTHORYEAR | ENGINE_TYPE_NUMERICAL),
+ (ENGINE_TYPE_AUTHORYEAR | ENGINE_TYPE_NUMERICAL | ENGINE_TYPE_NOTES),
"Incorrect default engine type");
if (!lexrc.next()) {
lexrc.printError("No cite engine type given for token: `$$Token'.");
return ENGINE_TYPE_AUTHORYEAR;
else if (compare_ascii_no_case(type, "numerical") == 0)
return ENGINE_TYPE_NUMERICAL;
+ else if (compare_ascii_no_case(type, "notes") == 0)
+ return ENGINE_TYPE_NOTES;
else if (compare_ascii_no_case(type, "default") != 0) {
string const s = "Unknown cite engine type `" + type
+ "' given for token: `$$Token',";
bool defined = false;
bool aydefined = false;
bool numdefined = false;
+ bool notesdefined = false;
// Check if the macro is already def'ed
for (auto const & cm : cite_macros_) {
if (!(type & cm.first))
else if (cm.first == ENGINE_TYPE_NUMERICAL)
// defined for numerical
numdefined = true;
+ else if (cm.first == ENGINE_TYPE_NOTES)
+ // defined for notes
+ notesdefined = true;
}
}
if (!defined || overwrite) {
cite_macros_[ENGINE_TYPE_AUTHORYEAR][etype] = definition;
if (type & ENGINE_TYPE_NUMERICAL && (type != ENGINE_TYPE_DEFAULT || !numdefined))
cite_macros_[ENGINE_TYPE_NUMERICAL][etype] = definition;
+ if (type & ENGINE_TYPE_NOTES && (type != ENGINE_TYPE_DEFAULT || !notesdefined))
+ cite_macros_[ENGINE_TYPE_NOTES][etype] = definition;
if (type == ENGINE_TYPE_DEFAULT)
cite_macros_[ENGINE_TYPE_DEFAULT][etype] = definition;
}
bool defined = false;
bool aydefined = false;
bool numdefined = false;
+ bool notesdefined = false;
// Check if the format is already def'ed
for (auto const & cm : cite_formats_) {
if (!(type & cm.first))
else if (cm.first == ENGINE_TYPE_NUMERICAL)
// defined for numerical
numdefined = true;
+ else if (cm.first == ENGINE_TYPE_NOTES)
+ // defined for notes
+ notesdefined = true;
}
}
if (!defined || overwrite){
cite_formats_[ENGINE_TYPE_AUTHORYEAR][etype] = definition;
if (type & ENGINE_TYPE_NUMERICAL && (type != ENGINE_TYPE_DEFAULT || !numdefined))
cite_formats_[ENGINE_TYPE_NUMERICAL][etype] = definition;
+ if (type & ENGINE_TYPE_NOTES && (type != ENGINE_TYPE_DEFAULT || !notesdefined))
+ cite_formats_[ENGINE_TYPE_NOTES][etype] = definition;
if (type == ENGINE_TYPE_DEFAULT)
cite_formats_[ENGINE_TYPE_DEFAULT][etype] = definition;
}