Skip to content

Commit

Permalink
Several little fixes before v0.10. (#254)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexaraWu authored and gaocegege committed Jan 9, 2018
1 parent 0ee4014 commit b4c3202
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 32 deletions.
14 changes: 9 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ LATEXMK_OPT_PVC = $(LATEXMK_OPT_BASE) -pvc

all: $(THESIS).pdf

.PHONY : all clean pvc view wordcount git zip
.PHONY : all cleanall pvc view wordcount git zip

$(THESIS).pdf : $(THESIS).tex $(TEX_DIR)/*.tex $(BIB_DIR)/*.bib sjtuthesis.cls sjtuthesis.cfg Makefile
-latexmk $(LATEXMK_OPT) $(THESIS)
Expand All @@ -26,13 +26,17 @@ view : $(THESIS).pdf
open $<

wordcount:
@perl texcount.pl $(THESIS).tex -inc | awk '/total/ {getline; print "词数 :",$$4}'
@perl texcount.pl $(THESIS).tex -inc -char | awk '/total/ {getline; print "字符数 :",$$4}'
@perl texcount.pl $(THESIS).tex -inc | awk '/total/ {getline; print "词数  :",$$4}'
@perl texcount.pl $(THESIS).tex -inc -char | awk '/total/ {getline; print "字符数 :",$$4}'
@perl texcount.pl $(THESIS).tex -inc -ch-only | awk '/total/ {getline; print "中文字数:",$$4}'

clean :
latexmk -C
-@rm -f *.xdv *.bbl *.fls $(TEX_DIR)/*.xdv $(TEX_DIR)/*.aux $(TEX_DIR)/*.log $(TEX_DIR)/*.fls _tmp_.pdf *.xml 2> /dev/null || true
-@latexmk -c -silent 2> /dev/null
-@rm -f $(TEX_DIR)/*.aux 2> /dev/null || true

cleanall :
-@latexmk -C -silent 2> /dev/null
-@rm -f $(TEX_DIR)/*.aux 2> /dev/null || true

s3 : $(THESIS).pdf
s3cmd put $< s3://sjtuthesis/README.pdf
Expand Down
34 changes: 23 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,19 @@ SJTUThesis 由 [CTeX](https://www.ctan.org/pkg/ctex?lang=en) 宏集提供中文

#### 终端中克隆最新版

cd
git clone https://github.com/sjtug/SJTUThesis.git
```shell
git clone https://github.com/sjtug/SJTUThesis.git
```

如果之前有克隆过此模板但是想与 GitHub 上的最新版本同步,以`master`分支为例,执行以下命令更新到最新版。

git pull origin master
```shell
git pull origin master
```

若是自己 fork 后克隆下来的,则执行以下命令。
```

```shell
git pull upstream master
```

Expand All @@ -60,11 +64,15 @@ SJTUThesis提供了多个稳定版供您使用,这些版本的输出结果具

编译模板,生成学位论文PDF文件。GNUMake将调用`latexmk`程序,自动完成模板的多轮编译。

make pvc
```shell
make pvc
```

定稿后可使用以下命令生成最终版本。

make clean thesis.pdf
```shell
make cleanall thesis.pdf
```

若需要生成用于提交盲审的论文(隐去作者、导师等信息),可在`thesis.tex`中为`sjtuthesis`文档类添加`review`选项。 若需要生成包含“原创性声明扫描件”和“授权书”签名扫描件的学位论文,请将扫描件分别保存为`pdf/origignal.pdf``pdf/authorization.pdf`,然后添加`submit`选项重新编译模板。

Expand All @@ -74,17 +82,21 @@ SJTUThesis提供了多个稳定版供您使用,这些版本的输出结果具

### 字数统计

make wordcount
```shell
make wordcount
```

### 问题诊断

编译失败时,可以尝试手动逐次编译。
结合文档 [README.pdf][README] 中的说明,有助于定位故障。

xelatex -no-pdf thesis
biber --debug thesis
xelatex thesis
xelatex thesis
```shell
xelatex -no-pdf thesis
biber --debug thesis
xelatex thesis
xelatex thesis
```

## ShareLaTeX

Expand Down
30 changes: 15 additions & 15 deletions compile.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,26 @@ if %flag%x == x (
)

if %flag%x == thesisx (
call:cleanall
call:thesis
call :cleanall
call :thesis
if ERRORLEVEL 1 (
echo Error! Please check the 'thesis.log' for more details...
pause
) else (
call:clean
call :clean
echo Finished!
)
goto:EOF
goto :EOF
)

if %flag%x == cleanx (
call:clean
goto:EOF
call :clean
goto :EOF
)

if %flag%x == cleanallx (
call:cleanall
goto:EOF
call :cleanall
goto :EOF
)

:help
Expand All @@ -38,26 +38,26 @@ if %flag%x == cleanallx (
echo clean Clean all work files
echo cleanall Clean all work files and thesis.pdf
echo help Print this help message
goto:EOF
goto :EOF

:thesis
echo Compile...
latexmk -xelatex -halt-on-error -silent thesis >nul 2>nul
goto:EOF
goto :EOF

:clean
echo Clean files...
latexmk -c -silent
latexmk -c -silent 2>nul
del tex\*.aux >nul 2>nul
goto:EOF
goto :EOF

:cleanall
echo Clean files...
latexmk -C -silent
latexmk -C -silent 2>nul
del tex\*.aux >nul 2>nul
if exist thesis.pdf (
echo Close the file: thesis.pdf!
pause
call:cleanall
call :cleanall
)
goto:EOF
goto :EOF
2 changes: 1 addition & 1 deletion tex/example.tex
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ \section{参考文献管理}
\end{lstlisting}

按照教务处的要求,参考文献外观应符合国标GBT7714的要求\footnote{\url{http://www.cces.net.cn/guild/sites/tmxb/Files/19798_2.pdf}}。
在模板中,表现形式的控制逻辑通过bibla­tex-gb7714-2015包实现\footnote{\url{https://www.ctan.org/pkg/biblatex-gb7714-2015}},基于{Bib\LaTeX}管理文献。在目前的多数TeX发行版中,可能都没有默认包含biblatex-gb7714-2015,需要手动安装。
在模板中,表现形式的控制逻辑通过biblatex-gb7714-2015包实现\footnote{\url{https://www.ctan.org/pkg/biblatex-gb7714-2015}},基于{Bib\LaTeX}管理文献。在目前的多数TeX发行版中,可能都没有默认包含biblatex-gb7714-2015,需要手动安装。

正文中引用参考文献时,用\verb+\cite{key1,key2,key3...}+可以产生“上标引用的参考文献”,
\cite{Meta_CN,chen2007act,DPMG}。
Expand Down

0 comments on commit b4c3202

Please sign in to comment.