当前位置: 首页>>代码示例>>C++>>正文


C++ LaTeXFeatures::require方法代码示例

本文整理汇总了C++中LaTeXFeatures::require方法的典型用法代码示例。如果您正苦于以下问题:C++ LaTeXFeatures::require方法的具体用法?C++ LaTeXFeatures::require怎么用?C++ LaTeXFeatures::require使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LaTeXFeatures的用法示例。


在下文中一共展示了LaTeXFeatures::require方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: validate

void InsetRef::validate(LaTeXFeatures & features) const
{
	string const cmd = getCmdName();
	if (cmd == "vref" || cmd == "vpageref")
		features.require("varioref");
	else if (cmd == "formatted") {
		docstring const data = getEscapedLabel(features.runparams());
		docstring label;
		docstring prefix;
		string const fcmd = to_utf8(getFormattedCmd(data, label, prefix));
		if (buffer().params().use_refstyle) {
			features.require("refstyle");
			if (prefix == "cha")
				features.addPreambleSnippet("\\let\\charef=\\chapref");
			else if (!prefix.empty()) {
				string lcmd = "\\AtBeginDocument{\\providecommand" + 
						fcmd + "[1]{\\ref{" + to_utf8(prefix) + ":#1}}}";
				features.addPreambleSnippet(lcmd);
			}
		} else {
			features.require("prettyref");
			// prettyref uses "cha" for chapters, so we provide a kind of
			// translation.
			if (prefix == "chap")
				features.addPreambleSnippet("\\let\\[email protected]=\\[email protected]");
		}
	} else if (cmd == "eqref" && !buffer().params().use_refstyle)
		// with refstyle, we simply output "(\ref{label})"
		features.require("amsmath");
	else if (cmd == "nameref")
		features.require("nameref");
}
开发者ID:hashinisenaratne,项目名称:HSTML,代码行数:32,代码来源:InsetRef.cpp

示例2: validate

void InsetSpecialChar::validate(LaTeXFeatures & features) const
{
	if (kind_ == MENU_SEPARATOR)
		features.require("lyxarrow");
	if (kind_ == NOBREAKDASH)
		features.require("amsmath");
}
开发者ID:hashinisenaratne,项目名称:HSTML,代码行数:7,代码来源:InsetSpecialChar.cpp

示例3: validate

void InsetListings::validate(LaTeXFeatures & features) const
{
	features.require("listings");
	string param_string = params().params();
	if (param_string.find("\\color") != string::npos)
		features.require("color");
	InsetCollapsable::validate(features);
}
开发者ID:JoaquimBellmunt,项目名称:lyx,代码行数:8,代码来源:InsetListings.cpp

示例4: validate

void InsetMathSplit::validate(LaTeXFeatures & features) const
{
	if (name_ == "split" || name_ == "gathered" || name_ == "aligned" ||
	    name_ == "alignedat" || name_ == "align")
		features.require("amsmath");
	else if (name_ == "lgathered" || name_ == "rgathered")
		features.require("mathtools");
	InsetMathGrid::validate(features);
}
开发者ID:315234,项目名称:lyx-retina,代码行数:9,代码来源:InsetMathSplit.cpp

示例5: validate

void InsetMathAMSArray::validate(LaTeXFeatures & features) const
{
	if (name_ == "CD")
		// amscd is independent of amsmath although it is part of
		// the amsmath bundle
		features.require("amscd");
	else
		features.require("amsmath");
	InsetMathGrid::validate(features);
}
开发者ID:cburschka,项目名称:lyx,代码行数:10,代码来源:InsetMathAMSArray.cpp

示例6: validate

void InsetSpecialChar::validate(LaTeXFeatures & features) const
{
	if (kind_ == ALLOWBREAK)
		features.require("lyxzerowidthspace");
	if (kind_ == MENU_SEPARATOR)
		features.require("lyxarrow");
	if (kind_ == NOBREAKDASH)
		features.require("amsmath");
	if (kind_ == PHRASE_LYX)
		features.require("LyX");
}
开发者ID:cburschka,项目名称:lyx,代码行数:11,代码来源:InsetSpecialChar.cpp

示例7: validate

void InsetTOC::validate(LaTeXFeatures & features) const
{
	InsetCommand::validate(features);
	features.useInsetLayout(getLayout());
	if (getCmdName() == "lstlistoflistings") {
		if (buffer().params().use_minted)
			features.require("minted");
		else
			features.require("listings");
	}
}
开发者ID:cburschka,项目名称:lyx,代码行数:11,代码来源:InsetTOC.cpp

示例8: 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");
	}
}
开发者ID:315234,项目名称:lyx-retina,代码行数:52,代码来源:BufferEncodings.cpp

示例9: validate

void InsetCitation::validate(LaTeXFeatures & features) const
{
	switch (features.bufferParams().citeEngine()) {
	case ENGINE_BASIC:
		break;
	case ENGINE_NATBIB_AUTHORYEAR:
	case ENGINE_NATBIB_NUMERICAL:
		features.require("natbib");
		break;
	case ENGINE_JURABIB:
		features.require("jurabib");
		break;
	}
}
开发者ID:rpavlik,项目名称:lyx-lucid-backport,代码行数:14,代码来源:InsetCitation.cpp

示例10: validate

void InsetMathXArrow::validate(LaTeXFeatures & features) const
{
	if (name_ == "xleftarrow" || name_ == "xrightarrow")
		features.require("amsmath");
	else
		features.require("mathtools");
	if (features.runparams().math_flavor == OutputParams::MathAsHTML)
		// CSS adapted from eLyXer
		features.addCSSSnippet(
			"span.xarrow{display: inline-block; vertical-align: middle; text-align:center;}\n"
			"span.xatop{display: block;}\n"
			"span.xabottom{display: block;}");
	InsetMathNest::validate(features);
}
开发者ID:apex-hughin,项目名称:LyX,代码行数:14,代码来源:InsetMathXArrow.cpp

示例11: validate

void InsetMathBinom::validate(LaTeXFeatures & features) const
{
	if (features.runparams().isLaTeX()) {
		if (kind_ == BINOM)
			features.require("binom");
		if (kind_ == DBINOM || kind_ == TBINOM)
			features.require("amsmath");
	} else if (features.runparams().math_flavor == OutputParams::MathAsHTML)
		features.addPreambleSnippet("<style type=\"text/css\">\n"
			"span.binom{display: inline-block; vertical-align: bottom; text-align:center;}\n"
			"span.binom span{display: block;}\n"
			"span.binomdelim{font-size: 2em;}\n"
			"</style>");
	InsetMathNest::validate(features);
}
开发者ID:bsjung,项目名称:Lyx,代码行数:15,代码来源:InsetMathFrac.cpp

示例12: validate

void InsetNote::validate(LaTeXFeatures & features) const
{
	switch (params_.type) {
	case InsetNoteParams::Comment:
		features.require("verbatim");
		break;
	case InsetNoteParams::Greyedout:
		features.require("color");
		features.require("lyxgreyedout");
		InsetCollapsable::validate(features);
		break;
	case InsetNoteParams::Note:
		break;
	}
}
开发者ID:rpavlik,项目名称:lyx-lucid-backport,代码行数:15,代码来源:InsetNote.cpp

示例13: validate

void InsetTOC::validate(LaTeXFeatures & features) const
{
	InsetCommand::validate(features);
	features.useInsetLayout(getLayout());
	if (getCmdName() == "lstlistoflistings")
		features.require("listings");
}
开发者ID:apex-hughin,项目名称:LyX,代码行数:7,代码来源:InsetTOC.cpp

示例14: validate

// ideas borrowed from the eLyXer code
void InsetMathDecoration::validate(LaTeXFeatures & features) const
{
    if (features.runparams().math_flavor == OutputParams::MathAsHTML) {
        string const name = to_utf8(key_->name);
        if (name == "bar") {
            features.addPreambleSnippet("<style type=\"text/css\">\n"
                                        "span.overbar{border-top: thin black solid;}\n"
                                        "</style>");
        } else if (name == "underbar" || name == "underline") {
            features.addPreambleSnippet("<style type=\"text/css\">\n"
                                        "span.underbar{border-bottom: thin black solid;}\n"
                                        "</style>");
        } else {
            features.addPreambleSnippet("<style type=\"text/css\">\n"
                                        "span.symbolpair{display: inline-block; text-align:center;}\n"
                                        "span.symontop{vertical-align: top;}\n"
                                        "span.symonbot{vertical-align: bottom;}\n"
                                        "span.symbolpair span{display: block;}\n"
                                        "span.symbol{height: 0.5ex;}\n"
                                        "</style>");
        }
    } else {
        if (!key_->requires.empty())
            features.require(to_utf8(key_->requires));
    }
    InsetMathNest::validate(features);
}
开发者ID:bsjung,项目名称:Lyx,代码行数:28,代码来源:InsetMathDecoration.cpp

示例15: validate

void InsetWrap::validate(LaTeXFeatures & features) const
{
	features.require("wrapfig");
	features.inFloat(true);
	InsetCollapsable::validate(features);
	features.inFloat(false);
}
开发者ID:djmitche,项目名称:lyx,代码行数:7,代码来源:InsetWrap.cpp


注:本文中的LaTeXFeatures::require方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。