Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %註解的符號是'%',該行之後所有文字皆會被當成註解,不會被TeX編譯,是個重要的功能
- %單次課程的講義可用article
- \documentclass[12pt, a4paper]{report}
- %%% 引入Package %%%
- \usepackage{fontspec} % 加這個就可以設定字體
- \usepackage{type1cm} % 設定fontsize用
- \usepackage[margin=3cm]{geometry} % 上下左右距離邊緣3cm
- \usepackage{amsmath,amsthm,amssymb} % 引入 AMS 數學環境
- \usepackage{yhmath} % math symbol
- \usepackage{graphicx} % 圖形插入用
- \usepackage[usenames, dvipsnames]{color} % 可以使用顏色
- \usepackage[unicode=true, bookmarksdepth=-1]{hyperref} % 超連結
- \usepackage{tabularx} % 加強版 table
- \usepackage{enumerate} % 加強版 enumerate
- %%% 中文環境 %%%
- \usepackage{xeCJK} % 讓中英文字體分開設置
- % 設定中文為系統上的字型,而英文不去更動,使用原TeX字型。
- % 不同作業系統的字型名稱可能不同,請留意。
- \setCJKmainfont[AutoFakeBold=3,AutoFakeSlant=.4]{標楷體}
- \defaultCJKfontfeatures{AutoFakeBold=3,AutoFakeSlant=.4}
- \newCJKfontfamily\Kai{標楷體}
- \newCJKfontfamily\Hei{微軟正黑體}
- \newCJKfontfamily\NewMing{新細明體}
- % 這兩行一定要加,中文才能自動換行
- \XeTeXlinebreaklocale "zh"
- \XeTeXlinebreakskip = 0pt plus 1pt
- %%% 頁面設定 %%%
- \usepackage{fancyhdr} % 頁首頁尾
- \usepackage{titlesec} % 設定section等的字體
- \usepackage{titling} % 加強 title 功能
- \usepackage{lastpage} % 辨識文章總頁數
- \setlength{\headheight}{15pt} %with titling
- \setlength{\droptitle}{-1.5cm} %title 與上緣的間距
- \parindent=24pt %設定縮排的距離
- %\parskip=1ex %設定行距
- %% 自定義頁面格式,可改成自己喜愛的配置 %%
- \fancypagestyle{std}{
- \fancyhead[L]{Section \rightmark} % 頁首左
- \fancyhead[C]{} % 頁首中
- \fancyhead[R]{資訊超讀書會} % 頁首右
- \fancyfoot[L]{Author:~\theauthor} % 頁腳左
- \fancyfoot[C]{} % 頁腳中
- \fancyfoot[R]{Page \thepage\ of \pageref{LastPage}} % 頁腳右
- \renewcommand{\headrulewidth}{0.4pt} % 頁首分隔線
- \renewcommand{\footrulewidth}{0.4pt} % 頁腳分隔線
- }
- \pagestyle{std} % 設定除了第一頁外的頁面格式
- \titleformat{\chapter}[block]
- {\thispagestyle{std}\normalfont\huge\bfseries\centering}{\thechapter.}{1em}{\Huge}
- \titlespacing*{\chapter}{0pt}{-19pt}{0pt}
- %%% 設定theorem, problem等的環境 %%%
- %% 自定義Style改用粗體,預設 remark style 是斜體 %%
- \newtheoremstyle{std}
- {10pt}{16pt} % 上下間距
- {} % 內文字體
- {} % 縮排
- {\bf} % 標頭字體
- {.} % 標頭後標點
- {1em} % 內文與標頭距離
- {} % 標頭規格
- \theoremstyle{std} % 設定環境Style
- %% Problem, theorem等的宣告 %%
- \newtheorem{ex}{Example}
- \newtheorem{pr}{Problem}
- \newtheorem{df}{Definition}
- \newtheorem{thr}{Theorem}
- %% Custom Hyperlink %%
- \newcommand{\HREF}[2]{\textbf{\underline{\color{blue}{\href{#1}{#2}}}}}
- \newcommand{\rawHREF}[1]{\texttt{\underline{\href{#1}{#1}}}}
- %%% C++ code listing %%%
- \usepackage{listings}
- \definecolor{dkgreen}{rgb}{0,0.6,0}
- \definecolor{gray}{rgb}{0.5,0.5,0.5}
- \definecolor{mauve}{rgb}{0.58,0,0.82}
- \lstset{frame=tb,
- language=C++,
- aboveskip=3mm,
- belowskip=3mm,
- showstringspaces=false,
- columns=flexible,
- basicstyle={\small\ttfamily},
- numbers=left,
- numberstyle=\tiny\color{gray},
- keywordstyle=\color{blue},
- commentstyle=\color{dkgreen},
- stringstyle=\color{mauve},
- breaklines=true,
- breakatwhitespace=true,
- tabsize=4
- }
- \newcommand{\cppcode}{\lstinputlisting[language=C++]}
- %%% 以上為主要不動處 %%%
- \title{這是模板}
- \author{我是作者}
- \date{\today} %可不加日期
- \begin{document}
- \maketitle % 顯示標題
- \thispagestyle{std} %使用fancyhdr(預設第一頁不會使用)
- %%% 引入內容檔案 %%%
- \input{content}
- %%%%%%%%%%%%%%%%%%
- \end{document}
Advertisement
Add Comment
Please, Sign In to add comment