Commit 36846ccd authored by 0xJMR's avatar 0xJMR
Browse files

Fixes issue with spacing.

parent ac7875e7
Pipeline #61285 passed with stages
in 1 minute and 48 seconds
......@@ -10,6 +10,7 @@ import de.monticore.lang.monticar.types2._ast.ASTDimension;
import de.monticore.lang.monticar.types2._ast.ASTElementType;
import de.monticore.lang.matrixexpressions._ast.*;
import de.monticore.numberunit._ast.ASTTimeDiv;
import de.monticore.numberunit._ast.ASTUnitBaseDimWithPrefix;
public class TeXMathPrettyPrinter extends MathPrettyPrinter implements TeXMathStructuredVisitor {
protected boolean needsParenthesis;
......@@ -22,7 +23,7 @@ public class TeXMathPrettyPrinter extends MathPrettyPrinter implements TeXMathSt
@Override
public void visit(ASTElementType node) {
String printedNode = String.format("\\mathbb{%s}", node.getName());
String printedNode = String.format("\\mathbb{%s}\\;", node.getName());
this.printer.print(printedNode);
}
......@@ -67,9 +68,9 @@ public class TeXMathPrettyPrinter extends MathPrettyPrinter implements TeXMathSt
public void revisit(ASTMathAssignmentDeclarationStatement node) {
String printedNode = String.format("\\text{%s}", node.getName());
this.printer.print("~");
//this.printer.print("~");
this.printer.print(printedNode);
this.printer.print("~");
//this.printer.print("~");
}
@Override
......@@ -80,7 +81,7 @@ public class TeXMathPrettyPrinter extends MathPrettyPrinter implements TeXMathSt
this.printer.print(printedNode);
}
this.printer.print("~");
//this.printer.print("~");
}
@Override
......@@ -90,7 +91,7 @@ public class TeXMathPrettyPrinter extends MathPrettyPrinter implements TeXMathSt
@Override
public void endVisit(ASTMathDeclarationStatement node) {
this.printer.print("~");
//this.printer.print("~");
this.printer.print(node.getName());
this.printSemicolon();
this.printer.println();
......@@ -100,10 +101,12 @@ public class TeXMathPrettyPrinter extends MathPrettyPrinter implements TeXMathSt
public void visit(ASTTimeDiv node) {
//TODO: Create LaTeX
if (node.isPresentIsDiv()) {
this.printer.print("\\;");
this.printer.print(node.getIsDiv());
}
if (node.isPresentIsTime()) {
this.printer.print("\\;");
this.printer.print("\\cdot");
}
}
......@@ -271,4 +274,10 @@ public class TeXMathPrettyPrinter extends MathPrettyPrinter implements TeXMathSt
this.printer.print(printedNode);
}
@Override
public void visit(ASTUnitBaseDimWithPrefix node) {
this.printer.print("\\;");
this.printer.print(node.getName());
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment