2014-04-09 17:43:14 +04:00
|
|
|
namespace LAview {
|
|
|
|
|
|
|
|
namespace Table {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* List of {@link AddSpace}-s.
|
|
|
|
*/
|
|
|
|
public class AddSpaces : ADocList {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Style of the {@link AddSpace}/{@link Subtable}.
|
|
|
|
*/
|
|
|
|
public enum Style {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Default style.
|
|
|
|
*/
|
|
|
|
DEFAULT = 0,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Formal style.
|
|
|
|
*/
|
|
|
|
FORMAL
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Style of the {@link AddSpace}/{@link Subtable}.
|
|
|
|
*/
|
|
|
|
public Style style = Style.DEFAULT;
|
|
|
|
|
|
|
|
/**
|
2014-07-25 18:30:55 +04:00
|
|
|
* Constructs a new empty ``AddSpaces``.
|
2014-04-09 17:43:14 +04:00
|
|
|
*/
|
|
|
|
public AddSpaces () {}
|
|
|
|
|
|
|
|
protected override ADocList create_default_instance () { return new AddSpaces (); }
|
|
|
|
|
|
|
|
/**
|
2014-07-25 18:30:55 +04:00
|
|
|
* Gets a copy of the ``AddSpaces``.
|
2014-04-09 17:43:14 +04:00
|
|
|
*/
|
|
|
|
public override IDoc copy () {
|
|
|
|
var clone = base.copy () as AddSpaces;
|
|
|
|
clone.style = style;
|
|
|
|
return clone;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-07-25 18:30:55 +04:00
|
|
|
* Generates LaTeX string for the ``AddSpaces``.
|
2014-04-09 17:43:14 +04:00
|
|
|
*/
|
|
|
|
public override string generate () {
|
|
|
|
var result = new StringBuilder ();
|
|
|
|
|
|
|
|
foreach (IDoc dociface in this)
|
|
|
|
result.append_printf (style == Style.FORMAL ? "\n\\addlinespace[%s]"
|
|
|
|
: "\n\\noalign{\\vskip%s}", dociface.generate ());
|
|
|
|
|
|
|
|
return result.str;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|