Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions NTOU_patch/NTOU_thesis.cls
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
% This class is a patch to base class.
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{NTOU_thesis}[2018/05/27 by sppmg]
% pass no defined option to book class.
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{thesis_base}}
% terminates the option processing.
\ProcessOptions\relax

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% LaTeX tools (before base class)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\RequirePackage{ifthen}
\RequirePackage{xparse}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Load config.tex
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifx\undefined\configured
% --------- Define option for config.tex ----------
\provideboolean{publish} % publish ? Set true before publish. 發怖前設true
\provideboolean{disableChinese} % Disable chinese, for English user.
\provideboolean{printcopyright} % print copyright text on titlepage or cover.
\provideboolean{pdfLinkBoxDisplay} % Draw box on link in the pdf viewer.
\provideboolean{bibStyleNameYear} % bibliography use name,year to sort and cite.
\provideboolean{reallyBlankPage} % Really blank pages between chapters
\provideboolean{tocEntryToToc} % Add TOC entry to TOC
\provideboolean{lofEntryToToc} % Add LOF entry to TOC
\provideboolean{lotEntryToToc} % Add LOT entry to TOC

% --------- Load config.tex ----------
\IfFileExists{./config.tex}{\input{./config.tex}\gdef\configured{}}{} % search only in the current directory use ./file

% Easy check Chinese sitting. It will not disable Chinese font.
% Usage: \ifzh{zh}{non-zh} or \ifzh{zh}
\ProvideDocumentCommand{\ifzh}{+m +G{}}{
\ifthenelse{\NOT \boolean{disableChinese} \AND \equal{\lang}{zh}}{#1}{#2}
}
\fi

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Presetting for NTU
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\ifzh{ % TOC 章級標號形式設定
\gdef\thecontentslabel@chapter{第\zhnumber{\thecontentslabel}章}
\gdef\thecontentslabel@chapter@app{\appendixname\thecontentslabel}
}{
\gdef\thecontentslabel@chapter{\thecontentslabel}
\gdef\thecontentslabel@chapter@app{\thecontentslabel}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Load base class
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\LoadClass{thesis_base}
%%%%% Load additional packages and commands.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Change setting for NTU
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% ---------------------- Chapter title style ---------------------------
\ifzh{
\patchcmd{\@makechapterhead}
{\zhnumber{\thechapter}、\makebox[0.5em]{}}
{第\zhnumber{\thechapter}章\makebox[0.5em]{}}{}{}
}
% ---------------------- Page header ---------------------------
\ifzh{
% \mainmatter
\patchcmd{\chaptermark}
{\zhnumber{\thechapter}、}
{第\zhnumber{\thechapter}章}{}{}
% \appendix
\patchcmd{\chaptermark}
{\thechapter、}
{附錄\thechapter\enspace}{}{}
}

\endinput % this must be the last command.
35 changes: 35 additions & 0 deletions NTOU_patch/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 國立陽明大學 LaTeX 論文樣板(patch)

為了維護方便,陽明版的僅附上與中央版有差異的檔案。請透過內附的 [build](https://github.com/sppmg/TW_Thesis_Template/wiki/%E7%84%A1%E8%85%A6%E6%89%8B%E5%86%8A#patch-%E7%89%88%E5%BB%BA%E7%AB%8B%E6%96%B9%E6%B3%95) 工具建立完整樣板。

## 使用方法
見本專案的 [Wiki](https://github.com/sppmg/TW_Thesis_Template/wiki) 。

或是你想從[無腦手冊](https://github.com/sppmg/TW_Thesis_Template/wiki/%E7%84%A1%E8%85%A6%E6%89%8B%E5%86%8A)開始。

## 論文相關說明

### 書脊
我相信學校附近的影印店比我專業的多 :D ,而且我不知道你做了書脊他們會如何使用。

如果仍然希望自製書脊者,請參考台大版(NTU_patch)的製作方式。


### 書名頁

教務處沒規定要書名頁,但圖書館在添加浮水印的章節寫到:

> 論文 PDF 檔自書名頁閞始至最後一頁,每一頁都需加入浮水印。

我目前決定不加書名頁(封面即書名頁)。若需要分離者,請於 `main.tex` 中的 `\startWatermark` 下一行再貼一次 `\input{titlepage}`


### 浮水印

已附上浮水印。此浮水印是由校方檔案以 GIMP 匯出而成,主要是為了修改錯誤的 exif 資訊。
原始的 exif 會導致 LaTeX 判斷大小錯誤。


[碩博士論文格式製作說明事項](http://reg.web.ym.edu.tw/files/13-1192-3062.php)
[圖書館上傳論文步驟](http://lib.web.ym.edu.tw/files/11-1143-43.php)

41 changes: 41 additions & 0 deletions NTOU_patch/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/sh
# windows use busybox.exe sh build.sh

# University abbreviation from directory name NCU_...
university=$(basename "$(pwd)" | cut -f 1 -d "_")

echo "I will build a integrated template for ${university}, which language you want?"
read -p "zh / en > " lang

if [ ! $lang = "zh" ] && [ ! $lang = "en" ] ; then
echo ERROR: Your input is \"$lang\", but only \"zh\" or \"en\" is valid !
exit 1
fi
if [ ! -d "../NCU_$lang" ] ; then
ERROR: Can\'t find directory \"NCU$lang\"
exit 1
fi
echo "OK, building $lang version"

cp -r ../NCU_$lang ../${university}_$lang
cp -r ./* ../${university}_$lang
cd ../${university}_$lang

# change class name in every file
sed -i '/^\\documentclass/ s/NCU_thesis/'${university}'_thesis/g' $(find -name "*.tex" -type f )

if [ "$lang" = "en" ] ; then
# remove NCU only files.
rm titlepage_en.tex titlepage_zh.tex zh_hidden_warning.tex

sed -i '/lang/ s/zh/en/' config.tex
# Disable Chinese for en avoid no Chinese font
sed -i '/disableChinese/ s/false/true/' config.tex
echo "Default disable Chinese for English template avoid no Chinese font, change setting in config.tex if you need Chinese."
#sed -i '/baseFontSize/ s/14/12/' config.tex
#sed -i '/baseLineStretch/ s/1.3/2/' config.tex
sed -i '/\\printbibliography/ s/title = .*,//' bibliography.tex
fi

rm build.sh build.bat
echo "Finish ! Enjoy ${university}_$lang LaTeX template by sppmg :D"
180 changes: 180 additions & 0 deletions NTOU_patch/config.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
%%%%% build setting | 編譯設定 %%%%%
\setboolean{publish}{false} % {true}/{false} Set true before publish. 發佈前設true
\def\lang{zh} % {zh}/{en} Set main language.
\setboolean{disableChinese}{false} % {true}/{false} Disable Chinese, for English user who don't have Chinese fonts.

\synctex=1 % Enable SyncTeX.


%%%%% Information of your document. | 定義文件資訊 %%%%%
\def\deptshort {物理}
\def\deptZh {物理研究所}
\def\deptEn {Department of Physics}
\def\deptspace {物~理}
\def\collegeEn {Electrical Engineering and Computer Science}
\def\degree {碩士} % 碩士/博士
\def\degreeEn {Master} % Master/Doctor
\def\degreespace {碩~士~論~文} % 碩士/博士
\def\thesisType{Master Thesis} % Master Thesis/Doctoral Dissertation
\def\titleZh {海洋大學LaTeX論文樣板(中文)} % Chinese title
\def\titleEn {NTOU LaTeX Thesis Template(Chinese)} % English title
\def\title {\titleZh} % Main title, default Chinese title
\def\subtitle {\titleEn} % Subtitle, default English title, empty allowed.
\def\logo {} % logo on titlepage. Watermark see below. 中央無校徽在封面。若你想加,樣板已附上,填入 ``logo-NCU.jpg'' 即可
\def\authorZh {君の名は。}
\def\authorEn {Your Name.}
\def\author {\authorZh} % Choose one When only use one name.(book spine using.)
% \profs is professor's comma separated list. First is advisor , comma use ``{,}''
\def\profsZh {你的指導教授, 你的共同指導, 英文逗號示範}
\def\profsEn {Your advisor, Committee member, ZUO{,} GONG-DE}
\def\degreedateROC{中華民國~{107}~年~6~月}
\def\degreedateAD {June 2018}
\def\copyyear {2012-2013}

\setboolean{printcopyright}{false} % {true}/{false} print copyright text on titlepage or cover.

\def\keywordsZh{關鍵字, 論文, 樣板, 讓我畢業}
\def\keywordsEn{Keyword, Thesis, Template, Graduate me}


%%%%% Set letters filename | 設定插入文件 %%%%%
% This setting for main.tex default letters.
% It will not insert PDF if file non-exist or empty .
% 此為 main.tex 預設插入之 PDF,檔案不存在或空白則不插入。

% 碩博士論文電子檔授權書 Authorization Letter (for electronic)
\def\letterAuthEl{letter_authorization.pdf}
% 碩博士紙本論文延後公開/下架申請書。(如需延後公開者,才需要裝訂於論文內頁)
\def\letterPubReq{letter_publication_request.pdf}
% 指導教授推薦書
\def\letterRecom {letter_recommendation.pdf}
% 口試委員審定書
\def\letterVerif {letter_verification.pdf}


%%%%% Bibliography | 文獻列表 %%%%%
\def\bibManType{2} % {0}/{1}/{2} 0 = Embedded, 1 = BibTeX, 2 = biber / BibLaTeX
\def\bibStyle{ieee} % Default ``ieee'' with BibLaTeX. If you use BibTeX change to ``ieeetr''.
% BibLaTeX ref: https://www.sharelatex.com/learn/Biblatex_bibliography_styles
% BibTeX ref: https://www.sharelatex.com/learn/Bibtex_bibliography_styles
\setboolean{bibStyleNameYear}{false} % {true}/{false} true for use name,year to sort and cite.(If you want use custom option in .cls, set false here. )


%%%%% Set OS | 設定作業系統 %%%%%
% It will overwrite \OS if your LaTeX compile parameter has ``-shell-escape''(Texstudio default enable).
% Linux user: keep setting or add ``-shell-escape'' to compiler.
% Mac OS X user: Set to mac or add ``-shell-escape'' to compiler.
% Windows user: Don't need change setting.
\def\OS{linux} % {linux}/{mac}/{win}, only effect auto select CJK font.(CJK means Chinese, Japanese, and Korean)


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Font size or style | 字體大小、風格
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%% Set font | 設定中英文字型 %%%%%
% Keep empty for default font. CJK font must set OS for auto select.
% Setting by name of font(English will be better) or font filename.
% Linux 利用指令 fc-list :lang=zh 來查詢可以用的字體名稱。
% Windows 使用內建字型管理查詢。建議填英文字型名稱。
\def\mainfont {} % default use Latin Modern Roman (lmodern pkg.)
\def\sansfont {}
\def\monofont {}
\def\CJKmainfont{}
\def\CJKsansfont{}
\def\CJKmonofont{}


%%%%% Style of fonts and line stretch | 字體大小風格及行距 %%%%%
% Base font
\def\baseFontSize{14pt} % Valid: 8pt, 9pt, 10pt, 11pt, 12pt, 14pt, 17pt, 20pt
\def\baseLineStretch{1.5} % 行距(倍數)
\def\fakeBoldFactor{2} % 假粗體粗度。(Only affect CJK font.)
% Bibliography
\def\bibFontStyle{\small}
\def\bibLineStretch{1.2}
% Table
\def\floatFontStyle{\small} % content of table
\def\tableLineStretch{1.2}
% Caption
\def\captionFontStyle{\small}
\def\subcaptionFontStyle{\footnotesize}
\def\captionLineStretch{1.2}
% Page
\def\pageHeaderStyle{\sffamily\itshape\footnotesize}
\def\pageFooterStyle{\sffamily\footnotesize}
% listing font style set by basicstyle in \lstdefinestyle, see macro_preamble.tex
% todonotes font style set by textsize option when package loading, see thesis_base.cls . default \footnotesize


%%%%% Style of titles | 標題風格 %%%%%
\def\titlepageFontFamily{\rmfamily\CJKfamily{sf}}
% set "\rmfamily\CJKfamily{sf}" to mix rm for English and sf(default Kai) for CJK, see wiki on TW_Thesis_Template.
\def\abstractHeaderStyle{\sffamily\Large} % Information on abstract, cls default use \centering

\def\chapterTitleNumStyle {\sffamily\LARGE\bfseries} % Number of chapter, only for en
\def\chapterTitleStyle {\sffamily\huge\bfseries} % cls default use \centering for zh
\def\sectionTitleStyle {\sffamily\Large\bfseries}
\def\subsectionTitleStyle {\sffamily\large\bfseries}
\def\subsubsectionTitleStyle{\sffamily\normalsize\bfseries}
\def\paragraphTitleStyle {\sffamily\normalsize\bfseries}
\def\subparagraphTitleStyle {\sffamily\normalsize\bfseries}

% Section numbering
\def\secNumDepth{4} % Depth of section Numbering. 設定章節標題給予數字標號的深度, \paragraph == 4
\def\titleNumStyle{0} % 0/1
\def\indentBlockSSS{0mm} % indent \subsubsection{}
\def\indentBlockPar{0mm} % indent \paragraph{}
\def\indentBlockSPar{0mm} % indent \subparagraph{}


%%%%% Style of TOC | 目錄風格 %%%%%
\def\tocDepth{2} % Depth of TOC. 目錄顯示層級,\subsection == 2
\def\tocStyleAlign{0} % 0/1 see tutorial. (0 -> original)
\def\tocStyleChapter{1} % 0/1/2
\def\tocStyleChapterFontFM{} % {\itshape} etc. TOC chapter addition style to frontmatter. Only affect in \tocStyleChapter{1} .


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Pages style | 頁面風格
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%% Watermark | 浮水印 %%%%%
% Add a watermark to every page after \startWatermark .
% It will search (image) filename in figures folder.

% Package (\wmMethod) bug / disadvantages:
% background: Background failed in all \includepdf page. Keep for compatibility.
% eso-pic: No, but still failed in some \includepdf page.
\def\wmContent{ntou_logo.gif} % 圖檔名或文字 | image filename or text.
\def\wmMethod{1} % {0}/{1} 0 == background pkg. , 1 == eso-pic pkg. Recommend eso-pic
\def\wmScale{1} % 縮放比
\def\wmOpacity{1} % 透明度
\def\wmShiftFromCenterX{0mm} % 圖片中心相對紙張中心垂直位移
\def\wmShiftFromCenterY{0mm} % 圖片中心相對紙張中心水平位移
\def\wmAngle{0} % 旋轉角度

% Start page:
% 0 == Manually, start at \startWatermark .
% 1 == Auto start at 1st physical page(include cover/titlepage).
% 2 == Auto start at 2nd physical page(include cover/titlepage).
% note: {1}/{2} request set ``publish'' (at line 2) to display.
\def\wmStartPage{2} % {0}/{1}/{2}

%%%%% Really blank page | 純白空白頁 %%%%%
\setboolean{reallyBlankPage}{false} % {true}/{false} true for use really blank pages between chapters.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Misc | 雜項
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%% TOC (Table Of Contents) | 目錄 %%%%%
% Add TOC/LOF/LOT entry to TOC
\setboolean{tocEntryToToc}{true} % {true}/{false}, Table Of Contents
\setboolean{lofEntryToToc}{false} % {true}/{false}, List Of Figures
\setboolean{lotEntryToToc}{false} % {true}/{false}, List Of Tables


%%%%% PDF %%%%%
\setboolean{pdfLinkBoxDisplay}{true} % {true}/{false} ,Draw a box on the link. It only display in pdf viewer, not on paper.
Loading