aboutsummaryrefslogtreecommitdiffstats
path: root/LaTex
diff options
context:
space:
mode:
authorcathook <b01902109@csie.ntu.edu.tw>2014-06-01 13:56:57 +0800
committercathook <b01902109@csie.ntu.edu.tw>2014-06-01 13:56:57 +0800
commitd5052f1c296dddf51b3e83d59bf3e3c1952cb2d0 (patch)
tree16f7920c5079e0aefcf9509d2dbab59c464d42bd /LaTex
parentbd58f63900410ec4764031f2e6de2d75e91434b3 (diff)
downloadmeow-d5052f1c296dddf51b3e83d59bf3e3c1952cb2d0.tar
meow-d5052f1c296dddf51b3e83d59bf3e3c1952cb2d0.tar.gz
meow-d5052f1c296dddf51b3e83d59bf3e3c1952cb2d0.tar.bz2
meow-d5052f1c296dddf51b3e83d59bf3e3c1952cb2d0.tar.lz
meow-d5052f1c296dddf51b3e83d59bf3e3c1952cb2d0.tar.xz
meow-d5052f1c296dddf51b3e83d59bf3e3c1952cb2d0.tar.zst
meow-d5052f1c296dddf51b3e83d59bf3e3c1952cb2d0.zip
big chnage
Diffstat (limited to 'LaTex')
-rw-r--r--LaTex/!readme.asciidoc26
-rw-r--r--LaTex/Makefile32
-rw-r--r--LaTex/source.tex237
3 files changed, 295 insertions, 0 deletions
diff --git a/LaTex/!readme.asciidoc b/LaTex/!readme.asciidoc
new file mode 100644
index 0000000..af51bda
--- /dev/null
+++ b/LaTex/!readme.asciidoc
@@ -0,0 +1,26 @@
+
+
+LaTex 相關模板
+
+===== Makefile
+
+環境變數:
+
+* `SOURCE = source.tex` 設定 'LaTex' 源碼檔名
+* `TARGET = output` 設定生出來的 *pdf* 檔名
+
+[NOTE]
+`TARGET` 不需要給副檔名
+
+targets:
+
+* `all` 生成 *'<TARGET>'.pdf*
+* `view` 用kde-open 把輸出結果開起來(如有需要會先重新編譯)
+* `clean` 清除
+* `two` 編譯兩次, 如果有目錄的話可能會需要用到
+
+===== source.tex
+
+內容為一些我自己定義的設定, 參數設置等等. 另外還有用寫在註解裡面的小筆記
+
+
diff --git a/LaTex/Makefile b/LaTex/Makefile
new file mode 100644
index 0000000..b0fd0da
--- /dev/null
+++ b/LaTex/Makefile
@@ -0,0 +1,32 @@
+SOURCE = source.tex
+TARGET = output
+
+
+##################################################
+
+FLAGS=-interaction=nonstopmode -jobname=$(TARGET)
+
+OUTFILE_PDF=$(TARGET).pdf
+OUTFILE_LOG=$(TARGET).log
+OUTFILE_AUX=$(TARGET).aux
+
+##################################################
+
+.PHONY: all view clean
+
+all: $(OUTFILE_PDF)
+
+view: $(OUTFILE_PDF)
+ kde-open $(OUTFILE_PDF)
+
+clean:
+ -rm $(OUTFILE_PDF)
+ -rm $(OUTFILE_LOG)
+ -rm $(OUTFILE_AUX)
+
+$(OUTFILE_PDF): $(SOURCE)
+ xelatex $(FLAGS) $(SOURCE)
+
+two: $(SOURCE)
+ xelatex $(FLAGS) $(SOURCE)
+ xelatex $(FLAGS) $(SOURCE)
diff --git a/LaTex/source.tex b/LaTex/source.tex
new file mode 100644
index 0000000..cb189ec
--- /dev/null
+++ b/LaTex/source.tex
@@ -0,0 +1,237 @@
+\documentclass{article}
+
+%%%%%%%%%%%%%%%%% **# chinese setting #** %%%%%%%%%%%%%%%%%%
+\usepackage{fontspec}
+\usepackage{xeCJK} %讓中英文字體分開設置
+\defaultCJKfontfeatures{AutoFakeBold=6,AutoFakeSlant=.4} %以後不用再設定粗斜
+\XeTeXlinebreaklocale "zh" %這兩行一定要加
+\XeTeXlinebreakskip = 0pt plus 1pt %中文才能自動換
+\newCJKfontfamily{\Kai}{標楷體}
+\newCJKfontfamily{\Hei}{微軟正黑體}
+\newCJKfontfamily{\Wen}{文泉驛等寬正黑}
+\setCJKmainfont{文泉驛等寬正黑}
+
+%%%%%%%%%%%%%%%%%% **# border, indent #** %%%%%%%%%%%%%%%%%%
+\usepackage{geometry}
+\geometry{a4paper}
+\geometry{left=1.7cm, right=1.7cm, top=2cm, bottom=2cm}
+\linespread{1}
+\setlength{\parskip }{0.5em}
+\setlength{\parindent }{ 2em}
+
+%%%%%%%%%%%%%%%%%% **# header, footer #** %%%%%%%%%%%%%%%%%%
+\usepackage{fancyhdr}
+\usepackage{lastpage}
+\pagestyle{fancy} % plain / empty / headings / myheadings / fancy
+\pagenumbering{arabic} % arabic / roman / Roman / alph / Alph
+\fancyhead[LE,LO]{資工二}
+\fancyhead[CE,CO]{B01902109}
+\fancyhead[RE,RO]{洪湧}
+\fancyfoot[LE,LO]{}
+\fancyfoot[CE,CO]{Page~\thepage ~of~\pageref*{LastPage}}
+\fancyfoot[RE,RO]{}
+\renewcommand{\headrulewidth}{0.5pt}
+\renewcommand{\footrulewidth}{0pt}
+
+%%%%%%%%%%%%%%% **# title format & spacing #** %%%%%%%%%%%%%
+\usepackage[sf]{titlesec}
+\titleformat{\section }[hang]{\large}{\textbf{Problem\ \thesection}}{0em}{}{}
+\titleformat{\subsection}[hang]{ }{\thesubsection .}{1em}{}{}
+
+\usepackage{chngcntr}
+\renewcommand{\thesubsection}{\alph{subsection}}
+
+%%%%%%%%%%%%%%%%%% **# multi columns #** %%%%%%%%%%%%%%%%%%%
+\usepackage{multicol}
+\setlength{\columnsep }{30pt}
+\setlength{\columnseprule}{0.5pt}
+
+%%%%%%%%%%%%%%%%%%% **# table of content #** %%%%%%%%%%%%%%%
+\usepackage{tocloft}
+\renewcommand{\cftsecleader }{\cftdotfill{\cftdotsep}}
+
+%%%%%%%%%%%%%%%%%%%% **# mathematics #** %%%%%%%%%%%%%%%%%%%
+\usepackage{amsmath, amsthm, amssymb}
+
+\theoremstyle{definition}
+\newtheorem*{defi}{Definition}
+
+\theoremstyle{plain}
+\newtheorem{thm}{Theorem}
+\newtheorem{cor}[thm]{Corollary}
+\newtheorem{lemma}[thm]{Lemma}
+
+%%%%%%%%%%%%%%%%%%%%% **# algorithm #** %%%%%%%%%%%%%%%%%%%%
+\usepackage{algorithmicx}
+\usepackage{algorithm}
+\usepackage{algc}
+\usepackage{algcompatible}
+\usepackage[noend]{algpseudocode}
+
+%%%%%%%%%%%%%%%%%%%%%%% **# etc #** %%%%%%%%%%%%%%%%%%%%%%%%
+\usepackage{listings}
+\usepackage{url}
+\usepackage{hyperref}
+\hypersetup{
+ bookmarks = true,
+ unicode = true,
+ colorlinks = true,
+ linkcolor = blue
+ linkcolor = blue,
+ urlcolor = blue,
+ citecolor = blue,
+ anchorcolor = blue
+}
+
+%%%%%%%%%%%%%%%%%% **# custom commands #** %%%%%%%%%%%%%%%%%
+\newcommand{\Indent}[2]{\parindent=#1 \leftskip=#2}
+\newcommand{\Usesize}[2]{\fontsize{#1}{#2}\selectfont \fontsize{#1}{#2}\selectfont}
+\newcommand{\lstsetCPP}[0]{\lstset{
+ basicstyle=\small, % font size
+ breakatwhitespace=false, % automatic breaks only happen at whitespace
+ breaklines=true, % automatic line breaking
+ captionpos=b, % caption-position to bottom
+ escapeinside={\%*}{*)}, % if you want to add LaTeX within your code
+ extendedchars=true, % lets you use non-ASCII characters; for 8-bits encodings only, does not work with UTF-8
+ frame=single, % adds a frame around the code
+ keepspaces=true, % keeps spaces in text, useful for keeping indentation of code (possibly needs columns=flexible)
+ language=C++, % the language of the code
+ numbers=left, % where to put the line-numbers; (none, left, right)
+ numbersep=4pt, % how far the line-numbers are from the code
+ showspaces=false, % show spaces everywhere adding particular underscores; it overrides 'showstringspaces'
+ showstringspaces=false, % underline spaces within strings only
+ showtabs=false, % show tabs within strings adding particular underscores
+ stepnumber=1, % the step between two line-numbers.
+ tabsize=4, % tabsize
+}}
+\newcommand{\LineIf}[2]{\State \algorithmicif\ {#1}\ \algorithmicthen\ {#2}}
+
+%%%%%%%%%%%%%%%%%%%%%%%%% **# 本文 #** %%%%%%%%%%%%%%%%%%%
+
+\begin{document}
+\Indent{0em}{3em}
+hi!
+\Kai
+啦啦\textbf{啦}
+
+\Indent{0em}{5em}
+啦啦\textbf{啦}aaaaaaaaaaaaa b c xxx
+xxxxxxxxxxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+xxxxxxxxxxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+xxxxxxxxxxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+xxxxxxxxxxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+xxxxxxxxxxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+\\
+
+
+\Indent{0em}{7em}
+ \begin{itemize}
+\Indent{0em}{7em}
+ \itemsep = 0em
+ \item b
+xxxxxxxxxxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+xxxxxxxxxxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+xxxxxxxxxxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+xxxxxxxxxxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+ \end{itemize}
+
+
+
+
+啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦 啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦 啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦 啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦 啦啦啦啦啦啦啦啦啦啦啦啦啦啦
+
+啦啦\textbf{啦}aaaaaaaaaaaaa b c xxx
+xxxxxxxxxxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+xxxxxxxxxxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+xxxxxxxxxxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+xxxxxxxxxxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
+x
+\end{document}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% \newtheorem{thm}{Theorm} 定理
+% \newtheorem{thm}{Theorm}[section] 加入節...?
+% \newtheorem{lem}[thm]{Lemma} 和定理一起編號
+% \newtheorem*{mainthm}{Main Theorem} 不要編號
+% \begin{thm}\label{T:major} ... \ref{T:major} 用label, 引用
+% \begin{array}{clr} ... & ... \\ 矩陣用
+% \begin{align}
+
+%titleformat{command}[shape]{format}{label}{sep}{before}[after]
+% command: 要定義的標題
+% shape : 形狀 hang|block|display
+% format : 標題外觀(至中對齊啦, 粗體啦...)
+% label : 標籤(標號)
+% sep : 標題標籤與內容之間的間隔
+% befor : 內容之前
+% after : 內容之後
+
+%titlespacing{command}{left}{before}{after}
+% command: 要定義的標題
+% left : 標題左邊偏移
+% before : 與前一段文字間隔
+% after : 與後一段文字間隔
+
+% \setcounter{secnumdepth}{3} 自己定義要標號到多深
+% -1 part, 0~5 ch, se, subse, subsubse, par, subpar
+
+%%%%%%%%%%%%%%%%%%%% 筆記區 %%%%%%%%%%%%%%%%%%%%%%
+% ~ & 空白 表格中的分隔
+% \, \: \; \quad \qquad \hspace{2cm} 小中大空白
+% \smallskip \medskip \bigskip \vspace{2cm} 垂直移動3, 6, 12, 自訂
+% \hfill, \vfill 平均的塞入 水平/垂直 空間
+% \dotfill \hrulefill 塞 點/線 進去
+% \tiny \small \large \Large \LARGE \huge \Huge 字體大小
+% \emph{} \bf{} 斜體, 粗體
+% \title{} \author{} \date{} \maketitle 封面用
+% $...$ \[...\] 數學 隨文/展示 模式
+% \textbackslash $\backslash% 反除號
+% \part \chapter \section \paragraph section command
+% \begin{itemize/enumerate/description} \item item
+
+%Options: Sonny, Lenny, Glenn, Conny, Rejne, Bjarne, Bjornstrup
+%\usepackage[Sonny]{fncychap} 漂亮的chapter
+
+% \begin{raggedleft / flushright / center} %靠左/右/中對齊(前者不切齊)
+% \linespread{0.5}
+
+% \begin{minipage}[t]{0.40\linewidth}
+% \end{minipage}
+
+% \begin{tabular}[t / b / c]{r|cc||l}
+% bla & x & y & bla (\\ or \tabularnewline)
+% \hline
+% bla & x & y & bla (\\ or \tabularnewline)
+% \end{tabular}
+
+% \begin{multicols}{2}
+% \end{multicols}
+
+% \begin{itemize}
+% \itemsep = 0em
+% \item ...
+% \end{itemize}
+
+% \tableofcontents %目錄
+%\begin{algorithm}
+%\begin{algorithmic}[1]
+% \caption{My algorithm}\label{euclid}
+% \Function{$BinSearch$}{$record array arr, integer len, integer value$}
+% \State{$left \gets 0, {right} \gets \mathrm{len}$}
+% \State ${ans} \gets -1$
+% \While{ $left < right$ }
+% \State $mid \gets ??$
+% \If{$arr[mid] = value$}
+% \State $ans \gets mid, left \gets mid+1$
+% \ElsIf{$arr[mid] > value$}
+% \State{$right \gets mid$}
+% \ElsIf{$arr[mid] < value$}
+% \State{$left \gets mid+1$}
+% \EndIf
+% \EndWhile
+% \LineIf{$ans = -1$}{\Return $NOTFOUND$}
+% \State \Return $arr[ans]$
+% \EndFunction
+%\end{algorithmic}
+%\end{algorithm}
+