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