code: private static String latexName(final String name) {
      final Matcher matcher = pattern.matcher(name);
      if (!matcher.matches())
        return name;
      if (matcher.group(2).isEmpty())
        return matcher.group(1);
      return matcher.group(1) + "_{" + matcher.group(2) + "}";
    }
docs: Returns the latex string for a variable name
  @param name the name
  @return the matching UTF8 symbol