Ejemplo n.º 1
0
void InsetMathCases::write(WriteStream & os) const
{
	MathEnsurer ensurer(os);
	if (os.fragile())
		os << "\\protect";
	os << "\\begin{cases}\n";
	InsetMathGrid::write(os);
	if (os.fragile())
		os << "\\protect";
	os << "\\end{cases}";
}
Ejemplo n.º 2
0
void InsetMathDecoration::write(WriteStream & os) const
{
	MathEnsurer ensurer(os);
	if (os.fragile() && protect())
		os << "\\protect";
	os << '\\' << key_->name << '{';
	ModeSpecifier specifier(os, currentMode());
	os << cell(0) << '}';
}
Ejemplo n.º 3
0
void InsetMathSplit::write(WriteStream & ws) const
{
	MathEnsurer ensurer(ws);
	if (ws.fragile())
		ws << "\\protect";
	docstring suffix;
	if (!numbered_ && name_ == "align")
		suffix = from_ascii("*");
	ws << "\\begin{" << name_ << suffix << '}';
	if (name_ != "split" && name_ != "align" && verticalAlignment() != 'c')
		ws << '[' << verticalAlignment() << ']';
	if (name_ == "alignedat")
		ws << '{' << static_cast<unsigned int>((ncols() + 1)/2) << '}';
	InsetMathGrid::write(ws);
	if (ws.fragile())
		ws << "\\protect";
	ws << "\\end{" << name_ << suffix << "}\n";
}
Ejemplo n.º 4
0
void InsetMathTabular::write(WriteStream & os) const
{
	ModeSpecifier specifier(os, TEXT_MODE);

	if (os.fragile())
		os << "\\protect";
	os << "\\begin{" << name_ << '}';
	bool open = os.startOuterRow();

	char const v = verticalAlignment();
	if (v == 't' || v == 'b')
		os << '[' << v << ']';
	os << '{' << horizontalAlignments() << "}\n";

	InsetMathGrid::write(os);

	if (os.fragile())
		os << "\\protect";
	os << "\\end{" << name_ << '}';
	if (open)
		os.startOuterRow();
	// adding a \n here is bad if the tabular is the last item
	// in an \eqnarray...
}
Ejemplo n.º 5
0
void InsetMathPhantom::write(WriteStream & os) const
{
	MathEnsurer ensurer(os);
	if (os.fragile())
		os << "\\protect";
	switch (kind_) {
	case phantom:
		os << "\\phantom{";
		break;
	case vphantom:
		os << "\\vphantom{";
		break;
	case hphantom:
		os << "\\hphantom{";
		break;
	case smash:
		os << "\\smash{";
		break;
	case smasht:
		os << "\\smash[t]{";
		break;
	case smashb:
		os << "\\smash[b]{";
		break;
	case mathclap:
		os << "\\mathclap{";
		break;
	case mathllap:
		os << "\\mathllap{";
		break;
	case mathrlap:
		os << "\\mathrlap{";
		break;
	}
	os << cell(0) << '}';
}