ctex 678 B

123456789101112131415161718192021222324252627
  1. #!/bin/bash
  2. IGNORE_FILES=".*\.\(org\|pdf\|tex\|png\|PNG\|otf\)"
  3. IGNORE_FOLDERS="build|img|tex|font"
  4. dir=${PWD}
  5. builddir="$dir/build"
  6. [ -d "$builddir" ] || rm -rf "$builddir"
  7. mkdir -p $builddir
  8. xelatex_opts+=" -synctex=1"
  9. xelatex_opts+=" -interaction=nonstopmode"
  10. xelatex_opts+=" -shell-escape"
  11. echo -e "\n------------------ xelatex --------------------\n"
  12. for i in {1..2}
  13. do
  14. xelatex $xelatex_opts $1
  15. # if [ "$i" -eq "2" ]; then
  16. # find $dir \( ! -regex '.*/\..*' \) -type f ! -regex $IGNORE_FILES -exec mv -t $builddir {} +
  17. # find $dir -maxdepth 1 \( ! -regex '.*/\..*' \) -type d -not -path $dir | egrep -v $IGNORE_FOLDERS | xargs mv -t $builddir
  18. # fi
  19. done