1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
\documentclass{beamer}
 
\usepackage{tikz}
\usepackage{graphicx}
\usetikzlibrary{decorations.text}
 
\begin{document}
\begin{frame}
  \frametitle{Donut and Pictures}
  \begin{figure}[h]
    \centering
    \begin{tikzpicture}
      \newcommand*{\myInnerRadius}{1cm}%
      \newcommand*{\myOuterRadius}{3cm}%
      \newcommand*{\myMidRadius}{2cm}%
 
      % three segments in donut
      \filldraw[fill=blue!30, draw=blue!50] (30:\myInnerRadius) -- (30:\myOuterRadius) arc (30:150:\myOuterRadius) -- (150:\myInnerRadius) arc (150:30:\myInnerRadius);
      \filldraw[fill=red!30, draw=red!50] (30:\myInnerRadius) -- (30:\myOuterRadius) arc (30:-90:\myOuterRadius) -- (-90:\myInnerRadius) arc (-90:30:\myInnerRadius);
      \filldraw[fill=green!30, draw=green!50] (150:\myInnerRadius) -- (150:\myOuterRadius) arc (150:270:\myOuterRadius) -- (270:\myInnerRadius) arc (270:150:\myInnerRadius);
 
      % text around the donut
        \path[decoration={text along path, text={Random Text}, text align={align=center}, raise=1ex}, decorate] (150:\myOuterRadius) arc (150:30:\myOuterRadius);
      \path[decoration={text along path, text={Another Text}, text align={align=center}, raise=1ex}, decorate] (30:\myOuterRadius) arc (30:-90:\myOuterRadius);
        \path[decoration={text along path, text={Last Random Text}, text align={align=center}, raise=1ex}, decorate] (270:\myOuterRadius) arc (270:150:\myOuterRadius);
 
      % image
      \node (G1) at (0:0cm) {\includegraphics[height=15mm]{Figs/youtube.png}};
      \node (G2) at (90:\myMidRadius) {\includegraphics[height=15mm]{Figs/12.png}};
      \node (G3) at (-30:\myMidRadius) {\includegraphics[height=15mm]{Figs/6.png}};
      \node (G4) at (210:\myMidRadius) {\includegraphics[height=15mm]{Figs/linkedin.png}};
    \end{tikzpicture}
  \end{figure}
\end{frame}
\end{document}
Comments Off on Donut and Pictures

doc

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
\documentclass{beamer}
  
\usepackage{tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{calc}
  
\begin{document}
  
\begin{frame}{A New System}
\begin{figure}[h]
\centering
\begin{tikzpicture}%[node distance=16mm]
    \tikzstyle{box1} = [rectangle, thick, text centered ,
    minimum width=15mm, minimum height=14mm,
    top color=white, bottom color=blue!30, draw=blue!40]
  
    \tikzstyle{box2} = [rectangle, thick, text centered ,
    minimum width=15mm, minimum height=14mm,
    top color=white, bottom color=red!30, draw=red!40]
  
    \tikzstyle{box3} = [rectangle, thick, text centered ,
    text width=50mm, minimum height=14mm,
    top color=white, bottom color=green!30, draw=green!40]
  
    \tikzstyle{box4} = [rectangle, thick, text centered ,
    minimum width=15mm, minimum height=14mm,
    top color=white, bottom color=cyan!30, draw=cyan!40]
 
    \coordinate (P1) at (0cm, 0cm);
  
    \node [box1] (B1) at (P1) {Team1};
    \node [box2, anchor=west] (B2) at (B1.east) {Team2};
    \node [box3, anchor=west] (B3) at (B2.east) {\begin{tabular}{c} Team3 \\ in two lines\end{tabular}};
    \node [box4, anchor=west] (B4) at (B3.east) {Team4};
 
\end{tikzpicture}
\end{figure}
\end{frame}
\end{document}
Comments Off on PGF Drawing with anchor

Screen Shot 2016-06-14 at 1.05.51 AM

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
\documentclass{article}
% for graph drawing
\usepackage{tikz}
\usetikzlibrary{shapes}
\usetikzlibrary{circuits.ee.IEC}
% for two subfigures in one figure
\usepackage{subcaption}
 
\begin{document}
\begin{figure}[h]
    \centering
  \begin{subfigure}[b]{.48\textwidth}
    \centering
    \begin{tikzpicture}
        [
            circuit ee IEC,
            set resistor graphic=var resistor IEC graphic,
            small circuit symbols, semithick,
            vertex/.style = {circle, draw=blue!40, fill=blue!10},
        ]
        \coordinate (P4) at (0cm,  0mm);
        \coordinate (P1) at (150: 18mm);
        \coordinate (P2) at ( 30: 18mm);
        \coordinate (P3) at (270: 18mm);
 
        \node [vertex] (V1) at (P1) {1};
        \node [vertex] (V2) at (P2) {2};
        \node [vertex] (V3) at (P3) {3};
        \node [vertex] (V4) at (P4) {4};
 
        \draw (V1) to [resistor={info={$R_{1}$}}] (V4);
        \draw (V2) to [resistor={info={$R_{2}$}}] (V4);
        \draw (V3) to [resistor={info={$R_{3}$}}] (V4);
    \end{tikzpicture}
    \caption{a $Y$-shape resistor network}
    \label{fig:y-shape}
    \end{subfigure}
    \begin{subfigure}[b]{.48\textwidth}
    \centering
    \begin{tikzpicture}
        [
            circuit ee IEC,
            set resistor graphic=var resistor IEC graphic,
            small circuit symbols, semithick,
            vertex/.style = {circle, draw=blue!40, fill=blue!10},
        ]
        \coordinate (P1) at (150: 15mm);
        \coordinate (P2) at ( 30: 15mm);
        \coordinate (P3) at (270: 15mm);
 
        \node [vertex] (V1) at (P1) {1};
        \node [vertex] (V2) at (P2) {2};
        \node [vertex] (V3) at (P3) {3};
 
        \draw (V1) to [resistor={info={$R_{12}$}}] (V2);
        \draw (V2) to [resistor={info={$R_{23}$}}] (V3);
        \draw (V3) to [resistor={info={$R_{31}$}}] (V1);
    \end{tikzpicture}
    \caption{a $\Delta$-shape resistor network}
    \label{fig:delta-shape}
    \end{subfigure}
    \caption{A $Y$-$\Delta$ transform.}
\end{figure}
\end{document}
Comments Off on Delta-Wye Transform

Screen Shot 2015-11-01 at 8.49.58 PM

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
\documentclass{beamer}
 
\usepackage{tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{calc}
 
\begin{document}
 
\begin{frame}{A New System}
\begin{figure}[h]
\centering
\begin{tikzpicture}[node distance=0.7cm]
    \tikzstyle{box1} = [rectangle, thick, text centered ,
    text width=1.5cm, minimum height=.7cm,
    top color=white, bottom color=blue!30, draw=blue!40]
 
    \tikzstyle{box2} = [rectangle, thick, text centered ,
    text width=1.5cm, minimum height=.7cm,
    top color=white, bottom color=red!30, draw=red!40]
 
    \tikzstyle{box3} = [rectangle, thick, text centered ,
    text width=1.5cm, minimum height=.7cm,
    top color=white, bottom color=green!30, draw=green!40]
 
    \tikzstyle{box4} = [rectangle, thick, text centered ,
    text width=1.5cm, minimum height=.7cm,
    top color=white, bottom color=cyan!30, draw=cyan!40]
 
    \coordinate (A) at (-3cm, 0cm);
    \coordinate (B) at ( 0cm, 0cm);
    \coordinate (C) at ( 3cm, 0cm);
 
    \node [box1] (A1) at (A) {Team1};
    \node [box1] (B1) at (B) {Team4};
    \node [box1] (C1) at (C) {Team8};
 
    \node [box2] (A2) [below of=A1] {Team2};
    \node [box2] (B2) [below of=B1] {Team5};
    \node [box2] (C2) [below of=C1] {Team9};
 
    \node [box3] (A3) [below of=A2] {Team3};
    \node [box3] (B3) [below of=B2] {Team6};
    \node [box3] (C3) [below of=C2] {Team10};
 
    \node [box4] (B4) [below of=B3] {Team7};
     
    \node [above of=A1] {A};
    \node [above of=B1] {B};
    \node [above of=C1] {C};
\end{tikzpicture}
\end{figure}
 
\begin{figure}
\begin{tikzpicture}[node distance=1.8cm]
    \tikzstyle{box1} = [rectangle, thick, text centered ,
    text width=1cm, minimum height=.7cm, rounded corners,
    top color=white, bottom color=blue!30, draw=blue!40]
 
    \tikzstyle{line} = [thick, draw=black]
 
    \coordinate (O) at (0cm, 0cm);
 
    \node [box1] (A1) at (O) {\small A1};
    \node [box1] (B1) [right of=A1] {\small B1};
    \node [box1] (C1) [right of=B1] {\small C1};
    \node [box1] (W1) [right of=C1] {\small W1};
    \node [box1] (W2) [right of=W1] {\small W2};
 
    \path [line] (A1.north) |- ++(18mm, 5mm) coordinate [pos=.75] (m-1-2) -| (B1.north);
 
    \path [line] (W1.north) |- ++(10mm, 5mm) coordinate (m-4-5) -| (W2.north);
 
    \path [line] (C1.north) |- ++(15mm, 10mm) coordinate (m-3-4) -| (m-4-5);
 
    \path [line] (m-1-2) |- ++(20mm, 10mm) coordinate (m-final) -| (m-3-4);
 
    \node [below] at (m-1-2) {\small Game 1};
    \node [below] at (m-3-4) {\small Game 2};
    \node [below] at (m-4-5) {\small Game 3};
    \node [above] at (m-final) {\small Korean Series};
\end{tikzpicture}
\end{figure}
\end{frame}
\end{document}
Comments Off on Baseball Elimination Figure

Screen Shot 2015-11-01 at 8.41.20 PM

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
%\documentclass{standalone}
\documentclass{article}
\usepackage{booktabs}
\newcommand{\ramuno}{\ensuremath{\iota}}
 
\begin{document}
\begin{table}[h]
  \centering
  \begin{tabular}{l|llll}
    \toprule
    \multicolumn{1}{c|}{order} &
    \multicolumn{1}{c}{$+1$} &
    \multicolumn{1}{c}{$-1$} &
    \multicolumn{1}{c}{$+\ramuno$} &
    \multicolumn{1}{c}{$-\ramuno$} \\
    \midrule
    $4m$   & $m+1$ & $m$   & $m$   & $m-1$ \\
    $4m+1$ & $m+1$ & $m$   & $m$   & $m$   \\
    $4m+2$ & $m+1$ & $m+1$ & $m$   & $m$   \\
    $4m+3$ & $m+1$ & $m+1$ & $m+1$ & $m$   \\
    \bottomrule
  \end{tabular}
\end{table}
\end{document}
Comments Off on Booktabs + Multicolumn

doc

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
\documentclass{article}
 
\usepackage[papersize={5.2in, 1.6in}, text={5in, 1.4in}]{geometry}
 
% for choosing the proper font encoding
\usepackage[T1]{fontenc}
% for proper encoding
\usepackage[utf8]{inputenc}
% enhanced font Latin Modern
\usepackage{lmodern}
% multi-language support
\usepackage[english]{babel}
% for inline and display quotations.
\usepackage[autostyle]{csquotes}
 
\usepackage{doi}
\usepackage[ocgcolorlinks,pdfusetitle]{hyperref}
\usepackage[
  backend=biber,
  style=alphabetic,
  citestyle=alphabetic,
  backref=true]{biblatex}
 
%%%
\usepackage{filecontents} 
\begin{filecontents}{bib.bib}
@article{black1973,
  author = {Black, Fishcer and Scholes, Myron},
  doi = {10.1086/260062},
  journal = {Journal of political economy},
  number = 3,
  pages = {637--654},
  publisher = {UChicago Press},
  title = {The pricing of options and corporate liabilities},
  volume = 81,
  year = 1973
}
\end{filecontents}
 
\addbibresource{bib.bib}
 
\begin{document}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit
\cite{black1973}.
Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis.
 
\printbibliography
 
\end{document}
Comments Off on BibLaTeX + backref + biber + doi

test

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
\documentclass[10pt]{article}
 
% for smallper page
\usepackage[papersize={4.2in, 1.4in}, text={4in, 1.3in}]{geometry}
% for fancy math
\usepackage{amsmath}
 
% rank operator
\DeclareMathOperator*{\rank}{rank}
 
% Matrix transpose
\newcommand{\trans}[1]{\ensuremath{{#1}^\top}}
 
% for extra space at the end of abbreviation
\usepackage{xspace}
 
% positive semi-definite
\newcommand{\psd}{\textsc{psd}\xspace}
 
% boldface uppercase letters for matrices
\newcommand{\Abf}{\ensuremath{\mathbf A}}
\newcommand{\Bbf}{\ensuremath{\mathbf B}}
 
% boldface lowercase letters for vectors
\newcommand{\xbf}{\ensuremath{\mathbf x}}
 
% for math blackboard font
\usepackage{amssymb}
% set of real numbers
\newcommand{\Rbb}{\ensuremath{\mathbb R}}
 
\usepackage{palatino}
\usepackage[sc]{mathpazo}
 
\begin{document}
\noindent
For any real symmetric matrcies $\Abf$ such that $\rank(\Abf_{n\times n})=r$,
the following statements are equivalent
and any one of them can serve as the definition of
\emph{positive semi-definite} (\psd) matrices.
\begin{itemize}
  \item $\trans\xbf \Abf\xbf \geq 0$ for any non-zero vector
    $\xbf\in\Rbb^{n\times 1}$.
    \hfill\refstepcounter{equation}\textup{(\theequation)}%
  \item All the $n$ eigenvalues of $\Abf$ are non-negative.
    \hfill\refstepcounter{equation}\textup{(\theequation)}%
  \item $\Abf=\trans\Bbf \Bbf$ for some $\Bbf$ with $\rank(\Bbf)=r$.
    \hfill\refstepcounter{equation}\textup{(\theequation)}%
\end{itemize}
 
\end{document}
Comments Off on Equation numbering in itemized list

doc

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
\documentclass{beamer}
\usepackage{hyperref}
\setbeamertemplate{theorems}[numbered]
\usetheme{CambridgeUS}
 
\begin{document}
\begin{frame}
  \frametitle{Test}
  \begin{theorem}[Fermat's Last Theorem]
    $x^n + y^n = z^n$.
    \label{thm:fermat}
  \end{theorem}
  As shown in Theorem \ref{thm:fermat}...
 
  \begin{example}
    Here goes an example!
  \end{example}
 
  \begin{theorem}
    $e^{i\pi} + 1 = 0$
  \end{theorem}
 
  \begin{corollary}
    Corollary!
  \end{corollary}
\end{frame}
 
\end{document}
Comments Off on Beamer theorem numbering

boldface

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
\documentclass{minimal}
% for smallper page
\usepackage[papersize={2.6in, 1.2in}, text={2.6in, 1.2in}]{geometry}
% for fancy math
\usepackage{amsmath}
 
% Greek letter lowercase boldface
\newcommand{\alphabf}{\ensuremath{\boldsymbol{\alpha}}}
\newcommand{\betabf}{\ensuremath{\boldsymbol{\beta}}}
\newcommand{\gammabf}{\ensuremath{\boldsymbol{\gamma}}}
\newcommand{\deltabf}{\ensuremath{\boldsymbol{\delta}}}
\newcommand{\epsbf}{\ensuremath{\boldsymbol{\epsilon}}}
\newcommand{\epsilonbf}{\ensuremath{\boldsymbol{\epsilon}}}
\newcommand{\zetabf}{\ensuremath{\boldsymbol{\zeta}}}
\newcommand{\etabf}{\ensuremath{\boldsymbol{\eta}}}
\newcommand{\thetabf}{\ensuremath{\boldsymbol{\theta}}}
\newcommand{\iotabf}{\ensuremath{\boldsymbol{\iota}}}
\newcommand{\kappabf}{\ensuremath{\boldsymbol{\kappa}}}
\newcommand{\lambdabf}{\ensuremath{\boldsymbol{\lambda}}}
\newcommand{\mubf}{\ensuremath{\boldsymbol{\mu}}}
\newcommand{\nubf}{\ensuremath{\boldsymbol{\nu}}}
\newcommand{\xibf}{\ensuremath{\boldsymbol{\xi}}}
\newcommand{\pibf}{\ensuremath{\boldsymbol{\pi}}}
\newcommand{\rhobf}{\ensuremath{\boldsymbol{\rho}}}
\newcommand{\sigmabf}{\ensuremath{\boldsymbol{\sigma}}}
\newcommand{\taubf}{\ensuremath{\boldsymbol{\tau}}}
\newcommand{\upsilonbf}{\ensuremath{\boldsymbol{\upsilon}}}
\newcommand{\phibf}{\ensuremath{\boldsymbol{\phi}}}
\newcommand{\chibf}{\ensuremath{\boldsymbol{\chi}}}
\newcommand{\psibf}{\ensuremath{\boldsymbol{\psi}}}
\newcommand{\omegabf}{\ensuremath{\boldsymbol{\omega}}}
 
% Greek letter uppercase boldface
\newcommand{\Gammabf}{\ensuremath{\boldsymbol{\Gamma}}}
\newcommand{\Deltabf}{\ensuremath{\boldsymbol{\Delta}}}
\newcommand{\Thetabf}{\ensuremath{\boldsymbol{\Theta}}}
\newcommand{\Lambdabf}{\ensuremath{\boldsymbol{\Lambda}}}
\newcommand{\Xibf}{\ensuremath{\boldsymbol{\Xi}}}
\newcommand{\Pibf}{\ensuremath{\boldsymbol{\Pi}}}
\newcommand{\Sigmabf}{\ensuremath{\boldsymbol{\Sigma}}}
\newcommand{\Upsilonbf}{\ensuremath{\boldsymbol{\Upsilon}}}
\newcommand{\Phibf}{\ensuremath{\boldsymbol{\Phi}}}
\newcommand{\Psibf}{\ensuremath{\boldsymbol{\Psi}}}
\newcommand{\Omegabf}{\ensuremath{\boldsymbol{\Omega}}}
 
\begin{document}
\begin{equation*}
\alphabf
\betabf
\gammabf
\deltabf
\epsbf
\epsilonbf
\zetabf
\etabf
\thetabf
\iotabf
\kappabf
\lambdabf
\mubf
\nubf
\xibf
\pibf
\rhobf
\sigmabf
\taubf
\upsilonbf
\phibf
\chibf
\psibf
\omegabf
\end{equation*}
 
\begin{equation*}
\Gammabf
\Deltabf
\Thetabf
\Lambdabf
\Xibf
\Pibf
\Sigmabf
\Upsilonbf
\Phibf
\Psibf
\Omegabf
\end{equation*}
\end{document}
Comments Off on Math Greek Letters Boldface

dante

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
\documentclass{article}
 
\usepackage[papersize={80mm, 80mm}, text={75mm, 70mm}]{geometry}
 
\usepackage{verse}
\newcommand{\attrib}[1]{\nopagebreak{\raggedleft\footnotesize #1\par}}
 
\usepackage{fontspec,xltxtra}
\newcommand{\old}[1]{%
  \fontspec[Alternate=1,Ligatures={Common,Rare}]%
  {Hoefler Text}\fontsize{12pt}{12pt}\selectfont #1}%
 
\begin{document}
\thispagestyle{empty}
 
\old
\itshape
\settowidth{\versewidth}{Ahi quanto a dir qual era \`e cosa dura}
\begin{verse}[\versewidth]
Nel mezzo del cammin di nostra vita \\
mi ritrovai per una selva oscura, \\
ch\'e la diritta via era smarrita. \\
\vspace{3mm}
 
Ahi quanto a dir qual era \`e cosa dura \\
esta selva selvaggia e aspra e forte \\
che nel pensier rinova la paura! \\
\vspace{3mm}
 
Tant'\`e amara che poco \`e pi\`u morte; \\
ma per trattar del ben ch'i' vi trovai, \\
dir\`o de l'altre cose ch'i' v'ho scorte. \\
\end{verse}
\attrib{\textit{Divina Commedia, Inferno, Canto I, 1-9}}
\attrib{Dante Alighieri}
\end{document}
Comments Off on Divina Commedia, Inferno, Canto I, 1-9