\documentclass{article}

% this is to use \href{} and \hyperlink
\usepackage[bookmarks]{hyperref}
      
% this is to use \includegraphics{}      
\usepackage{graphicx}

% for using cases
\usepackage{amsmath}

% for some math fonts
\usepackage{amsmath}
\usepackage{amssymb}

% for citation
\usepackage[numbers]{natbib} 

% nice for url
\usepackage{url}

\begin{document}


\title{\LaTeX Introduction to \LaTeX}
\author{Kohta Mori}

% this makes the tile, author, date, etc
\maketitle


\begin{abstract}
This is the perfect introduction to \LaTeX.
\end{abstract}


% this makes the title page separated from the text
\titlepage



% if you uncomment this, table of contents will show up
%\tableofcontents


\section{Link}

\begin{itemize}
\item \href{http://www.google.com/}{open google.com in your browser}
\item \hyperlink{target}{go to target in the next page}
\end{itemize}

\newpage


\section{Link within a document}


\hypertarget{target} Here is the target!



\newpage

\section{Figure}


  \begin{center}
  \begin{figure}[h]
  \caption{title of the figure}
  \label{cook}
  \includegraphics[width=\hsize]{P9130002.JPG}
  \end{figure}
  \end{center}


  \begin{figure}[h]
  \caption{title of the figure}
    \begin{tabular}{cc}
      \begin{minipage}{0.5\hsize}
      \begin{center}
      \includegraphics[width=\hsize]{P9130002.png}
      \end{center}
      \end{minipage}

      \begin{minipage}{0.5\hsize}
      \begin{center}
      \includegraphics[width=\hsize]{P9130002.pdf}
      \end{center}
      \end{minipage}
    \end{tabular}
  \end{figure}


\section{Table}


\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}

\begin{center}
\begin{table}[h]
\caption{Regression of log(constexp)}
\label{tab:const}

\begin{tabular}{l|lllc}
\hline\hline
	 &\multicolumn{1}{c}{( 1 )}  	 &\multicolumn{1}{c}{( 2 )}  	 &\multicolumn{1}{c}{( 3 )}  	 &\multicolumn{1}{c}{( 4 )}  \\  
	 	  &\multicolumn{1}{c}{Prefecture FE} &\multicolumn{1}{c}{Prefecture FE} &\multicolumn{1}{c}{Two-ways FE} &\multicolumn{1}{c}{Two-ways FE}\\

\hline
PrefshareInLDPmembers.RD 		&4.558\sym{***} 		&3.208\sym{***} 		&1.683\sym{***} 		&1.548\sym{**} \\
  		&(0.776) 		&(0.701) 		&(0.614) 		&(0.616) \\ \hline
  		
NationwideLDPseatshare.R 		&-0.152\sym{**} 		&0.009 		& 		& \\
  		&(0.074) 		&(0.067) 		& 		& \\
LDPshareInPrefseats.RD 		&-0.119\sym{***} 		&-0.075\sym{***} 		&0.006 		&0.01 \\
  		&(0.029) 		&(0.026) 		&(0.023) 		&(0.023) \\
log(expenditure) 		&1.986\sym{***} 		&1.338\sym{***} 		&1.525\sym{***} 		&1.473\sym{***} \\
  		&(0.039) 		&(0.05) 		&(0.044) 		&(0.05) \\
log(Pop) 		&-0.917\sym{***} 		&-0.953\sym{***} 		&-0.84\sym{***} 		&-0.861\sym{***} \\
  		&(0.089) 		&(0.08) 		&(0.067) 		&(0.068) \\
log(TtlPop) 		&-13.118\sym{***} 		&-9.362\sym{***} 		& 		& \\
  		&(0.475) 		&(0.472) 		& 		& \\
log(GRPpercapita) 		&0.249\sym{***} 		&0.31\sym{***} 		&0.222\sym{***} 		&0.218\sym{***} \\
  		&(0.067) 		&(0.06) 		&(0.063) 		&(0.063) \\
log(numWelfareReceipient) 		&-0.219\sym{***} 		&-0.226\sym{***} 		&-0.141\sym{***} 		&-0.146\sym{***} \\
  		&(0.017) 		&(0.015) 		&(0.016) 		&(0.016) \\
log(Disbursement) 		& 		&0.446\sym{***} 		& 		&0.072\sym{**} \\
  		& 		&(0.024) 		& 		&(0.034) \\

\hline
$N$ 		&\multicolumn{1}{c}{1504} 		&\multicolumn{1}{c}{1504} 		&\multicolumn{1}{c}{1504} 		&\multicolumn{1}{c}{1504} \\
\hline\hline
\multicolumn{5}{l}{\footnotesize Standard errors in parentheses}\\
\multicolumn{5}{l}{\footnotesize $^{*}$ (p $\le$ 0.1), $^{**}$ (p $\le$ 0.05), $^{***}$ (p $\le$ 0.01)}\\
\end{tabular}
\end{table}
\end{center}



\section{Equation}

% use \begin{equation}: comes with number
\begin{equation}
 f(x) = x^2  \label{square}
\end{equation}

% \[  \]  : come without number
\[ f(x) = x^2 \]


% multiple equations
\begin{eqnarray}
x = \cos(\theta) \\
y = cos(\theta)
\end{eqnarray} 


% cases
\[ \mathrm{Pr}(x) = \begin{cases}
             0  & \text{for $x \leq 0$} \\
             1  & \text{otherwise}
           \end{cases} \]

% fraction
\[  \frac{1}{2x-y} = \frac{ \frac{a}{b} }{c} \]


I suppose the function is $x^2$ but my friend says it is $x^3$.

% parenthesis: \left and \right will adjust the size of parenthesis
\begin{eqnarray}
x = ( \frac{\mathrm{e}^{x' \beta}}{1-\mathrm{e}^{x' \beta} }) \\
x = \left( \frac{\mathrm{e}^{x' \beta}}{1-\mathrm{e}^{x' \beta} } \right) 
\end{eqnarray}

% partial derivatives
\[ \left. \frac{\partial T}{\partial z} \right|_{z=z_0}  \]

% curly parenthesis
\[ X = \{ 0, 1, 2, 3 \} \]


% matrix
\[
A = \begin{pmatrix}
    a & b & c \\
    d & e & f 
    \end{pmatrix}
\]

\[
B = \begin{bmatrix}
    a & b & c \\
    d & e & f 
    \end{bmatrix}
\]

\[
I = \begin{pmatrix}
    1      &   0   & \cdots & 0 \\
    0      &   1   & \cdots & 0 \\
    \vdots &  0   & \ddots & 0 \\
    0      &   0   &  0     & 1
    \end{pmatrix}
\]


% square root
\[ f(x) = \sqrt{x} + \sqrt[3]{x} \] 


% limit
\begin{equation}
\lim_{x \to \infty} \frac{1}{1-x} = 0
\end{equation}


% approx etc
\[  x \approx y \ge z \le w \equiv v \]
Look up on \url{http://www.latex-cmd.com/equation/operator.html} for more


% big O, small
\[ \lambda \sim \mathcal{O}(100) \]


% summation, products, integral
\begin{eqnarray}
\sum_{k = 1}^{10} k = 55 \\
\prod_{p = 1}^{10} p = 10! \\
\int_{z \in \mathbb{R}} g(z) \; dF(z) = 1  % \; is for space
\end{eqnarray}


\[\mathcal{C} \dots  \mathbb{N} \cdots \mathbf{Z} \]


Here are examples of emphases.
{\sc According} to Equation \eqref{square}, our hypothesis is correct.\footnote{See also \citet{lev97}.}
I also include a picture of my {\bf dinner} {\it today} (Figure \ref{cook}).

Suppose $\exists n \in \mathbb{N}$ such that $\forall k \in B \subset \mathbb{R^{+}}, n > k$. 
\[ \text{$x < y$ and $y < z$}  \Rightarrow x < z \Longleftrightarrow x - z < 0 \]


% over- and under-braces
\[ f(x) = \overbrace{g(x)}^{\text{direct effect}} + \underbrace{h(x)}_{\text{indirect effect}} \not= f_0(x) \]


\section{Conclusioin}

\begin{center}
I give you several links (Some are in Japanese but helpful).
\end{center}


\begin{enumerate}
\item \url{http://www002.upp.so-net.ne.jp/latex/}
\item \url{http://www.latex-cmd.com/index.html}
\end{enumerate}

Advice: Be good friends with google.  He knows everything you might want to know. \\
Good luck.

\begin{thebibliography}{}


\bibitem[Blais {\it et al.} (1993) Blais {\it et al.}]{bla93} Blais, Andre, Donald Blake, and Stephane Dion, 1993, ``Do Parties Make a Difference? Parties and the Size of Government in Liberal Democracies,'' {\it American Journal of Political Science}, Vol.37, No.1, pp.40-52.

\bibitem[Levitt and Snyder (1997) Levitt and Snyder]{lev97} Levitt, Steven D. and James M. Snyder, Jr., 1997, ``The Impact of Federal Spending on House Election Outcomes,'' {\it Journal of Political Economy}, Vol.105, No.1, pp.30-53.

\end{thebibliography}



\end{document}

