\( \newcommand{\N}{\mathbb{N}} \newcommand{\R}{\mathbb{R}} \newcommand{\C}{\mathbb{C}} \newcommand{\Q}{\mathbb{Q}} \newcommand{\Z}{\mathbb{Z}} \newcommand{\P}{\mathcal P} \newcommand{\B}{\mathcal B} \newcommand{\F}{\mathbb{F}} \newcommand{\E}{\mathcal E} \newcommand{\brac}[1]{\left(#1\right)} \newcommand{\abs}[1]{\left|#1\right|} \newcommand{\matrixx}[1]{\begin{bmatrix}#1\end {bmatrix}} \newcommand{\vmatrixx}[1]{\begin{vmatrix} #1\end{vmatrix}} \newcommand{\lims}{\mathop{\overline{\lim}}} \newcommand{\limi}{\mathop{\underline{\lim}}} \newcommand{\limn}{\lim_{n\to\infty}} \newcommand{\limsn}{\lims_{n\to\infty}} \newcommand{\limin}{\limi_{n\to\infty}} \newcommand{\nul}{\mathop{\mathrm{Nul}}} \newcommand{\col}{\mathop{\mathrm{Col}}} \newcommand{\rank}{\mathop{\mathrm{Rank}}} \newcommand{\dis}{\displaystyle} \newcommand{\spann}{\mathop{\mathrm{span}}} \newcommand{\range}{\mathop{\mathrm{range}}} \newcommand{\inner}[1]{\langle #1 \rangle} \newcommand{\innerr}[1]{\left\langle #1 \right \rangle} \newcommand{\ol}[1]{\overline{#1}} \newcommand{\toto}{\rightrightarrows} \newcommand{\upto}{\nearrow} \newcommand{\downto}{\searrow} \newcommand{\qed}{\quad \blacksquare} \newcommand{\tr}{\mathop{\mathrm{tr}}} \newcommand{\bm}{\boldsymbol} \newcommand{\cupp}{\bigcup} \newcommand{\capp}{\bigcap} \newcommand{\sqcupp}{\bigsqcup} \newcommand{\re}{\mathop{\mathrm{Re}}} \newcommand{\im}{\mathop{\mathrm{Im}}} \newcommand{\comma}{\text{,}} \newcommand{\foot}{\text{。}} \)

Friday, June 27, 2014

[P&D/CG] 究進青龍!

最近迷上了 P&D 這遊戲,玩了 12x 天,現在已是 218 rank,可惜還沒有可以橫掃降臨的強隊(這類隊伍多需要數千元的課金額 ...)。

以下是究進了的(水暗)青龍!因為是龍的關係,特地學習有關龍的畫法:


呀呀呀,以下才是主角!


把它們合併並作一些微調:


彩圖用的線稿正在處理中!


Tuesday, June 24, 2014

[Beamer] 有用的小技巧

快要 defense,presentation 決定採用 beamer 形式裝作 power point (原因嘛,簡單方便快捷!)。


技巧 1. 一般人對 beamer 感到最厭煩的就是每一個 \frame{} 裏都要加上 \frametitle{},其作用有點類似文章的 section。漏掉的話會整欄空掉,蠻奇怪的。以下一段 code 能夠在接着的 frame 中不斷承繼上一個 frame 的 title (直至令立 title 為止):
 \makeatletter  
 \def\beamer@checkframetitle{%  
 \begingroup  
  \edef\temp{%  
   \endgroup  
   \noexpand\frametitle  
   [\unexpanded\expandafter{\beamer@savedshortframetitle}]%  
   {\unexpanded\expandafter{\beamer@savedframetitle}}%  
  }  
 \temp  
 \@ifnextchar\bgroup\beamer@inlineframetitle{}}  
 \long\def\beamer@@frametitle[#1]#2{%  
  \beamer@ifempty{#2}{}{%  
   \gdef\insertframetitle{{#2\ifnum\beamer@autobreakcount>0\relax{}\space\usebeamertemplate*{frametitle  
 continuation}\fi}}%  
  \gdef\beamer@frametitle{#2}%  
  \gdef\beamer@shortframetitle{#1}%  
  \global\let\beamer@savedshortframetitle\beamer@shortframetitle  
   \global\let\beamer@savedframetitle\beamer@frametitle  
 }%  
 }  
  \global\let\beamer@savedshortframetitle\@empty  
   \global\let\beamer@savedframetitle\@empty  
 \makeatother  

技巧 2. 若數式以 align/align* environment 進行等號對齊,用家會發現在 "\\" 後加上 \pause 會出現錯誤。beamer 這先天的缺點有以下的 solution:
 \makeatletter  
 \def\pdftex@driver{pdftex.def}  
 \ifx\Gin@driver\pdftex@driver  
  \def\pgfsys@color@unstacked#1{%  
   \pdfliteral{\csname\string\color@#1\endcsname}%  
  }  
 \fi  
 \makeatother  

Sunday, June 15, 2014

[Tikz] Draw contours with midway arrow

The code is as follows: In the preamble, paste (with the package "tikz" loaded of course!):
 \usetikzlibrary{decorations.pathreplacing,decorations.markings}  
 \tikzset{  
  % style to apply some styles to each segment of a path  
  on each segment/.style={  
   decorate,  
   decoration={  
    show path construction,  
    moveto code={},  
    lineto code={  
     \path [#1]  
     (\tikzinputsegmentfirst) -- (\tikzinputsegmentlast);  
    },  
    curveto code={  
     \path [#1] (\tikzinputsegmentfirst)  
     .. controls  
     (\tikzinputsegmentsupporta) and (\tikzinputsegmentsupportb)  
     ..  
     (\tikzinputsegmentlast);  
    },  
    closepath code={  
     \path [#1]  
     (\tikzinputsegmentfirst) -- (\tikzinputsegmentlast);  
    },  
   },  
  },  
  % style to add an arrow in the middle of a path  
  mid arrow/.style={postaction={decorate,decoration={  
     markings,  
     mark=at position .5 with {\arrow[#1]{stealth}}  
    }}},  
 }  

As an exmaple, see:

 \begin{tikzpicture}[scale=2]  
 \clip (0.6,3.75) rectangle (3.85,0.85);  
 \draw[thick] (0,0) ellipse (3 and 3);  
 \draw[postaction={on each segment={mid arrow}}] (60:2) arc (60:30:2) -- (30:2.8) arc(30:60:2.8)--cycle;  
 \draw[postaction={on each segment={mid arrow}}] (30:4.2)arc (30:60:4.2) --(60:3.2)arc (60:30:3.2)--cycle;  
 \node at (1.745,1.795) {$L_1(r)$};  
 \node at (0.9,2.15) {$L_2(r)$};  
 \node at (1.225,1.2) {$L_3(r)$};  
 \node at (2.275,1) {$L_4(r)$};  
 \node at (2.5,2.425) {$T_1(r)$};  
 \node at (3.45,1.65) {$T_2(r)$};  
 \node at (3.225,3.125) {$T_3(r)$};  
 \node at (1.575,3.325) {$T_4(r)$};  
 \end{tikzpicture}