summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-02-24 14:29:37 +0000
committerKarl Berry <karl@freefriends.org>2020-02-24 14:29:37 +0000
commit078408f4365f62e091d52e758b0ea193426edf03 (patch)
treeddf474e245cfa682aa2faa2225d9e8c337a7b14c /Master/texmf-dist/source/latex
parente226f253e0776a723ba2224d9042cbcdeed539f2 (diff)
hitszthesis (23feb20)
git-svn-id: svn://tug.org/texlive/trunk@53887 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex')
-rwxr-xr-xMaster/texmf-dist/source/latex/hitszthesis/Compile.bat147
-rw-r--r--Master/texmf-dist/source/latex/hitszthesis/Makefile5
-rw-r--r--Master/texmf-dist/source/latex/hitszthesis/hitszthesis.dtx43
-rw-r--r--Master/texmf-dist/source/latex/hitszthesis/hitszthesis.ins2
4 files changed, 186 insertions, 11 deletions
diff --git a/Master/texmf-dist/source/latex/hitszthesis/Compile.bat b/Master/texmf-dist/source/latex/hitszthesis/Compile.bat
new file mode 100755
index 00000000000..230b133a565
--- /dev/null
+++ b/Master/texmf-dist/source/latex/hitszthesis/Compile.bat
@@ -0,0 +1,147 @@
+@echo off
+chcp 65001 >nul
+
+set THESIS=main
+set PACKAGE=hitszthesis
+set SPINE=spine
+
+set flag=%1
+if %flag%x == x (
+ set flag=thesis
+)
+
+if %flag%x == thesisx (
+ call :cleanall
+ call :thesis
+ if ERRORLEVEL 1 (
+ echo Error! Please check the 'main.log' for more details...
+ pause
+ ) else (
+ call :clean
+ echo Finished!
+ )
+ goto :EOF
+)
+
+if %flag%x == clsx (
+ call :cls
+ goto :EOF
+)
+
+if %flag%x == allx (
+ call :all
+ goto :EOF
+)
+
+if %flag%x == spinex (
+ call :all
+ goto :EOF
+)
+
+if %flag%x == docx (
+ call :doc
+ goto :EOF
+)
+
+if %flag%x == cleanx (
+ call :clean
+ goto :EOF
+)
+
+if %flag%x == cleanallx (
+ call :cleanall
+ goto :EOF
+)
+
+if %flag%x == wordcountx (
+ call :wordcounty
+ goto :EOF
+)
+
+:help
+ echo This is the compile batch script for hitszhesis.
+ echo Usage:
+ echo compile.bat [option]
+ echo options:
+ echo thesis Compile the thesis (default)
+ echo clean Clean all work files
+ echo cleanall Clean all work files and main.pdf
+ echo wordcount Count words in main.pdf
+ echo help Print this help message
+goto :EOF
+
+:thesis
+ echo Compile...
+ latexmk -xelatex -quiet -file-line-error -halt-on-error -interaction=nonstopmode main >nul 2>nul
+goto :EOF
+
+:cls
+ echo Split cls file...
+ xetex %PACKAGE%.ins
+goto :EOF
+
+:spine
+ echo Compile spine.tex file...
+ latexmk -xelatex -quiet -file-line-error -halt-on-error -interaction=nonstopmode spine >nul 2>nul
+goto :EOF
+
+:all
+ echo Compile thesis and spine...
+ latexmk -xelatex -file-line-error -halt-on-error -interaction=nonstopmode main >nul 2>nul
+ latexmk -xelatex -file-line-error -halt-on-error -interaction=nonstopmode spine >nul 2>nul
+goto :EOF
+
+:doc
+ echo Compile documentation...
+ latexmk -xelatex -file-line-error -halt-on-error -interaction=nonstopmode %PACKAGE%.dtx >nul 2>nul
+goto :EOF
+
+:clean
+ echo Clean auxiliary files...
+ latexmk -c -silent %PACKAGE%.dtx %THESIS% %SPINE% 2>nul
+ del tex\*.aux >nul 2>nul
+goto :EOF
+
+:cleanall
+ echo Clean pdf files...
+ del /Q %PACKAGE%.pdf %THESIS%.pdf %SPINE%.pdf >nul 2>nul
+ goto :clean
+goto :EOF
+
+:wordcountx
+ set found=0
+ setlocal enabledelayedexpansion
+
+ findstr "\\documentclass\[[^\[]*english" %THESIS%.tex > nul
+ if %errorlevel% equ 0 (
+ for /f "delims=" %%i in ('texcount %THESIS%.tex -inc -char-only 2^>nul') do (
+ if !found! equ 1 (
+ echo 英文字符数: !%%i!
+ goto :total
+ )
+ echo %%i | findstr "total" > nul && set found=1
+ )
+ ) else (
+ for /f "delims=" %%i in ('texcount %THESIS%.tex -inc -ch-only 2^>nul') do (
+ if !found! equ 1 (
+ echo 纯中文字数: !%%i!
+ goto :total
+ )
+ echo %%i | findstr "total" > nul && set found=1
+ )
+ )
+
+:total
+ set found=0
+ for /f "delims=" %%i in ('texcount %THESIS%.tex -inc -chinese 2^>nul') do (
+ if !found! equ 1 (
+ echo 总字数^(英文单词+中文字^):!%%i!
+ goto :EOF
+ )
+ echo %%i | findstr "total" > nul && set found=1
+ )
+goto :EOF
+
+:wordcounty
+ texcount %THESIS%.tex -inc -chinese
+goto :EOF
diff --git a/Master/texmf-dist/source/latex/hitszthesis/Makefile b/Master/texmf-dist/source/latex/hitszthesis/Makefile
index ce3df42ab93..7f8b55e6a8e 100644
--- a/Master/texmf-dist/source/latex/hitszthesis/Makefile
+++ b/Master/texmf-dist/source/latex/hitszthesis/Makefile
@@ -16,7 +16,7 @@ else
RM = rm -f
endif
-.PHONY: all all-dev clean distclean dist thesis viewthesis spine viewspine doc viewdoc cls check save savepdf test FORCE_MAKE
+.PHONY: all all-dev wordcount clean distclean dist thesis viewthesis spine viewspine doc viewdoc cls check save savepdf test FORCE_MAKE
thesis: $(THESIS).pdf
@@ -60,6 +60,9 @@ savepdf:
test:
l3build check
+wordcount : $(THESIS).tex
+ @texcount $< -inc -chinese
+
clean:
$(LATEXMK) -c $(PACKAGE).dtx $(THESIS) $(SPINE)
-@$(RM) *~ main-survey.*
diff --git a/Master/texmf-dist/source/latex/hitszthesis/hitszthesis.dtx b/Master/texmf-dist/source/latex/hitszthesis/hitszthesis.dtx
index ffb6069343b..7ae72e10e24 100644
--- a/Master/texmf-dist/source/latex/hitszthesis/hitszthesis.dtx
+++ b/Master/texmf-dist/source/latex/hitszthesis/hitszthesis.dtx
@@ -16,7 +16,7 @@
%
% \iffalse
%<*driver>
-\ProvidesFile{hitszthesis.dtx}[2020/02/18 v2.0 A Bachelor Thesis Template for Harbin Institute of Technology, ShenZhen (HITSZ) ]
+\ProvidesFile{hitszthesis.dtx}[2020/02/23 v2.1 A Bachelor Thesis Template for Harbin Institute of Technology, ShenZhen (HITSZ) ]
\documentclass{ltxdoc}
\usepackage{dtx-style}
@@ -160,8 +160,10 @@
% spine.tex & 书脊示例文档\\
% figure/ & 示例文档插图路径\\
% front/ & 示例文档封面插图路径\\
+% tex/ & 示例文档正文各部分路径\\
% hitszthesis.sty & 为示例文档加载其它宏包\\\midrule
-% Makefile & Makefile\\
+% Makefile & GNU make 使用 Makefile\\
+% Compile.bat & Windows 编译用脚本文件\\
% latexmkrc & latexmk 配置文件 \\
% README.md & Readme\\
% \textbf{hitszthesis.pdf} & 用户手册(本文档)\\\bottomrule
@@ -246,11 +248,14 @@
% 则使用 \texttt{make} 生成文件是最方便的办法。
%
% \begin{shell}
-% $ make clean # 清理辅助文件
% $ make cls # 生成 hitszthesis.cls
% $ make doc # 生成说明文档 hitszthesis.pdf
% $ make thesis # 生成示例文档 main.pdf
% $ make spine # 生成书脊 spine.pdf
+% $ make all # 生成示例文档 main.pdf 以及书脊 spine.pdf
+% $ make wordcount # 统计论文字数
+% $ make clean # 清理辅助文件
+% $ make cleanall # 删除所有 pdf 文件和所有辅助文件
% \end{shell}
%
% \hitszthesis\ 的 \file{Makefile} 默认用 \texttt{latexmk} 调用\texttt{xelatex} 编
@@ -258,6 +263,21 @@
% 改 \file{Makefile} 开头的参数或通过命令行传递参数(请参看 \file{README.md}),
% 进一步还可以修改 \file{latexmkrc} 进行定制。
%
+% \changes{v2.1}{2020/02/23}{Add \file{Compile.bat}, add wordcount function, regulate writing style of \file{main.tex} to use \file{input}}
+% \subsubsection{Compile.bat}
+% \label{sec:bat}
+% 针对windows系统,本模板提供了 \file{Compile.bat} 脚本文件,
+% 可以双击直接编译,也可以在命令提示符窗口中使用脚本提供的额外功能:
+% \begin{shell}
+% $ Compile.bat cls # 生成 hitszthesis.cls
+% $ Compile.bat doc # 生成说明文档 hitszthesis.pdf
+% $ Compile.bat thesis # 生成示例文档 main.pdf
+% $ Compile.bat spine # 生成书脊 spine.pdf
+% $ Compile.bat all # 生成示例文档 main.pdf 以及书脊 spine.pdf
+% $ Compile.bat wordcount # 统计论文字数
+% $ Compile.bat clean # 删除编译所产生的辅助文件
+% $ Compile.bat cleanall # 删除所有 pdf 文件和所有辅助文件
+% \end{shell}
% \subsection{升级}
% \label{sec:updgrade}
% \hitszthesis\ 升级非常简单,可以通过 \TeX\ 发行版的包管理工具自动更新发行版,
@@ -320,6 +340,13 @@
% \documentclass[infoalign=infoleft]{hitszthesis}
% \end{latex}
%
+% \DescribeOption{mathfont}
+% 论文使用的数学字体。可选:\option{newtxmath},\option{mtpro2},其中\option{newtxmath}为默认选项。推荐使用\option{mtpro2}字体,但是此字体需要额外下载安装。
+% \begin{latex}
+% % 论文采用mtpro2数学字体
+% \documentclass[mathfont=mtpro2]{hitszthesis}
+% \end{latex}
+%
% \subsection{引用方式}
% \label{sec:citestyle}
%
@@ -554,7 +581,7 @@
%
% \section{致谢}
% \label{sec:thanks}
-% 感谢|thuthesis|、|hithesis|、|elegantbook|模板的作者,本模板基于他们改编而来!
+% 感谢|thuthesis|、|hithesis|、|sjtuthesis|、|elegantbook|模板的作者,本模板基于他们改编而来!
%
% 欢迎各位到 \href{http://github.com/YangLaTeX/hitszthesis/}{\hitszthesis\ Github 主页}贡献!
%
@@ -568,7 +595,7 @@
% \begin{macrocode}
%<cls>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<cls>\ProvidesClass{hitszthesis}
-%<cls>[2020/02/18 v2.0 A Bachelor Thesis Template for Harbin Institute of Technology, ShenZhen
+%<cls>[2020/02/23 v2.1 A Bachelor Thesis Template for Harbin Institute of Technology, ShenZhen
%<cls> (HITSZ)]
% \end{macrocode}
%
@@ -2251,10 +2278,10 @@ text centered, draw=black]
}
\def\hitsz@spine{%
\newpage\thispagestyle{empty}%
- \fangsong\addCJKfontfeatures*{RawFeature={vertical:}}
+ \heiti\addCJKfontfeatures*{RawFeature={vertical:}}
\xiaosan\ziju{0.4}%
\noindent\hfill\rotatebox[origin=lt]{-90}{%
- \makebox[\textheight]{\hitsztitle \hfill \hitszauthor}
+ \makebox[\textheight]{本科毕业设计(论文)\hfill \hitsztitle \hfill \hitszauthor}
}
}
% \end{macrocode}
@@ -2398,4 +2425,4 @@ text centered, draw=black]
% mode: doctex
% TeX-master: t
% End:
-% \fi
+% \fi \ No newline at end of file
diff --git a/Master/texmf-dist/source/latex/hitszthesis/hitszthesis.ins b/Master/texmf-dist/source/latex/hitszthesis/hitszthesis.ins
index bdcb66f961d..f3303aab23f 100644
--- a/Master/texmf-dist/source/latex/hitszthesis/hitszthesis.ins
+++ b/Master/texmf-dist/source/latex/hitszthesis/hitszthesis.ins
@@ -54,8 +54,6 @@ through LaTeX.
\Msg{* The recommended directory is TEXMF/tex/latex/hitszthesis}
\Msg{*}
\Msg{* \space\space hitszthesis.cls}
- \Msg{* \space\space hitszthesis-author-year.bst}
- \Msg{* \space\space hitszthesis-numeric.bst}
\Msg{*}
\Msg{* To produce the documentation run the file hitszthesis.dtx}
\Msg{* through LaTeX.}