Skip to content

Commit

Permalink
0.8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
weijianwen committed Jan 8, 2016
2 parents 30ab5ef + ba65feb commit bcccffa
Show file tree
Hide file tree
Showing 6 changed files with 3,880 additions and 3 deletions.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ LATEXMK_OPT = -xelatex -gg -silent -f

all: $(THESIS).pdf

.PHONY : all clean validate view
.PHONY : all clean validate view wordcount

$(THESIS).pdf : $(THESIS).tex $(TEX_DIR)/*.tex $(BIB_DIR)/*.bib sjtuthesis.cls sjtuthesis.cfg Makefile
-latexmk $(LATEXMK_OPT) $(THESIS)
Expand All @@ -20,6 +20,11 @@ validate :
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 -ch-only | awk '/total/ {getline; print "中文字数:",$$4}'

clean :
latexmk -C
-rm *.xdv *.bbl *.fls $(TEX_DIR)/*.xdv $(TEX_DIR)/*.aux $(TEX_DIR)/*.log $(TEX_DIR)/*.fls _tmp_.pdf *.xml
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ SJTUThesis is an *unofficial* XeLaTeX template for preparing bachelor, master, o

* 支持XeTeX的**完整**TeX发行版。2014年以后的[CTeX](http://www.ctex.org/ctexdownload)[TeXLive](https://www.tug.org/texlive/)[MacTeX](https://www.tug.org/mactex/)发行版都能编译此模板。
* TeX Gyre Font西文字体和Adobe四款中文字体:AdobeSongStd、AdobeKaitiStd、AdobeHeitiStd、AdobeFangsongStd。
* Windows用户请使用[Cygwin](http://cygwin.com)安装git和GNUmake工具
* Windows用户请使用[Cygwin](http://cygwin.com)安装如下工具:git(版本控制)、GNUmake(编译控制)、perl(字数统计)

### 获取模板

Expand All @@ -39,6 +39,10 @@ SJTUThesis is an *unofficial* XeLaTeX template for preparing bachelor, master, o

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

### 字数统计

$ make wordcount

### 问题诊断

编译失败时,可以尝试手动逐次编译。
Expand Down
4 changes: 4 additions & 0 deletions sjtuthesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@
\fancyhead[RO]{\nouppercase{\small\kaishu\leftmark}}
\fancyhead[LE]{\nouppercase{\small\kaishu\sjtu@value@titlemark}}
\fancyfoot[C]{\small ---~{\bfseries\thepage}~---}
\renewcommand{\headheight}{32pt}
}
%% 开章页页眉页脚
\fancypagestyle{plain}{
Expand All @@ -403,20 +404,23 @@
\fancyhead[RO]{\nouppercase{\small\kaishu\leftmark}}
\fancyhead[LE]{\nouppercase{\small\kaishu\sjtu@value@titlemark}}
\fancyfoot[C]{\small ---~{\bf\thepage}~---}
\renewcommand{\headheight}{32pt}
}
\else
%% 正文页
\fancypagestyle{main}{
\fancyhead[L]{\small\kaishu\sjtu@value@school\sjtu@value@degree\sjtu@label@thesis}
\fancyhead[R]{\nouppercase{\small\kaishu\leftmark}}
\fancyfoot[C]{\small ---~{\bf\thepage}~---}
\renewcommand{\headheight}{32pt}
}
\fancypagestyle{plain}{
\fancyhf{}
\fancyhead[L]{\nouppercase{\small\kaishu\sjtu@value@school\sjtu@value@degree\sjtu@label@thesis}}
\fancyhead[R]{\nouppercase{\small\kaishu\leftmark}}
% \fancyhead[L]{\small {\it\sjtu@value@titlemark}}
\fancyfoot[C]{\small ---~{\bf\thepage}~---}
\renewcommand{\headheight}{32pt}
}
\fi
\fi
Expand Down
54 changes: 54 additions & 0 deletions tex/app_setup.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
%# -*- coding: utf-8-unix -*-
\chapter{搭建模板编译环境}

\section{安装TeX发行版}

\subsection{Mac OS X}

Mac用户可以从MacTeX主页\footnote{\url{https://tug.org/mactex/}}下载最新安装包。
也可以通过brew包管理器\footnote{\url{http://caskroom.io}}安装MacTeX。

\begin{lstlisting}[basicstyle=\small\ttfamily, numbers=none]
brew cask install mactex
\end{lstlisting}

\subsection{RedHat/CentOS}

建议RedHat/CentOS用户使用TeXLive主页\footnote{\url{https://www.tug.org/texlive/}}的脚本来安装TeXLive发行版。
以下命令将把TeXLive发行版安装到当前用户的家目录下。
若计划安装一个供系统上所有用户使用的TeXLive,请使用root账户操作。

\begin{lstlisting}[basicstyle=\small\ttfamily, numbers=none]
wget http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
tar xzvpf install-tl-unx.tar.gz
cd install-tl-20150411/
./install-tl
\end{lstlisting}

\subsection{Deepin}

建议Deepin用户使用系统自带的包管理器安装TeXLive发行版:

\begin{lstlisting}[basicstyle=\small\ttfamily, numbers=none]
sudo apt-get install update
sudo apt-get install -y upgrade
sudo apt-get install -y texlive-full
\end{lstlisting}

\section{安装中文字体}

\subsection{Mac OS X、Deepin}

Mac和Deepin用户双击字体文件即可安装字体。

\subsection{RedHat/CentOS用户}

RedHat/CentOS用户请先将字体文件复制到字体目录下,调用fc-cache刷新缓存后即可在TeXLive中使用新字体。

\begin{lstlisting}[basicstyle=\small\ttfamily, numbers=none]
mkdir ~/.fonts
cp *.ttf ~/.fonts # 当前用户可用新字体
cp *.ttf /usr/share/fonts/local/ # 所有用户可以使用新字体
fc-cache -f
\end{lstlisting}

Loading

0 comments on commit bcccffa

Please sign in to comment.