So I've tried using tokenizers, but I can only figure out how to replace or remove single delimiters in java.
Like for this input: \box { Boxed words } {\boldface This line in bold. }
I want to be able to remove \box and some other guidelines I have to follow which are: The rules that we are going to apply are very simple .
- Remove all commands backslash followed one or more lowercase letters and terminated with a blank.
- Remove all braces: } or {.
- Substitute all math display (characters in between $), by the words FORMULA 1 , FORMULA 2 etc...
- The environment ( a special command) . \begin{enumerate} \item First item, \fer and only this. \item Second line \iterate and maybe more. \item Third. ... \end{enumerate} puts everything between backslash item in a new paragraph with a number. So the above should look:
- First item and only this.
- Second line and maybe more.
- Third.