} else {
string += p.toString();
}
}
Token replacement = new Token(new Text(string));
if (range.areMultipleEquationsSelected()) {
// Remove all but one equation and replace it.
Vector<Equation> selectedEquations = range.getSelectedEquations();
range.setOnly(selectedEquations.firstElement().getRoot());
for (int i=1; i<selectedEquations.size(); i++) {
selectedEquations.get(i).removeEquation();