/** * {@inheritDoc} * * @see LatexPrintable#toLatexStringBuilder(LatexStringBuilderFactory,int) */ public final LatexStringBuilder toLatexStringBuilder( LatexStringBuilderFactory pLatexStringBuilderFactory, int pIndent) { int depth = 0; AbstractProofNode myParent = this.getParent(); while (myParent != null) { depth++; myParent = myParent.getParent(); } LatexStringBuilder builder = pLatexStringBuilderFactory.newBuilder( 0, LATEX_REC_SUB_TYPING_PROOF_NODE, pIndent, this.toPrettyString().toString(), this.seenTypes.toPrettyString().toString(), this.getLeft().toPrettyString().toString(), this.getRight().toPrettyString().toString(), this.getRule() == null ? LATEX_NO_RULE : this.getRule().toPrettyString().toString()); builder.addText("{" + String.valueOf(this.getId()) + "}"); // $NON-NLS-1$//$NON-NLS-2$ builder.addText("{" + String.valueOf(depth) + "}"); // $NON-NLS-1$//$NON-NLS-2$ builder.addBuilder( this.seenTypes.toLatexStringBuilder(pLatexStringBuilderFactory, pIndent + LATEX_INDENT), 0); builder.addBuilder( this.getLeft().toLatexStringBuilder(pLatexStringBuilderFactory, pIndent + LATEX_INDENT), 0); builder.addBuilder( this.getRight().toLatexStringBuilder(pLatexStringBuilderFactory, pIndent + LATEX_INDENT), 0); if (this.getRule() != null) { builder.addBuilder( this.getRule().toLatexStringBuilder(pLatexStringBuilderFactory, pIndent + LATEX_INDENT), 0); } else { builder.addEmptyBuilder(); } int indent = 245 - depth * 7; builder.addSourceCodeBreak(0); builder.addComment("width of the table"); // $NON-NLS-1$ builder.addText("{" + indent + "mm}"); // $NON-NLS-1$//$NON-NLS-2$ return builder; }
/** * {@inheritDoc} * * @see LatexPrintable#toLatexString() */ public final LatexString toLatexString() { return toLatexStringBuilder(LatexStringBuilderFactory.newInstance(), 0).toLatexString(); }