| 1 |
@echo off |
| 2 |
|
| 3 |
|
| 4 |
cd /d "%~dp0" |
| 5 |
|
| 6 |
title CQUThesis Build Helper |
| 7 |
|
| 8 |
set flag=%1 |
| 9 |
if %flag%x == x ( |
| 10 |
set flag=thesis |
| 11 |
) |
| 12 |
|
| 13 |
if %flag%x == thesisx ( |
| 14 |
call:thesis |
| 15 |
goto :EOF |
| 16 |
) |
| 17 |
if %flag%x == thesisxx ( |
| 18 |
call:thesisx |
| 19 |
goto :EOF |
| 20 |
) |
| 21 |
if %flag%x == docx ( |
| 22 |
call:extract |
| 23 |
call:document |
| 24 |
goto :EOF |
| 25 |
) |
| 26 |
if %flag%x == cleanx ( |
| 27 |
call:cleanaux |
| 28 |
goto :EOF |
| 29 |
) |
| 30 |
if %flag%x == cleanpdfx ( |
| 31 |
call:cleanpdf |
| 32 |
goto :EOF |
| 33 |
) |
| 34 |
if %flag%x == cleanallx ( |
| 35 |
call:cleanaux |
| 36 |
call:cleanpdf |
| 37 |
goto :EOF |
| 38 |
) |
| 39 |
if %flag%x == extractx ( |
| 40 |
call:extract |
| 41 |
goto :EOF |
| 42 |
) |
| 43 |
if %flag%x == allx ( |
| 44 |
call:thesis |
| 45 |
call:document |
| 46 |
goto :EOF |
| 47 |
) |
| 48 |
if %flag%x == buildx ( |
| 49 |
call:extract |
| 50 |
call:thesis |
| 51 |
goto :EOF |
| 52 |
) |
| 53 |
if %flag%x == buildxx ( |
| 54 |
call:extract |
| 55 |
call:thesis |
| 56 |
call:document |
| 57 |
goto :EOF |
| 58 |
) |
| 59 |
|
| 60 |
:help |
| 61 |
echo ************************************************************* |
| 62 |
echo This is the Makefile script for CQUThesis on Windows. |
| 63 |
echo For CQUThesis: https://github.com/nanmu42/CQUThesis |
| 64 |
echo by Zhennan Li (C) 2016 under LPPL 1.3 |
| 65 |
echo The idea comes from Github Liam0205/sduthesis, Many thanks! |
| 66 |
echo ************************************************************* |
| 67 |
echo * |
| 68 |
echo USAGE: |
| 69 |
echo makewin [param] |
| 70 |
echo param: |
| 71 |
echo help Display this help text |
| 72 |
echo thesis (default)Compile the thesis via latexmk |
| 73 |
echo thesisx Compile the thesis via XeLaTeX(only if latexmk is not installed.) |
| 74 |
echo doc Compile the documentation of CQUThesis |
| 75 |
echo clean Clean all aux files |
| 76 |
echo cleanpdf Clean all PDFs |
| 77 |
echo cleanall Clean all aux files and all PDFs |
| 78 |
echo extract Extract the Thesis Template from .dtx files. |
| 79 |
echo all thesis + doc |
| 80 |
echo build extract + thesis |
| 81 |
echo buildx extract + thesis + doc |
| 82 |
echo * |
| 83 |
echo ***********************Happy TeXing************************** |
| 84 |
goto :EOF |
| 85 |
|
| 86 |
:checkfiles |
| 87 |
IF NOT EXIST cquthesis.cls call:extract |
| 88 |
IF NOT EXIST cquthesis.cfg call:extract |
| 89 |
goto :EOF |
| 90 |
|
| 91 |
:thesis |
| 92 |
call:checkfiles |
| 93 |
latexmk -xelatex main.tex |
| 94 |
goto :EOF |
| 95 |
|
| 96 |
:thesisx |
| 97 |
call:checkfiles |
| 98 |
xelatex main.tex |
| 99 |
bibtex main.tex |
| 100 |
xelatex main.tex |
| 101 |
xelatex main.tex |
| 102 |
xelatex main.tex |
| 103 |
goto :EOF |
| 104 |
|
| 105 |
:cleanaux |
| 106 |
echo cleaning aux... |
| 107 |
for %%i in (*.aux *.bbl *.equ *.glo *.gls *.hd *.idx *.ilg *.ind *.lof *.lot *.out *.blg *.log *.thm *.toc *.synctex.gz *.lofEN *.lotEN *.equEN) do ( |
| 108 |
del %%i |
| 109 |
) |
| 110 |
echo Done. |
| 111 |
goto :EOF |
| 112 |
|
| 113 |
:cleanpdf |
| 114 |
echo cleaning pdf... |
| 115 |
for %%i in (*.pdf) do ( |
| 116 |
del %%i |
| 117 |
) |
| 118 |
echo Done. |
| 119 |
goto :EOF |
| 120 |
|
| 121 |
:clean_all |
| 122 |
call:cleanaux |
| 123 |
call:cleanpdf |
| 124 |
goto :EOF |
| 125 |
|
| 126 |
:extract |
| 127 |
echo extracting... |
| 128 |
latex cquthesis.ins |
| 129 |
echo *******CQUThesis has been extracted.******** |
| 130 |
goto :EOF |
| 131 |
|
| 132 |
:document |
| 133 |
echo building documents... |
| 134 |
set cmode=-interaction=batchmode |
| 135 |
xelatex cquthesis.dtx |
| 136 |
makeindex -s gind.ist -o cquthesis.ind cquthesis.idx |
| 137 |
makeindex -s gglo.ist -o cquthesis.gls cquthesis.glo |
| 138 |
xelatex cquthesis.dtx |
| 139 |
xelatex cquthesis.dtx |
| 140 |
xelatex cquthesis.dtx |
| 141 |
goto :EOF |