示例#1
0
文件: Parser.cpp 项目: cburschka/lyx
string const Parser::verbatimEnvironment(string const & name)
{
	//FIXME: do something if endstring is not found
	string s = verbatimStuff("\\end{" + name + "}").second;
	// ignore one newline at beginning or end of string
	if (prefixIs(s, "\n"))
		s.erase(0,1);
	if (suffixIs(s, "\n"))
		s.erase(s.length() - 1,1);
	return s;
}
示例#2
0
bool LaTeXFeatures::isAvailable(string const & name)
{
	string::size_type const i = name.find("->");
	if (i != string::npos) {
		string const from = name.substr(0,i);
		string const to = name.substr(i+2);
		//LYXERR0("from=[" << from << "] to=[" << to << "]");
		return theConverters().isReachable(from, to);
	}

	if (packages_.empty())
		getAvailable();
	string n = name;
	if (suffixIs(n, ".sty"))
		n.erase(name.length() - 4);
	return packages_.find(n) != packages_.end();
}