mk_latexmkrc.sh (1127B)
1 #!/bin/bash 2 # generate latexmkrc 3 # Author: Andreas HABEGGER <andreas.habegger> 4 # Date : 2017 5 # Based on an idea by Albert Reiner. 6 7 _FILE_PERM=644 8 9 OUTFILE=.latexmkrc # Name of the file to generate. 10 11 OUTFILE="${_DESTINATION_DIR}/${OUTFILE}" 12 13 # ----------------------------------------------------------- 14 # 'Here document containing the body of the generated script. 15 ( 16 cat <<'EOF' 17 $dvi_previewer = 'start xdvi -watchfile 1.5'; 18 $ps_previewer = 'start gv --watch'; 19 $pdf_previewer = 'start xdg-open'; 20 21 @cus_dep_list = (@cus_dep_list, "eps pdf 0 eps2pdf"); 22 sub eps2pdf { 23 system("epstopdf $_[0].eps"); } 24 25 $latex = 'latex -interaction=nonstopmode -shell-escape'; 26 27 $pdflatex = 'pdflatex -interaction=nonstopmode -shell-escape'; 28 29 $bibtex_use = 2; 30 31 EOF 32 ) > $OUTFILE 33 # ----------------------------------------------------------- 34 35 # Quoting the 'limit string' prevents variable expansion 36 #+ within the body of the above 'here document.' 37 # This permits outputting literal strings in the output file. 38 39 if [ -f "$OUTFILE" ] 40 then 41 chmod ${_FILE_PERM} ${OUTFILE} 42 else 43 echo "Problem in creating file: \"$OUTFILE\"" 44 fi 45 46 47 48 exit 0