本文整理汇总了C++中LaTeXFeatures::isRequired方法的典型用法代码示例。如果您正苦于以下问题:C++ LaTeXFeatures::isRequired方法的具体用法?C++ LaTeXFeatures::isRequired怎么用?C++ LaTeXFeatures::isRequired使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LaTeXFeatures
的用法示例。
在下文中一共展示了LaTeXFeatures::isRequired方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: validate
void BufferEncodings::validate(char_type c, LaTeXFeatures & features, bool for_mathed)
{
CharInfo const & ci = Encodings::unicodeCharInfo(c);
if (ci.isUnicodeSymbol()) {
// In mathed, c could be used both in textmode and mathmode
docstring const textcommand = ci.textcommand();
bool const math_mode = for_mathed && isMathCmd(c);
bool const use_math = math_mode ||
(!for_mathed && textcommand.empty());
bool const use_text = (for_mathed && isTextCmd(c)) ||
(!for_mathed && !textcommand.empty());
bool const plain_utf8 = (features.runparams().encoding->name() == "utf8-plain");
bool const unicode_math = (features.isRequired("unicode-math")
&& features.isAvailable("unicode-math"));
// with utf8-plain, we only load packages when in mathed (see #7766)
// and if we do not use unicode-math
if ((math_mode && !unicode_math)
|| (use_math && !plain_utf8)) {
string const mathpreamble = ci.mathpreamble();
if (!mathpreamble.empty()) {
if (ci.mathfeature()) {
string feats = mathpreamble;
while (!feats.empty()) {
string feat;
feats = split(feats, feat, ',');
features.require(feat);
}
} else
features.addPreambleSnippet(mathpreamble);
}
}
// with utf8-plain, we do not load packages (see #7766)
if (use_text && !plain_utf8) {
string const textpreamble = ci.textpreamble();
if (!textpreamble.empty()) {
if (ci.textfeature()) {
string feats = textpreamble;
while (!feats.empty()) {
string feat;
feats = split(feats, feat, ',');
features.require(feat);
}
} else
features.addPreambleSnippet(textpreamble);
}
}
}
if (for_mathed && isMathSym(c)) {
features.require("amstext");
features.require("lyxmathsym");
}
}