Skip to content

Commit

Permalink
[enhancement] Split sample from original repo (sjtug#462)
Browse files Browse the repository at this point in the history
* Split sample from original repo.

* Bundle `biblatex-gb7714-2015' within the sample.

* Apply the Apache License. [ci skip]

* Update README.md [ci skip]

* [enhancement] simplify file structure

* [enhancement] update README.md & move cls to src/

* Revert commits d5e7021 and a2887a3. [ci skip]

Revert "[enhancement] update README.md & move cls to src/"

This reverts commit d5e7021.

Revert "[enhancement] simplify file structure"

This reverts commit a2887a3.

* README: Update [ci skip]

* README: Update [ci skip]

* README: Update [ci skip]

* Update compile scripts.

* README: Update [ci skip]

* README: Update [ci skip]
  • Loading branch information
AlexaraWu authored Nov 29, 2019
1 parent 2f1bda5 commit 9ced8b6
Show file tree
Hide file tree
Showing 50 changed files with 5,570 additions and 3,254 deletions.
6 changes: 0 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,5 @@ ehthumbs_vista.db
[Dd]esktop.ini

# Project specific
release/*
sample/*.pdf
*.cls
*.ins
*.ltx
sjtuthesis.pdf
thesis.pdf
thesis-bot.yml
9 changes: 0 additions & 9 deletions source/latexmkrc.pl → .latexmkrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,3 @@

# Files to clean.
$clean_ext = 'bbl glo gls hd loa run.xml thm xdv';

# Process index.
$makeindex = 'makeindex -s gind.ist %O -o %D %S';

# Process glossary (change history).
add_cus_dep('glo', 'gls', 0, 'makeglo2gls');
sub makeglo2gls {
system("makeindex -q -s gglo.ist -o '$_[0].gls' '$_[0].glo'");
}
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ matrix:
- $HOME/.miktex

before_script:
- source scripts/unpack.sh
- sed -i 's/documentclass\[/documentclass[fontset=fandol, /' sample/thesis.tex
- sed -i 's/documentclass\[/documentclass[fontset=fandol, /' thesis.tex

script:
- latexmk -cd -quiet -halt-on-error -time -xelatex sample/thesis.tex
- latexmk -quiet -halt-on-error -time -xelatex thesis.tex

after_failure:
- cat sample/thesis.log
- cat thesis.log
210 changes: 105 additions & 105 deletions source/sample.bat → Compile.bat
Original file line number Diff line number Diff line change
@@ -1,105 +1,105 @@
@echo off
chcp 65001 >nul

set THESIS=thesis

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 'thesis.log' for more details...
pause
) else (
call :clean
echo Finished!
)
goto :EOF
)

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

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

if %flag%x == wordcountx (
call :wordcount
goto :EOF
)

:help
echo This is the compile batch script for SJTUThesis.
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 thesis.pdf
echo wordcount Count words in thesis.pdf
echo help Print this help message
goto :EOF

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

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

:cleanall
echo Clean files...
latexmk -C -silent 2>nul
del tex\*.aux >nul 2>nul
if exist thesis.pdf (
echo Close the file: thesis.pdf!
pause
call :cleanall
)
goto :EOF

:wordcount
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
@echo off
chcp 65001 >nul

set THESIS=thesis

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 'thesis.log' for more details...
pause
) else (
call :clean
echo Finished!
)
goto :EOF
)

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

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

if %flag%x == wordcountx (
call :wordcount
goto :EOF
)

:help
echo This is the compile batch script for SJTUThesis.
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 thesis.pdf
echo wordcount Count words in thesis.pdf
echo help Print this help message
goto :EOF

:thesis
echo Compile...
latexmk -xelatex -quiet -file-line-error -halt-on-error -interaction=nonstopmode thesis >nul 2>nul
goto :EOF

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

:cleanall
echo Clean files...
latexmk -C -silent 2>nul
del tex\*.aux >nul 2>nul
if exist thesis.pdf (
echo Close the file: thesis.pdf!
pause
call :cleanall
)
goto :EOF

:wordcount
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
Loading

0 comments on commit 9ced8b6

Please sign in to comment.