BASH   62

MathML files

Guest on 27th April 2022 01:44:07 AM

  1. #!/bin/bash
  2. #
  3. # (re)generate MathML files from *.itex2MML source.
  4.  
  5. ITEX2MML=itex2MML
  6. CLEAN=0
  7. if [ "$1" == '--clean' ]; then
  8.     CLEAN=1
  9. fi
  10.  
  11. ITEX2MML_OPTS=' --forbid-markup --unicode-entities'
  12.  
  13. find . -name '*.itex2MML' | while read ITEX2MML_FILE
  14. do
  15.     OUTPUT="${ITEX2MML_FILE/.itex2MML/}"
  16.     if [ "$CLEAN" == "1" ]; then
  17.         rm -vf "$OUTPUT"
  18.     else
  19.         echo "$ITEX2MML_FILE"
  20.         cat "$ITEX2MML_FILE" | $ITEX2MML $ITEX2MML_OPTS > "$OUTPUT"
  21.     fi
  22. done

Raw Paste


Login or Register to edit or fork this paste. It's free.