1 Star 0 Fork 4

gushouchuanzhi1/Experimental Report

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
makethesis.bat 6.04 KB
一键复制 编辑 原始数据 按行查看 历史
chenjz70 提交于 2021-11-11 22:17 . first commit
@echo off
REM --------------------------------------------------------------------------
REM Filename: makethesis.bat
REM Author: Xianling Wang <rioxwang@foxmail.com>
REM Created: 2013-07-08
REM Modified: 2015-01-02
REM Version: 1.4
REM --------------------------------------------------------------------------
REM Change Log
REM v1.0: Batch file created.
REM 1. 'clean', 'install' and 'thesis' functions are defined.
REM 2. 'xetex' engine w/o chapbib are defined.
REM v1.1: Function added.
REM 1. 'wordcount' function is defined.
REM v1.2: Batch file BUG fixed.
REM 1. 'example' folder should be existed in TeXLive release.
REM 2. '\' in the path are changed into '//' for TeXLive Compatibility.
REM v1.3: Batch file BUG fixed.
REM 1. Missuse of 'if...else...' is fixed.
REM 2. Missuse of 'for loop' is fixed.
REM v1.4: Modify output redirecting.
REM --------------------------------------------------------------------------
REM User Configuration
REM Project name
set PROJECT=Experimental_Report
REM File name of your top-level tex file.
set TARGET=Experimental_Report
REM File name list of tex files for mainmatters.
set MAINMATTERS=(01_chapter 02_chapter 03_chapter 04_chapter 05_chapter 06_chapter)
REM Driver type to build PDF.
REM 'xetex' for xetex engine;
set DRIVER=xetex
REM Bib type to construct bibliography.
REM 'chapbib' for bib per chapter; 'allbib' for bib in thesis end.
set BIBTYPE=allbib
REM --------------------------------------------------------------------------
REM Main Function Selection
if /I {%1}=={clean} goto clean
if /I {%1}=={install} goto install
if /I {%1}=={thesis} goto thesis
if /I {%1}=={wordcount} goto wordcount
REM Default Selection: thesis
goto thesis
REM --------------------------------------------------------------------------
REM TMP Files Clearance
:clean
echo Clearing TMP files...
echo Clearing TMP files in installation...
del *.dvi *.ps >nul
echo Clearing TMP files in thesis generation...
del *.bbl *.blg *.aux *.log *.acn *.glo *.ist *.acr *.alg *.out *.toc *.thm *.ps *.dvi >nul
echo ===========================================
echo = Mission Done!
echo = ALL TMP files are cleared!
echo ===========================================
goto end
REM --------------------------------------------------------------------------
REM Word Count
:wordcount
echo Counting word...
texcount -ch -inc -incbib -html -v -sum bare_thesis.tex > wordcount.html
echo ===========================================
echo = Counting Mission Done!
echo = Word-counting Results are recorded in 'wordcount.html'!
echo ===========================================
goto end
REM --------------------------------------------------------------------------
REM Document Class and Help PDF File Generation
:install
mkdir example
echo Extracting and installing files...
xetex install//%PROJECT%.ins
echo Building user guide...
xelatex -no-pdf install//%PROJECT%.dtx
makeindex -q -s gglo.ist -o %PROJECT%.gls %PROJECT%.glo
echo Rebuilding to generate change-log...
xelatex -no-pdf install//%PROJECT%.dtx >nul
makeindex -q -s gglo.ist -o %PROJECT%.gls %PROJECT%.glo >nul
echo Rebuilding to generate cross-reference...
xelatex install//%PROJECT%.dtx
echo Clearing TMP files...
del /f /q %PROJECT%.aux %PROJECT%.glo %PROJECT%.ilg %PROJECT%.ind
del /f /q %PROJECT%.out %PROJECT%.toc %PROJECT%.idx %PROJECT%.hd %PROJECT%.xdv %PROJECT%.gls
echo ===========================================
echo = Mission Done!
echo = HUSTGraduateThesis is successfully installed!
echo ===========================================
goto end
REM --------------------------------------------------------------------------
REM Thesis PDF Generation
:thesis
REM Check the user input configuration.
echo ===========================================
echo =
echo = TARGET=%TARGET%
echo = MAINMATTERS=%MAINMATTERS%
echo = DRIVER=%DRIVER%
echo = BIBTYPE=%BIBTYPE%
echo =
echo ===========================================
echo Double check above configurations! Press anykey to continue, CTRL+C to stop!
pause
REM Check the integrity of the installation.
echo Checking Existence of Essential Files...
if not exist %PROJECT%.cls (
echo ===========================================
echo = Mission Failed!
echo = Cannot find essential cls files!
echo = Please 'makethesis.bat install' to reinstall HUSTGraduateThesis!
echo ===========================================
goto end
)
if not exist %PROJECT%.cfg (
echo ===========================================
echo = Mission Failed!
echo = Cannot find essential cfg files!
echo = Please 'makethesis.bat install' to reinstall HUSTGraduateThesis!
echo ===========================================
goto end
)
if not exist %PROJECT%.bst (
echo ===========================================
echo = Mission Failed!
echo = Cannot find essential bst files!
echo = Please 'makethesis.bat install' to reinstall HUSTGraduateThesis!
echo ===========================================
goto end
)
echo Document class installed! Generating Thesis PDF...
REM Generate the thesis PDF according to different configurations.
echo Generating Thesis PDF...
if %DRIVER%==xetex (
echo Building thesis PDF...
xelatex --interaction=errorstopmode --synctex=-1 %TARGET%
echo Processing BIB files...
if %BIBTYPE%==chapbib (
for %%M in %MAINMATTERS% do ( bibtex %%M >nul )
) else (
bibtex %TARGET% >nul
)
bibtex jrnl.aux >nul
bibtex conf.aux >nul
bibtex patent.aux >nul
bibtex book.aux >nul
bibtex proposal.aux >nul
echo Processing index files...
makeindex -s %TARGET%.ist -t %TARGET%.alg -o %TARGET%.acr %TARGET%.acn >nul 2>nul
echo Rebuilding 1 to generate cross-reference...
xelatex --interaction=nonstopmode --synctex=-1 %TARGET% >nul
echo Rebuilding 2 to generate cross-reference...
xelatex --interaction=nonstopmode --synctex=1 %TARGET% >nul
) else (
echo Engine Undefined!
)
echo ===========================================
echo = Mission Done!
echo = Thesis PDF is successfully generated!
echo ===========================================
goto end
REM --------------------------------------------------------------------------
REM Execution Finish
:end
REM EOF
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TeX/LaTeX
1
https://gitee.com/gushouchuanzhi1/experimental-report.git
git@gitee.com:gushouchuanzhi1/experimental-report.git
gushouchuanzhi1
experimental-report
Experimental Report
master

搜索帮助