Exemple #1
0
  // convert value in other unit to this unit
  public float toUnit(TeXParser parser, float value, TeXUnit otherUnit) throws TeXSyntaxException {
    if (equals(otherUnit)) {
      return value;
    }

    if (otherUnit.equals(FixedUnit.PT)) {
      return value / parser.getListener().emToPt(1f);
    }

    return otherUnit.toPt(parser, value) / parser.getListener().emToPt(1f);
  }
Exemple #2
0
  // convert value in this unit to other unit
  public float fromUnit(TeXParser parser, float value, TeXUnit otherUnit)
      throws TeXSyntaxException {
    if (equals(otherUnit)) {
      return value;
    }

    if (otherUnit.equals(FixedUnit.PT)) {
      return parser.getListener().emToPt(value);
    }

    return otherUnit.fromPt(parser, parser.getListener().emToPt(value));
  }
Exemple #3
0
 public void process(TeXParser parser) throws IOException {
   parser.getListener().getWriteable().write("em");
 }
Exemple #4
0
 public TeXObjectList string(TeXParser parser) throws IOException {
   return parser.string(toString());
 }
Exemple #5
0
 public float fromPt(TeXParser parser, float value) throws TeXSyntaxException {
   return value / parser.getListener().emToPt(1f);
 }
Exemple #6
0
 public float toPt(TeXParser parser, float value) throws TeXSyntaxException {
   return parser.getListener().emToPt(value);
 }
Exemple #7
0
  public void process(TeXParser parser) throws IOException {
    TeXSettings settings = parser.getSettings();

    settings.startColumn();
  }
Exemple #8
0
  public TeXObjectList string(TeXParser parser) throws IOException {
    TeXObjectList list = new TeXObjectList();
    list.add(parser.getListener().getOther((int) parser.getTabChar()));

    return list;
  }
Exemple #9
0
 public String toString(TeXParser parser) {
   return "" + parser.getTabChar();
 }