\documentclass[12pt]{article}
\usepackage[papersize={70mm, 35mm}, text={60mm, 25mm}]{geometry}
% For fancy fonts
\usepackage{fontspec}
\defaultfontfeatures{Scale=MatchLowercase, Mapping=tex-text}
\setmainfont[Ligatures={Common}, Numbers={OldStyle}]{Corbel}
\setsansfont[Scale=0.95]{Candara}
\setromanfont{Cambria}
\setmonofont{Monaco}

\usepackage{tikz}

\begin{document}
\pagestyle{empty}
\begin{figure}[h]
  \centering
  \begin{tikzpicture}
    [
      auto,
      line/.style ={draw, thick, -latex, shorten >=2pt},
      block/.style ={rectangle, text width=3em}
    ]
    
    \def\xdst{5cm}
    \def\ydst{-1.8cm}
    
    \node (X) at (0cm, 0cm) {$x$};
    \node (F) at (\xdst, 0cm) {$f(x)$};
    \node (B) at (\xdst, \ydst) {$b$};
    
    \path (X) edge [line, bend angle=10, bend left]
    node [above, midway] {easy} (F);
    \path (F) edge [line, bend angle=10, bend left, dashed, red]
    node [below, midway] {hard} (X);
    \path (X) edge [line, bend angle=15, bend right]
    node [midway, pos=.7,right, yshift=3mm] {easy} (B);
    \path (F) edge [line, dashed, red] node [right] {hard} (B);
  \end{tikzpicture}
\end{figure}
\end{document}
Comments Off on hard-core bits

\documentclass[12pt]{beamer}

% color theme
\usetheme{psu}
\usecolortheme[RGB={0,38,93}]{structure}

% For fancy fonts
\usepackage{fontspec}
\defaultfontfeatures{Scale=MatchLowercase, Mapping=tex-text}
\setmainfont[Ligatures={Common}, Numbers={OldStyle}]{Cambria}
\setsansfont[Scale=0.95]{Candara}
\setromanfont{Cambria}
\setmonofont{Monaco}

\usepackage{tikz}
\usetikzlibrary{arrows}

\newcommand{\TBE}{\textrm{TBE}}
\newcommand{\Sign}{\textrm{Sign}}
\newcommand{\PKE}{\textrm{PKE}}
\newcommand{\Verify}{\textrm{Verify}}

\begin{document}

\begin{frame}
  \frametitle{Canetti-Halevi-Katz Construction}
  \begin{figure}[h]
    \centering
    \begin{tikzpicture}[->,
        >=stealth',
        shorten >= 1pt,
        auto,
        semithick,
        bend angle=15,
      ]
      
      \coordinate (O) at (0cm, 0cm);
      \coordinate (A) at (-1.4cm, .2cm);
      \coordinate (B) at ( 1cm, .2cm);
      
      \tikzstyle{inbox} = [rectangle, draw=red!40!black!50, thick, top
        color=white, bottom color=red!60!blue!50, minimum width=1.5cm,
        minimum height=.8cm, rounded corners];
      \tikzstyle{outbox} = [rectangle, draw=black!50, thick, fill=black!5,
        minimum width=5.6cm, minimum height=2.2cm, rounded corners];
      \tikzstyle{line} = [draw, -latex', very thick]
      \tikzstyle{ann} = [above, text width=5em]
      
      \node [outbox] (PKE) at (O) {};
      \node [inbox] (TBE)  at (A) {\TBE};
      \node [inbox] (Sign) at (B) {\Sign};
      \node (blank) at (-5cm, 0cm) {$\medspace$};
      
      \path [line] (TBE) -- node [midway, above] {$C$} (Sign);
      
      \node (vk) [below of=TBE, node distance=2.6em] {$vk$};
      \path [line] (vk) -- (TBE);
      
      \node (sigk) [below of=Sign, node distance=2.6em] {$sigk$};
      \path [line] (sigk) -- (Sign);
      
      \node (sigma) [right of=Sign, node distance=3.7em] {$\sigma$};
      \path [line] (Sign) -- (sigma);
      
      \node (pk) [above of=TBE, node distance=3.7em] {$pk$};
      \path [line] (pk) -- (TBE);
      
      \node (M) [left of=TBE, node distance=5em] {M};
      \path [line] (M) -- (TBE);
      
      \node (Cpke) [right of=PKE, node distance=10.5em]
            {$\langle C,vk,\sigma\rangle$};
            \path [line] (PKE) -- (Cpke);
            
            \node (label) at (-2.4cm, 1.4cm) {\PKE};
            \node () [below of=PKE, node distance=1.4cm] {Encryption};
    \end{tikzpicture}
    
    \begin{tikzpicture}[->,
        >=stealth',
        shorten >= 1pt,
        auto,
        semithick,
        bend angle=15,
      ]
      
      \coordinate (O) at (0cm, 0cm);
      \coordinate (A) at (-1.2cm, .2cm);
      \coordinate (B) at ( 1.2cm, .2cm);
      
      \tikzstyle{inbox} = [rectangle, draw=red!40!black!50, thick, top
        color=white, bottom color=red!60!blue!50, minimum width=1.5cm,
        minimum height=.8cm, rounded corners];
      \tikzstyle{outbox} = [rectangle, draw=black!50, thick, fill=black!5,
        minimum width=5.6cm, minimum height=2.2cm, rounded corners];
      \tikzstyle{line} = [draw, -latex', very thick]
      \tikzstyle{ann} = [above, text width=5em]
      
      \node [outbox] (PKE) at (O) {};
      \node [inbox] (VFY)  at (A) {\Verify};
      \node [inbox] (TBE) at (B) {\TBE};
      
      \path [line] (VFY) -- node [pos=.7, above] {$C$} (TBE);
      
      \node (vk1) [below of=VFY, node distance=2.6em] {$vk$};
      \path [line] (vk1) -- (VFY);
      
      \node (vk2) [below of=TBE, node distance=2.6em] {$vk$};
      \path [line] (vk2) -- (TBE);
      
      \node (M) [right of=TBE, node distance=3.6em] {\hspace{-1mm}$M$};
      \path [line] (TBE) -- (M);
      
      \node (sk) [above of=TBE, node distance=3.5em] {$sk$};
      \path [line] (sk) -- (TBE);
      
      \node (Cpke) [left of=PKE, node distance=11em] {$\langle C,vk,\sigma\rangle$};
      \path [line] (Cpke) -- (PKE);
      
      \node (sigma) [left of=VFY, node distance=3.5em] {$\sigma$};
      \path [line] (sigma) -- (VFY);
      
      \node (output) [right of=PKE, node distance=10.8em] {$M\medspace$ or $\medspace\perp$};
      \path [line] (PKE) -- (output);
      
      \fill [black] (-1mm,.2cm) circle (2pt);
      \node (no) at (-1mm, -.6cm) {$\perp$};
      \path [line] (-1mm,.2cm) -- (no);
      
      \node (label) at (-2.4cm, 1.4cm) {\PKE};
      \node () [below of=PKE, node distance=1.4cm] {Decryption};
    \end{tikzpicture}
  \end{figure}
\end{frame}
\end{document}
Comments Off on Canetti-Halevi-Katz Construction

natbib example

how to compile

xelatex doc; bibtex doc; xelatex doc; xelatex doc;

doc.tex

\documentclass[12pt]{article}
\RequirePackage[papersize={180mm,140mm}, text={170mm, 130mm}, centering]{geometry}
%\usepackage{hyperref}
\usepackage{palatino}
\usepackage{natbib}
 
\begin{document}
\section*{Introduction}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce quis
purus tortor, \citep{merton1973tro} sed interdum sem. Nunc auctor nunc
in nisi suscipit tempus. \citet{black1973poa}
 
\section{Preliminaries}
Aliquam erat volutpat. Aenean lobortis tristique quam eget
interdum. Pellentesque ligula felis, convallis sit amet consequat nec,
egestas ac massa.\citep{harrison1979maa,pliska1981mas}
 
\bibliographystyle{apalike}
\bibliography{bib}
 
\end{document}

bib.bib

@article{black1973poa,
        title = {The pricing of options and corporate liabilities},
        author = {Fishcer Black and Myron Scholes},
        journal = {Journal of political economy},
        number = 3,
        pages = 637,
        publisher = {UChicago Press},
        volume = 81,
        year = 1973,
        biburl = {http://www.bibsonomy.org/bibtex/20bcd8dc7243127d7a6e5f61fa311d02f/ytyoun}},
 
@article{pliska1981mas,
        title = {Martingales and stochastic integrals in the theory of continuous trading},
        author = {J. Michael Harrison and Stanley Pliska},
        journal = {Stochastic Processes and their Applications},
        pages = {215--260},
        volume = 11,
        year = 1981,
        biburl = {http://www.bibsonomy.org/bibtex/2444648843be4b9a52bd426c59d7ec4d1/ytyoun}},
 
@article{harrison1979maa,
        title = {Martingales and arbitrage in multiperiod securities markets},
        author = {J. Michael Harrison and David M. Kreps},
        journal = {Journal of Economic theory},
        number = 3,
        pages = {381--408},
        volume = 20,
        year = 1979,
        biburl = {http://www.bibsonomy.org/bibtex/2bee84248fd744eed0098b10c87ddfa85/ytyoun}},
 
@article{merton1973tro,
        title = {Theory of rational option pricing},
        author = {Robert Merton},
        journal = {The Bell Journal of Economics and Management Science},
        pages = {141--183},
        publisher = {American Telephone and Telegraph Company},
        year = 1973,
        biburl = {http://www.bibsonomy.org/bibtex/236a29d217bff30efc9479b52770ef9a0/ytyoun}},
Comments Off on bibliography style: natbib

\documentclass[12pt]{beamer}

% color theme
\usetheme{psu}
\usecolortheme[RGB={0,38,93}]{structure}

% For fancy fonts
\usepackage{fontspec}
\defaultfontfeatures{Scale=MatchLowercase, Mapping=tex-text}
\setmainfont[Ligatures={Common}, Numbers={OldStyle}]{Cambria}
\setsansfont[Scale=0.95]{Candara}
\setromanfont{Cambria}
\setmonofont{Monaco}

\usepackage{tikz}
\usetikzlibrary{arrows,automata}

\begin{document}

\begin{frame}
  \frametitle{Deterministic Finite Automaton}
  \begin{figure}[h]
    \begin{tikzpicture}[
        % type of arrow head
        >=stealth',
        % keep arrow head from touching the surface
        shorten >= 1pt,
        % automatic node positioning
        auto,
        %                                   
        node distance=2cm,
        % line thickness
        semithick,
        bend angle=15,
        % text for the initial state arrow. I left it as blank
        initial text=]
      \tikzstyle{every state}=[draw=blue!50, thick, fill=blue!20]
      
      \node[state,initial](qe){$q_\epsilon$};
      \node[state,accepting](q0)[above right of=qe]{$q_0$};
      \node[state](q1)[below right of=qe]{$q_1$};
      \node[state](q2)[right of=q0]{$q_2$};
      \node[state,accepting](q3)[right of=q1]{$q_3$};
      \node[state](q4)[below right of=q2]{$q_4$};
      
      \path[->]
      (qe) edge [above left] node {0} (q0)
      (qe) edge [below left] node {1} (q1)
      
      (q0) edge [loop above] node {0} ()
      (q0) edge [left] node {1} (q1)
      
      (q1) edge [above left] node {0} (q2)
      (q1) edge [bend left] node {1} (q3)
      
      (q2) edge [above right] node {0} (q4)
      (q2) edge [above] node {1} (q0)
      
      (q3) edge [bend left] node {0} (q1)
      (q3) edge [right] node {1} (q2)
      
      (q4) edge [below right] node {0} (q3)
      (q4) edge [loop right] node {1} ();
    \end{tikzpicture}    
  \end{figure}
\end{frame}
\end{document}
Comments Off on Deterministic Finite Automaton

doc.tex

\documentclass[12pt]{beamer}

% color theme
\usetheme{psu}
\usecolortheme[RGB={0,38,93}]{structure}

% For fancy fonts
\usepackage{fontspec}
\defaultfontfeatures{Scale=MatchLowercase, Mapping=tex-text} 
\setmainfont[Ligatures={Common}, Numbers={OldStyle}]{Cambria}
\setsansfont[Scale=0.95]{Candara}
\setromanfont{Cambria}
\setmonofont{Monaco}

\usepackage{subfigure}
\usepackage{tikz}

\begin{document}

\begin{frame}
  \frametitle{Goal of ACRE Learning}
  \begin{figure}[h]
    \centering
    \subfigure[Classifier $c$]{\input{fig1.tex}}
    \quad
    \subfigure[Cost Function $a$]{\input{fig2.tex}}
    \\
    \subfigure[Adversary's Goal]{\input{fig3.tex}}
    \quad
    \subfigure[ACRE Learning]{\input{fig4.tex}}
    \caption{Special Case of 2-Dimensional Feature Vectors}
  \end{figure}
\end{frame}
\end{document}

fig1.tex

\begin{tikzpicture}[scale=.95]
  % classifier
  \filldraw [fill=red!20, draw=black, smooth] (0,0) -- (0cm, 2.6cm) --
  (0.2cm, 2.2cm) -- (0.8cm, 2.0cm) -- (1.2, 2.2cm) -- (1.8cm, 1.6cm)
  -- (2.6cm, 0.4cm) -- (3.5cm, 0cm) -- cycle;
 
  % boundary
  \draw (3.5cm, 0cm) -- (3.5cm, 2.6cm) -- (0cm, 2.6cm);
 
  % markers
  \node at (0.2cm, 0.2cm) {\color{red}+};
  \node at (3.3cm, 2.4cm) {\color{blue}-};
\end{tikzpicture}

fig2.tex

\begin{tikzpicture}[scale=.95]
  % boundary
  \draw (0, 0) -- (0cm, 2.6cm) -- (3.5cm, 2.6cm) -- (3.5cm, 0cm) --
  (0, 0);
 
  % classfier
  \filldraw [fill=red!20, draw=black, smooth] (0,0) -- (0cm, 2.6cm) --
  (0.2cm, 2.2cm) -- (0.8cm, 2.0cm) -- (1.2, 2.2cm) -- (1.8cm, 1.6cm)
  -- (2.6cm, 0.4cm) -- (3.5cm, 0cm) -- cycle;
 
  % cost functions
  \draw (2cm, 1.3cm) ellipse (1cm and .7cm);
  \draw (1.9cm, 1.3cm) ellipse (.8cm and .5cm);
  \draw (1.9cm, 1.3cm) ellipse (.6cm and .2cm);
  \draw (1.8cm, 1.3cm) ellipse (.3cm and .1cm);
  \draw (1.7cm, 1.3cm) ellipse (.12cm and .05cm);
  \draw (2cm, 1.6cm) ellipse (.1cm and .05cm);
\end{tikzpicture}

fig3.tex

\begin{tikzpicture}[scale=.95]
  % boundary
  \draw (0, 0) -- (0cm, 2.6cm) -- (3.5cm, 2.6cm) -- (3.5cm, 0cm) --
  (0, 0);
 
  % classfier
  \filldraw [fill=red!20, draw=black, smooth] (0,0) -- (0cm, 2.6cm) --
  (0.2cm, 2.2cm) -- (0.8cm, 2.0cm) -- (1.2, 2.2cm) -- (1.8cm, 1.6cm)
  -- (2.6cm, 0.4cm) -- (3.5cm, 0cm) -- cycle;
 
  % cost functions
  \draw (2cm, 1.3cm) ellipse (1cm and .7cm);
  \draw (1.9cm, 1.3cm) ellipse (.8cm and .5cm);
  \draw (1.9cm, 1.3cm) ellipse (.6cm and .2cm);
  \draw (1.8cm, 1.3cm) ellipse (.3cm and .1cm);
  \draw (1.85cm, 1.3cm) ellipse (.12cm and .05cm);
  \draw (2cm, 1.6cm) ellipse (.1cm and .05cm);
 
  % star
  \filldraw [orange] (2.05cm, 1.3cm) circle (.05cm);
\end{tikzpicture}

fig4.tex

\begin{tikzpicture}
  [
    scale=.95,
    circle/.style={shape=circle, minimum size=1mm, text centered},
    instance/.style={shape=circle, minimum size=1mm, text centered}
    ]
 
  % boundary
  \draw (0, 0) -- (0cm, 2.6cm) -- (3.5cm, 2.6cm) -- (3.5cm, 0cm) --
  (0, 0);
 
  % cost functions
  \draw (2cm, 1.3cm) ellipse (1cm and .7cm);
  \draw (1.9cm, 1.3cm) ellipse (.8cm and .5cm);
  \draw (1.9cm, 1.3cm) ellipse (.6cm and .2cm);
  \draw (1.8cm, 1.3cm) ellipse (.3cm and .1cm);
  \draw (1.7cm, 1.3cm) ellipse (.12cm and .05cm);
  \draw (2cm, 1.6cm) ellipse (.1cm and .05cm);
 
  % yes-instance
  \node [instance] at (0.5cm, 0.5cm) {\color{red}$x^+$};
  % no-instance
  \node [instance] at (2.5cm, 2.3cm) {\color{blue}$x^-$};
 
  % queries
  \node [circle] at (  2cm,   2cm) {\color{orange}?};
  \node [circle] at (1.5cm, 0.8cm) {\color{orange}?};
  \node [circle] at (2.7cm, 0.5cm) {\color{orange}?};
  \node [circle] at (0.5cm, 2.3cm) {\color{orange}?};
  \node [circle] at (  3cm, 1.5cm) {\color{orange}?};
  \node [circle] at (2.3cm, 1.5cm) {\color{orange}?};
  \node [circle] at (1.7cm, 1.3cm) {\color{orange}?};
\end{tikzpicture}
Comments Off on ACRE Learning: subfigure