Skip to content

Instantly share code, notes, and snippets.

@prateekrajgautam
Last active March 2, 2021 09:52
Show Gist options
  • Save prateekrajgautam/c434bf228cc8b9ca193693b5abda9231 to your computer and use it in GitHub Desktop.
Save prateekrajgautam/c434bf228cc8b9ca193693b5abda9231 to your computer and use it in GitHub Desktop.
Texworks All In One compile script for Linux and windows
#!/bin/bash
pdflatex $1 $2 $3
#bibtex $2
biber $2
makeindex $2
makeglossaries $2
pdflatex $1 $2 $3
pdflatex $1 $2 $3
# Clean Auxilary files from Latex Folder
filetypes=(aux out log lof lot toc ind ilg idx glo bcf maf ist glsdefs mtc0 mtc gls glg 2i 2o blg run.xml bbl blg bcf mtc* mlf* mlt* ptc* plf* plt*)
for i in ${filetypes[@]}
do
rm ./*.$i
done
#!/bin/bash
# Clean Auxilary files from Latex Folder
filetypes=(aux out log lof lot toc ind ilg idx glo bcf maf ist glsdefs mtc0 mtc gls glg 2i 2o blg run.xml bbl blg bcf mtc* mlf* mlt* ptc* plf* plt*)
for i in ${filetypes[@]}
do
rm ./*.$i
done
set path="C:\texlive\2019\bin\win32"
"%path%\pdflatex.exe" %1 %2 %3
"%path%\bibtex.exe" %4
"%path%\makeindex.exe" %4
"%path%\pdflatex.exe" %1 %2 %3
"%path%\pdflatex.exe" %1 %2 %3
:: INSTALL PANDOC TO CONVERT TO WORD FILE
::pandoc %3 -S -o %3.docx
:: TO UPDATE REFERENCES
::set referencefilename=filereference.bib
::pandoc %3 --bibliography=%referencefilename% -S -o %3.docx
:: Texworks Instructions
:: save Above script as executible
:: In texwork> file> preference > Typesetting >Processing tools
:: add new
:: Name it anything ie AIO
:: in the program browse above script
:: add three arguments
:: $fullname
:: $basename
:: $synctexoption
::PdfLaTeX+MakeIndex+BibTeX
::$synctexoption
::$fullname
::$basename
#!/bin/bash
## Script 1 for pandoc DOCX and MD conversion
pandoc $1 -c --bibliography=$2 -o $2.docx
pandoc $1 -c --bibliography=$2 -o $2.md
#!/bin/bash
## Script 1 for pandoc DOCX and MD conversion
pandoc $1 -c --bibliography=$2 -o $2.docx
pandoc $1 -c --bibliography=$2 -o $2.md
##Script 2 AIO with BibTeX
pdflatex $1 $2 $3
bibtex $2
#biber $2
makeindex $2
makeglossaries $2
pdflatex $1 $2 $3
pdflatex $1 $2 $3
##Script 3 AIO with Biber
pdflatex $1 $2 $3
#bibtex $2
biber $2
makeindex $2
makeglossaries $2
pdflatex $1 $2 $3
pdflatex $1 $2 $3
## Texworks Instructions
## save Above script as executible
## In texwork> file> preference > Typesetting >Processing tools
## add new
## Name it anything ie AIO
## in the program browse above script
## add three arguments
## $fullname
## $basename
## $synctexoption
#echo help
#echo $0 #location of compiling sh script
#echo $1 #NAME of Main Tex File
#echo $2 # NAME of Main Tex File without .tex
#echo $3 #-synchtex=1
#!/bin/bash
##Script 3 AIO with Biber
pdflatex $1 $2 $3
#bibtex $2
biber $2
makeindex $2
makeglossaries $2
pdflatex $1 $2 $3
#!/bin/bash
##Script 2 AIO with BibTeX
pdflatex $1 $2 $3
bibtex $2
#biber $2
makeindex $2
makeglossaries $2
pdflatex $1 $2 $3
pdflatex $1 $2 $3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment