/** * Returns the {@link BuiltinCommand} corresponding to LaTeX command called * <tt>\texName</tt>, or null if this command is not defined. */ public BuiltinCommand getBuiltinCommandByTeXName(String texName) { ConstraintUtilities.ensureNotNull(texName, "texName"); BuiltinCommand result = null; for (SnugglePackage snugglePackage : packages) { result = snugglePackage.getBuiltinCommandByTeXName(texName); if (result!=null) { break; } } return result; }
/** * Returns the {@link BuiltinCommand} corresponding to LaTeX command called * <tt>\texName</tt>, or null if this command is not defined. */ public BuiltinCommand getBuiltinCommandByTeXName(String texName) { ConstraintUtilities.ensureNotNull(texName, "texName"); BuiltinCommand result = null; for (SnugglePackage snugglePackage : packages) { result = snugglePackage.getBuiltinCommandByTeXName(texName); if (result!=null) { break; } } return result; }
/** * Returns the {@link BuiltinCommand} corresponding to LaTeX command called * <tt>\texName</tt>, or null if this command is not defined. */ public BuiltinCommand getBuiltinCommandByTeXName(String texName) { ConstraintUtilities.ensureNotNull(texName, "texName"); BuiltinCommand result = null; for (SnugglePackage map : packages) { result = map.getBuiltinCommandByTeXName(texName); if (result!=null) { break; } } return result; }
/** * Returns the {@link BuiltinCommand} corresponding to LaTeX command called * <tt>\texName</tt>, or null if this command is not defined. */ public BuiltinCommand getBuiltinCommandByTeXName(String texName) { ConstraintUtilities.ensureNotNull(texName, "texName"); BuiltinCommand result = null; for (SnugglePackage map : packages) { result = map.getBuiltinCommandByTeXName(texName); if (result!=null) { break; } } return result; }
public void addCommandInterpretation(final String name, final Interpretation interpretation) { BuiltinCommand command = getBuiltinCommandByTeXName(name); if (command==null) { throw new IllegalArgumentException("No command defined with name " + name); } command.getInterpretationMap().put(interpretation.getType(), interpretation); }
private MathCharacter ensureBuiltinMathCharacterCommand(String texName, String errorMessageContext) { BuiltinCommand command = getBuiltinCommandByTeXName(texName); MathCharacter mathCharacter = command!=null ? command.getMathCharacter() : null; if (command==null || mathCharacter==null) { throw new SnuggleRuntimeException(errorMessageContext + " must be a previously-defined math character input command"); } return mathCharacter; }