Chang ,JX

рассказ и язык

Archive for the ‘Latex’ Category

latex hw tempelate

Posted by changjx on March 11, 2009

\documentclass[a4paper,12pt,fleqn]{article} %extreport
\usepackage[top=3cm,bottom=1cm,left=2cm,right=2cm]{geometry}
\usepackage{fancyhdr,color,xcolor,dsfont}
\usepackage{listings,ulem,booktabs,graphics,lastpage}
\usepackage{bm,amsmath,amssymb,amsthm,latexsym}
\usepackage{graphicx,fouriernc,hyperref} %fouriernc

\pagestyle{fancy}
\fancyhf{}
\lhead{Macro theory IV:HW1}
\chead{}
\rhead{ d96627003 Chang,JunXiang \quad \thepage/\pageref{LastPage} }

%\usepackage{pifont} fouriernc mathpazo concmath(it can’t use pdf) mathptmx
\def\be{\begin{enumerate}} % Begin Enumerate
\def\ee{\end{enumerate}} % End Enumerate
\def\en{\item} % ENtry (item)
\def\bi{\begin{itemize}} % Begin Itemize
\def\ei{\end{itemize}} % End Itemize

\def\[#1\]{\begin{align*}#1\end{align*}}
\DeclareSymbolFont{letters}{OML}{ccm}{m}{it}
\DeclareMathAlphabet{\mathcal}{OMS}{cmsy}{m}{n}

\renewcommand{\labelitemi}{$\blacktriangleright$}
\newcommand{\nf}{\textrm}
\newcommand{\dsp}{\displaystyle}
\newcommand{\intff}{\int^{\infty}_{0}}
\newcommand{\ert}{e^{-R(t)}}
\newcommand{\ev}{\mathcal{V}}
\newcommand{\dpa}{\partial}
\newcommand{\lw}{\leftarrow}
\newcommand{\llw}{\Leftarrow}
\newcommand{\rw}{\rightarrow}
\newcommand{\rrw}{\Rightarrow}
\newcommand{\ham}{\mathcal{H}}
\newcommand{\lam}{\pounds}
\newcommand{\grl}{\lambda}
\newcommand{\gra}{\alpha}
\newcommand{\grb}{\beta}
\newcommand{\grd}{\delta}
\newcommand{\grt}{\theta}
\newcommand{\limu}{\lim_{t\rw \infty}}
\newcommand{\cov}{\mathsf{Cov}}
\newcommand{\ex}{\mathds{E}}
\newcommand{\bx}{\pmb{X}}
\newcommand{\bgrb}{\pmb{\beta}}
\newcommand{\bgrt}{\pmb{\theta}}
\newcommand{\bA}{\pmb{A}}
\newcommand{\bu}{\pmb{u}}
\newcommand{\bve}{\pmb{\varepsilon}}
\newcommand{\lp}{\mathds{L}}
\newcommand{\I}{\nf{I}}
\newcommand{\iid}{\stackrel{\mathrm{iid}}{\sim}}
\linespread{1.3}
\pagecolor{white}
\color{black}

%=========================here start=======================%
\begin{document}

Posted in Latex | Leave a Comment »

beamer setup

Posted by changjx on May 31, 2008

\documentclass[fleqn,serif,hyperref={bookmarks=true}]{beamer}
\usepackage{bm,xcolor,color,listings,newcent,
graphicx,fancybox,pifont,latexsym} %txfonts,fouriernc

Read the rest of this entry »

Posted in Latex | Tagged: , | Leave a Comment »

beamer setting

Posted by changjx on November 7, 2007

small.tex
\documentclass[t,green]{beamer}

\usepackage{kmath,kerkis,listings} % lmodern
\newcommand{\script}{\fontfamily{pzc} \selectfont}

\setbeamercolor{normal text}{fg=black}% works
\usefonttheme{serif}
\setbeamerfont{structure}{series=\bfseries}
\usecolortheme{orchid}
\usetheme[height=7mm]{Boadilla} %Boadilla
\setbeamertemplate{background canvas}{\put(130,-200)
{\rotatebox{45}{\scalebox{5}{\textcolor{gray!15}{Draft}}}}}
\setbeamertemplate{background}[grid][step=0.2cm,color=blue!10]
\setbeamertemplate{itemize item}{$\blacksquare$} %\square
\setbeamertemplate{itemize subitem}{$\rightarrow$} %\vartriangleright \blacktriangleright
\setbeamertemplate{blocks}[rounded][shadow=true]

\lstset{numbers=left,tabsize=5,numberstyle=\tiny,
%frameround=tttt,frame=single,backgroundcolor=\color{gray!7},%
keywordstyle=\color{blue!80},
commentstyle=\color{black!40!green!100},
basicstyle=\small,stepnumber=1,numbersep=5pt, language={R}}

\title[A short proof]{A short proof of Fermat's Last Theorem}
\subtitle[Errors]{Estimation of numerical errors}
\author[R. Rostamian]{Rouben Rostamian}
\institute[UMBC]{
Department of Mathematics and Statistics\\
University of Maryland, Baltimore County\\
Baltimore, Maryland 21250\\[1ex]
\texttt{rostamian@umbc.edu}
}
\date[November 2004]{November 26, 2004}

\begin{document}

%--- the titlepage frame -------------------------%
\begin{frame}[plain]
\titlepage
\end{frame}

\begin{frame}
\frametitle{A sample slide}

A displayed formula:

\[
\int_{-\infty}^\infty e^{-x^2} \, dx = \sqrt{\pi}
\]

{\it An itemized list:}

\begin{itemize}
\item itemized item 1
\begin{itemize}
\item this is
\end{itemize}
\item itemized item 2
\item itemized item 3
\end{itemize}

\begin{theorem}
In a right triangle, the square of hypotenuse equals
the sum of squares of two other sides.
\end{theorem}

\begin{example}
we are here
\end{example}
\end{frame}

\begin{frame}
\frametitle{some combination}
\begin{align*}
P(9)P(9|7 \cup 9)&=\frac{4}{36}\times\frac{3}{9} \\
P(10)P(10|10 \cup 7)&=\frac{3}{36}\times\frac{3}{9}
\end{align*}

\begin{math}
\bordermatrix{&a_1&a_2&...&a_n\cr
b_1 & 1.2 & 3.3 & 5.1 & 2.8 \cr
c_1 & 4.7 & 7.8 & 2.4 & 1.9 \cr
... & ... & ... & ... & ... \cr
z_1 & 8.0 & 9.9 & 0.9 & 9.99 \cr}
\end{math}
\end{frame}

%\setbeamertemplate{background canvas}[vertical shading][top=red!15,bottom=gray!50]
\begin{frame}
\frametitle{math formulation}
\begin{align*}
{n-1\choose r}+{n-1 \choose r-1}&=\frac{(n-1)!}{r!(n-r-1)!}+\frac{(n-1)!}{(n-1)!(n-r)!}\\
= &\frac{(n-1)!(n-r)+(n-1)!r}{r!(n-r)!}\\ =& \quad \frac{(n-1)!n}{r!(n-r)!}=\frac{n!}{r!(n-r)!}={n \choose r}
\end{align*}

\begin{block}{titile here}
today is
\end{block}

\end{frame}

\begin{frame}[fragile]
\frametitle{Rcode}
\begin{lstlisting}
## Demo 2
setwd("c:/data/advsta")
two<-read.table(file="Exercise 1_1-04.txt",header=F,sep="") attach(two) #Q2-1 stem(V1) t21=table(V1) t22=t21/length(V1) #Q2-2 barplot(t21,axes=F,ylim=c(0,8), col=ifelse(t21==7,"indianred","white"),main="Ex1.1-4") axis(2,at=seq(0,8,by=1),col.axis="blue",lwd=2) text(7,7.3,"otypical clutch size",col="black",cex=1) \end{lstlisting} \end{frame} \end{document}

Posted in Latex | Leave a Comment »

Demo R

Posted by changjx on September 28, 2007

\documentclass[hyperref={dvips,colorlink,bookmarks}]{beamer}

\mode {
\definecolor{one}{rgb}{0.2,0.5,0.9} %0.1
\usecolortheme[named=one]{structure}
\usetheme{Madrid} %CambridgeUS Szeged
\useinnertheme{rectangles}
%\usecolortheme{rose}
\usepackage{multimedia}
\usepackage{amssymb,graphicx,listings}
\useoutertheme{infolines} %miniframes infolines
}

\title{Demo R}
\author{Advanced stat TA}
\institute{NTU AGEC}
\date{\today}

\begin{document}
\lstset{numbers=left,tabsize=5,numberstyle=\tiny,
keywordstyle=\color{blue!80},
commentstyle=\color{black!40!green!100},
basicstyle=\scriptsize,stepnumber=1,numbersep=5pt, language={R}}

\frame{\titlepage}

\frame{\frametitle{Demo 1}
\begin{block}{Ex1.1-4}
EX1.1-3 The $National \; geographic$
reported the following litter sizes for 20 lions.
\end{block}

\begin{itemize}
\item Construct a freq table. (\textcolor{blue}{stem() ,table(),length()})
\item Draw a freq histogram. (\textcolor{blue}{barplot()} )
\item Draw a relative freq histogram.
\item Is there a typical litter size.
\end{itemize}
Making yourself R

\begin{enumerate} []
\item locate your data file. (\textcolor{blue}{setwd()})
\item import data from the working space.(\textcolor{blue}{scan()})
\item coding…
\end{enumerate}
}

\begin{frame}[fragile]
\frametitle{Demo1 code}
\begin{block}{}
\begin{lstlisting}

setwd("c:/data/advsta")
one<-scan("Exercise 1_1-03.txt",sep=",")

#Q1-1
stem(one)
t1=table(one)
t2=t1/length(one)

#Q1-2~4
par(mfrow=c(1,2),bg="white",col.axis="black")
barplot(t1,ylab="Freq")
text(2,9,"<=typical little size",col="blue",cex=1,adj = c(-0.4,0))
barplot(t2,ylab="Density",col="lightblue")

\end{lstlisting}
\end{block}
\end{frame}

\begin{frame}
\frametitle{Demo2}
\begin{block}{Ex1.1-4}
Some ornithologists were interested in the clutch size of the common gallinule.
Thye observed the number of eggs in each of 117 nests.
\end{block}
\begin{itemize}
\item Construct a freq table.
\item Draw a histogram.
\item What is the mode?
\end{itemize}

\end{frame}
\end{document}

Posted in Latex | Leave a Comment »

Powerdot slides

Posted by changjx on September 25, 2007

Powerdot,likes beamer, is a screen presentation tool for latex. I prefer Powerdot to Beamer,it is simple,and has discernible math texts and good support of pstricks. However, the Beamer text is certainly more sharp and “impressive” than Powerdot.So, the choice of them is trade-off.
Each of them has its build-in styles,but the style colors can be changed with writing some syntax,makes it more flexible ones. Here is the code for Powerdot:


\documentclass[paper=screen,
mode=present,clock,style=aggie,
display=slidesnotes]{powerdot}

\pddefinepalettes{my}{
\definecolor{pdcolor1}{rgb}{0,0,0}
\definecolor{pdcolor2}{HTML}{0033FF}
\definecolor{pdcolor3}{rgb}{.96,.94,.89}
\definecolor{pdcolor4}{rgb}{.89,.85,.69}
}

\pdsetup{
lf=Applied Microeconometrics,
rf=chang,
palette=my
}

</code
>
the bold texts are main body to change the colors of style aggie.
pdcolor1-text color
pdcolor2-section text or line color
pdcolor3-background color
pdcolor4-bottom area colors
after set-up, we call this set-up by adding the syntax "palette=my" in pdsetup.

Of course, there are many latex packages support screen presentation.you may lik to this site for detail

Posted in Latex | Leave a Comment »

Construct beamer

Posted by changjx on September 25, 2007

How to set up your beamer structure color with color packages,bold text is key code.


\documentclass{beamer}
\usepackage{color}
\definecolor{one}{rgb}{0.4,0.6,0.9}
\usecolortheme[named=one]{structure}
\usecolortheme{rose}
\useoutertheme{infolines}
\usetheme{Madrid}
\title{123}
\author{abc}
\date{\today}
\begin{document}
\frame{\maketitle}

\begin{frame}
\frametitle{}
we
\end{frame}
\end{document}

Posted in Latex | Leave a Comment »