# HG changeset patch # User tkaito@nw0534.st.ie.u-ryukyu.ac.jp # Date 1235470074 -32400 # Node ID 82281024ce1f1c8ae856ed0352fd4270f22547ac # Parent 8ebab2df59b0e5f3c720c19d99b165e341ffc0f8 test diff -r 8ebab2df59b0 -r 82281024ce1f resume/A-6-1-055734.aux --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/resume/A-6-1-055734.aux Tue Feb 24 19:07:54 2009 +0900 @@ -0,0 +1,25 @@ +\relax +\citation{cell} +\citation{cerium} +\citation{wataru} +\citation{blender} +\citation{chiaki} +\@writefile{toc}{\contentsline {section}{\numberline {1}はじめに}{1}} +\@writefile{toc}{\contentsline {section}{\numberline {2}CELL BROADBAND ENGINE}{1}} +\newlabel{sec:cell}{{2}{1}} +\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces Cell の構成要素}}{1}} +\newlabel{fig:cell-main}{{1}{1}} +\@writefile{toc}{\contentsline {section}{\numberline {3}Cerium}{1}} +\@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces Cell の構成要素}}{1}} +\newlabel{fig:cerium}{{2}{1}} +\citation{wataru} +\bibcite{cell}{1} +\bibcite{cerium}{2} +\bibcite{wataru}{3} +\bibcite{blender}{4} +\bibcite{chiaki}{5} +\@writefile{toc}{\contentsline {section}{\numberline {4}Texture}{2}} +\@writefile{lof}{\contentsline {figure}{\numberline {3}{\ignorespaces Texture の分割 (Tile) }}{2}} +\newlabel{fig:texture_split}{{3}{2}} +\@writefile{lot}{\contentsline {table}{\numberline {1}{\ignorespaces Scale を用いることによる実行速度の比較}}{2}} +\@writefile{toc}{\contentsline {section}{\numberline {5}まとめと今後の課題}{2}} diff -r 8ebab2df59b0 -r 82281024ce1f resume/A-6-1-055734.dvi Binary file resume/A-6-1-055734.dvi has changed diff -r 8ebab2df59b0 -r 82281024ce1f resume/A-6-1-055734.log --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/resume/A-6-1-055734.log Tue Feb 24 19:07:54 2009 +0900 @@ -0,0 +1,183 @@ +This is pTeX, Version 3.141592-p3.1.10 (utf8.euc) (Web2C 7.5.4) (format=platex-euc 2009.2.10) 24 FEB 2009 18:46 +**A-6-1-055734 +(./A-6-1-055734.tex +pLaTeX2e <2006/11/10>+0 (based on LaTeX2e <2003/12/01> patch level 0) +(/opt/local/share/texmf/ptex/platex/base/jarticle.cls +Document Class: jarticle 2006/06/27 v1.6 Standard pLaTeX class +\c@@paper=\count81 +(/opt/local/share/texmf/ptex/platex/base/jsize10.clo +File: jsize10.clo 2006/06/27 v1.6 Standard pLaTeX file (size option) +) +\c@part=\count82 +\c@section=\count83 +\c@subsection=\count84 +\c@subsubsection=\count85 +\c@paragraph=\count86 +\c@subparagraph=\count87 +\c@figure=\count88 +\c@table=\count89 +\abovecaptionskip=\skip41 +\belowcaptionskip=\skip42 +\symmincho=\mathgroup4 +LaTeX Font Info: Overwriting symbol font `mincho' in version `bold' +(Font) JY1/mc/m/n --> JY1/gt/m/n on input line 601. +\toclineskip=\dimen118 +\@lnumwidth=\dimen119 +\bibindent=\dimen120 +\heisei=\count90 +) +(/opt/local/share/texmf-dist/tex/latex/graphics/graphicx.sty +Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR) + +(/opt/local/share/texmf-dist/tex/latex/graphics/keyval.sty +Package: keyval 1999/03/16 v1.13 key=value parser (DPC) +\KV@toks@=\toks15 +) +(/opt/local/share/texmf/tex/latex/graphics/dvipdfmx-contrib-latex/graphics.sty +Package: graphics 2001/07/07 v1.0n Standard LaTeX Graphics (DPC,SPQR) + +(/opt/local/share/texmf-dist/tex/latex/graphics/trig.sty +Package: trig 1999/03/16 v1.09 sin cos tan (DPC) +) +(/opt/local/share/texmf-dist/tex/latex/graphics/graphics.cfg +File: graphics.cfg 2005/02/03 v1.3 graphics configuration of teTeX/TeXLive +) +Package graphics Info: Driver file: dvipdfm.def on input line 81. + +(/opt/local/share/texmf-dist/tex/latex/dvipdfm/dvipdfm.def +File: dvipdfm.def 1999/9/6 vx.x Driver-dependant file +)) +\Gin@req@height=\dimen121 +\Gin@req@width=\dimen122 +) (./fancyhdr.sty +\fancy@headwidth=\skip43 +\f@ncyO@elh=\skip44 +\f@ncyO@erh=\skip45 +\f@ncyO@olh=\skip46 +\f@ncyO@orh=\skip47 +\f@ncyO@elf=\skip48 +\f@ncyO@erf=\skip49 +\f@ncyO@olf=\skip50 +\f@ncyO@orf=\skip51 +) +(./picins.sty Option `picins' Version 3.0 Sep. 1992, TH Darmstadt/HRZ +\@BILD=\box41 +\@TEXT=\box42 +\d@breite=\dimen123 +\d@hoehe=\dimen124 +\d@xoff=\dimen125 +\d@yoff=\dimen126 +\d@shad=\dimen127 +\d@dash=\dimen128 +\d@boxl=\dimen129 +\d@pichskip=\dimen130 +\d@tmp=\dimen131 +\d@tmpa=\dimen132 +\d@bskip=\dimen133 +\hsiz@=\dimen134 +\p@getot@l=\dimen135 +\c@breite=\count91 +\c@hoehe=\count92 +\c@xoff=\count93 +\c@yoff=\count94 +\c@pos=\count95 +\c@shad=\count96 +\c@dash=\count97 +\c@boxl=\count98 +\c@zeilen=\count99 +\@changemode=\count100 +\c@piccaption=\count101 +\c@piccaptionpos=\count102 +\c@picpos=\count103 +\c@whole=\count104 +\c@half=\count105 +\c@tmp=\count106 +\c@tmpa=\count107 +\c@tmpb=\count108 +\c@tmpc=\count109 +\c@tmpd=\count110 +\d@leftskip=\skip52 +\ptoti=\dimen136 +\ptotii=\dimen137 +\env@box=\box43 +\d@envdp=\dimen138 +\c@hsize=\count111 +\c@envdp=\count112 +\d@envb=\dimen139 +) + +LaTeX Warning: Unused global option(s): + [9.5pt]. + +(./A-6-1-055734.aux) +\openout1 = `A-6-1-055734.aux'. + +LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 22. +LaTeX Font Info: ... okay on input line 22. +LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 22. +LaTeX Font Info: ... okay on input line 22. +LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 22. +LaTeX Font Info: ... okay on input line 22. +LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 22. +LaTeX Font Info: ... okay on input line 22. +LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 22. +LaTeX Font Info: ... okay on input line 22. +LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 22. +LaTeX Font Info: ... okay on input line 22. +LaTeX Font Info: Checking defaults for JY1/mc/m/n on input line 22. +LaTeX Font Info: ... okay on input line 22. +LaTeX Font Info: Checking defaults for JT1/mc/m/n on input line 22. +LaTeX Font Info: ... okay on input line 22. +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <12> on input line 26. +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <8> on input line 26. +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <6> on input line 26. +LaTeX Font Info: Font shape `JT1/mc/bx/n' in size <14.4> not available +(Font) Font shape `JT1/gt/m/n' tried instead on input line 29. +LaTeX Font Info: Font shape `JY1/mc/bx/n' in size <14.4> not available +(Font) Font shape `JY1/gt/m/n' tried instead on input line 29. +File: image/Cell-main2.pdf Graphic file (type eps) + +File: image/Cerium.pdf Graphic file (type eps) + +Overfull \hbox (22.02818pt too wide) in paragraph at lines 68--69 + [] + [] + +File: pic/emblem-bitmap.pdf Graphic file (type eps) + + +Package Fancyhdr Warning: \headheight is too small (0.0pt): + Make it at least 20.37784pt. + We now make it that large for the rest of the document. + This may cause the page layout to be inconsistent, however. + +[1 + + +] +File: image/cerium_rendering_tile.pdf Graphic file (type eps) + +Overfull \hbox (3.60083pt too wide) in paragraph at lines 143--143 +[]\JY1/mc/m/n/7    \OT1/cmtt/m/n/7 tex_dest = (uint32*)manager->allocate(size +of(int)*all_pixel_num);[] + [] + +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <7> on input line 149. +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <5> on input line 149. +File: pic/emblem-bitmap.pdf Graphic file (type eps) + [2] (./A-6-1-055734.aux) ) +Here is how much of TeX's memory you used: + 831 strings out of 95542 + 9154 string characters out of 1190860 + 65165 words of memory out of 1500000 + 4015 multiletter control sequences out of 10000+50000 + 13424 words of font info for 53 fonts, out of 1200000 for 2000 + 14 hyphenation exceptions out of 8191 + 27i,15n,43p,213b,573s stack positions out of 5000i,500n,6000p,200000b,5000s + +Output written on A-6-1-055734.dvi (2 pages, 10744 bytes). diff -r 8ebab2df59b0 -r 82281024ce1f resume/A-6-1-055734.pdf Binary file resume/A-6-1-055734.pdf has changed diff -r 8ebab2df59b0 -r 82281024ce1f resume/A-6-1-055734.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/resume/A-6-1-055734.tex Tue Feb 24 19:07:54 2009 +0900 @@ -0,0 +1,1 @@ +\documentclass[twocolumn,twoside,9.5pt]{jarticle} % \usepackage[dvips]{graphicx} \usepackage[dvipdfm]{graphicx} \usepackage{fancyhdr,picins} \pagestyle{fancy} \lhead{\parpic{ \includegraphics[height=1zw,clip,keepaspectratio]{pic/emblem-bitmap.pdf}} 琉球大学主催 工学部情報工学科 卒業研究発表会} \rhead{} \cfoot{} \setlength{\topmargin}{-1in \addtolength{\topmargin}{15mm}} \setlength{\headheight}{0mm} \setlength{\headsep}{5mm} \setlength{\oddsidemargin}{-1in \addtolength{\oddsidemargin}{11mm}} \setlength{\evensidemargin}{-1in \addtolength{\evensidemargin}{21mm}} \setlength{\textwidth}{181mm} \setlength{\textheight}{261mm} \setlength{\footskip}{0mm} \pagestyle{empty} \begin{document} \title{並列プログラミングを用いた \\\ ゲームフレームワークの設計と実装} \author{055734A 多賀野海人 指導教員 : 河野真治} \date{} \maketitle \thispagestyle{fancy} \section{はじめに} 我々はこれまで、PlayStation2,PlayStation3等の家庭用ゲーム機を用いたゲームプログラミングを、 リアルタイムプログラム、ユーザインターフェイスの学生実験の一環として行ってきた。 しかし、Cell を用いる場合、データの転送やタスクの生成等のこれまで学んだことのない技術が多く存在する。 これにより、学生実験の短期間では新しい技術を学ぶことに多くの時間を取られ、ゲームの完成度が向上が困難である。 本研究では、PlayStation3上でゲームプログラミングを行う際に、Cellの性能を活かしながら、 アーキテクチャに依存する記述を排除した、並列プログラミングを目的としている。 \section{CELL BROADBAND ENGINE} \label{sec:cell} Cell\cite{cell}はメインプロセッサである 1基の PowerPC Processor Element (PPE) と8基のデータ処理プロセッサアーキテクチャー Synergistic Processor Element (SPE) からなる非対称なマルチコアプロセッサであり、高速リングバスで構成されている。 \begin{figure}[hbp] \begin{center} \includegraphics[scale=0.35]{image/Cell-main2.pdf} \caption{Cell の構成要素} \label{fig:cell-main} \end{center} \end{figure} PPE は 複数の SPU をコアプロセッサとして使用することができる汎用プロセッサである。 SPE は、 PPE のような複雑なプログラム制御よりも、計算を単純に繰り返すマルチメディア系の処理を得意とする 演算系プロセッサである。LS (Local Store) という256KBのメモリを持つ。 本研究で用いた PS3Linux では、6個の SPU を制御することができる。 \section{Cerium} Cerium\cite{cerium} は、オブジェクトのデータやその振る舞い、 またはゲームのルールなどゲームを構成する場面 (Scene) を木構造で持つ Scene Graph、OSMesa に代表される Rendering Engine、 そしてそれらの実行単位を Task とし、 動的に全てのコアが動作する様な割り振りを行うカーネル TaskManager で構成されている。\cite{wataru} \begin{figure}[hbp] \begin{center} \includegraphics[scale=0.5]{image/Cerium.pdf} \caption{Cell の構成要素} \label{fig:cerium} \end{center} \end{figure} ゲーム内で使用するオブジェクトの生成は Blender \cite{blender}というフリーの 3D モデリングツールを使用し、Cerium 独自の xml 形式で出力する。\cite{chiaki} しかし、この xml ファイルの構成では、オブジェクトごとに Texture Image の情報 (base64) が xml ファイルに出力されることになる。そうなると、同じ Texture Image が何度も使用される xml ファイルの場合に無駄が生じることになる。将来的にネットワークの使用を考えているので、同じ Texture Image を用いたオブジェクトが増えるほどファイルの容量が増えるのは好ましくない。 そこで、オブジェクトごとに出力される Texture Image の情報は名前のみ (image-flag) とし、xml ファイルの最後に base64 に変換された情報を重複しないよう出力する仕様に変更した。 ただし、同じ名前の別 Texture Image や別の名前が同じ Texture Image の判別はできない。 \section{Texture} SPE を用いて計算を行う場合には、その処理(ソースコード)とデータを SPE の LS に転送して行う。 しかし、SPE の LS は 256KB しかないので、一度に Texture データを転送すると容量を超えてしまう可能性がある。 そこで、描画に必要な Texture データを分割して転送するという手法を用いる。 分割したデータを Tile とし、分割単位は 8 x 8 pixel とする。図\ref{fig:texture_split} \cite{wataru} \begin{figure}[htb] \begin{center} \includegraphics[scale=0.4]{image/cerium_rendering_tile.pdf} \caption{Texture の分割 (Tile) } \label{fig:texture_split} \end{center} \end{figure} 図\ref{fig:cerium}の SpanPack に含まれる Texture のアドレスはこの配列を 指している。描画に必要な Tile を計算し、メインメモリから DMA 転送し、pixel の 情報を取り出す。 また、描画されるオブジェクトが遠くにある場合、そのままの大きさの Texture は必要ないので、 縮小サイズの Texture (Scale) を用意し、Span の長さによって描画に必要な Texture を取捨選択することにする。 これにより、DMA 転送の待ち時間が減少し、ゲームの実行速度が向上すると考えられる。  \\ 以下に分割、Scale 作成のプログラムの一部と実行速度の比較を示す。 {\scriptsize \begin{verbatim} makeTapestry(int tex_w, int tex_h, uint32 *tex_src, int all_pixel_num, int scale_cnt) {   uint32 *tex_dest;   int t = 0;   int diff = TEXTURE_SPLIT_PIXEL;   int p_diff = 1;   tex_dest = (uint32*)manager->allocate(sizeof(int)*all_pixel_num);   while (scale_cnt) {     for (int y = 0; y < tex_h; y += diff) {       for (int x = 0; x < tex_w; x += diff) {         for (int j = 0; j < diff; j += p_diff) {           for (int i = 0; i < diff; i += p_diff) {             tex_dest[t++]              = tex_src[(x+i) + tex_w*(y+j)];           }         }       }     }     diff <<= 1;     p_diff <<= 1;     scale_cnt >>= 1;   }   return tex_dest; } \end{verbatim} } \begin{table}[htb] \begin{center} \caption{Scale を用いることによる実行速度の比較} \hbox to\hsize{\hfil \begin{tabular}{c|l|l} \hline \hline & Scaleなし(FPS) & Scaleあり (FPS)\\ \hline \hline Playstation 3 & 10.838925 & 13.514662 \\ \hline Mac OSX & 7.076905 & 8.532722\\ \hline \end{tabular}\hfil} \end{center} \end{table} \section{まとめと今後の課題} \thispagestyle{fancy} \begin{thebibliography}{9} \bibitem{cell}Sony Corporation. Cell BroadbandEngine \texttrademark アーキテクチャ, 2006 \bibitem{cerium} SourceForge.JP: Cerium Rendering Engine \verb|https//sourceforge.jp/projects/cerium/| \bibitem{wataru} Wataru MIYAGUNI. Cell 用の Fine-Grain Task Manager の実装, 2009 \bibitem{blender} blender.org \verb|http://www.blender.org/| \bibitem{chiaki} Chiaki SUGIYAMA. SceneGraph と StatePattern を用いたゲームフレームワークの設計と実装, 2008 \end{thebibliography} \end{document} \ No newline at end of file diff -r 8ebab2df59b0 -r 82281024ce1f resume/A-6-1-055734.tex~ --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/resume/A-6-1-055734.tex~ Tue Feb 24 19:07:54 2009 +0900 @@ -0,0 +1,1 @@ +\documentclass[twocolumn,twoside,9.5pt]{jarticle} % \usepackage[dvips]{graphicx} \usepackage[dvipdfm]{graphicx} \usepackage{fancyhdr,picins} \pagestyle{fancy} \lhead{\parpic{ \includegraphics[height=1zw,clip,keepaspectratio]{pic/emblem-bitmap.pdf}} 琉球大学主催 工学部情報工学科 卒業研究発表会} \rhead{} \cfoot{} \setlength{\topmargin}{-1in \addtolength{\topmargin}{15mm}} \setlength{\headheight}{0mm} \setlength{\headsep}{5mm} \setlength{\oddsidemargin}{-1in \addtolength{\oddsidemargin}{11mm}} \setlength{\evensidemargin}{-1in \addtolength{\evensidemargin}{21mm}} \setlength{\textwidth}{181mm} \setlength{\textheight}{261mm} \setlength{\footskip}{0mm} \pagestyle{empty} \begin{document} \title{並列プログラミングを用いた \\\ ゲームフレームワークの設計と実装} \author{055734A 多賀野海人 {}{} 指導教員 : 河野真治} \date{2009年 2月 24日 火曜日} \maketitle \thispagestyle{fancy} \section{はじめに} 我々はこれまで、PlayStation2,PlayStation3等の家庭用ゲーム機を用いたゲームプログラミングを、 リアルタイムプログラム、ユーザインターフェイスの学生実験の一環として行ってきた。 しかし、データの転送やタスクの生成等のこれまで学んだことのない技術が多く存在す。それにより、 学生実験の短期間では新しい技術を学ぶことに多くの時間を取られ、ゲームの完成度が向上が困難である。 本研究では、PlayStation3上でゲームプログラミングを行う際に、Cellの性能を活かしながら、 アーキテクチャに依存する記述を排除した、並列プログラミングを目的としている。 \section{CELL BROADBAND ENGINE} Cell\cite{1}はメインプロセッサである 1基の PowerPC Processor Element (PPE) と8基のデータ処理プロセッサアーキテクチャー Synergistic Processor Element (SPE) からなる非対称なマルチコアプロセッサであり、高速リングバスで構成されている。 \begin{figure}[hbp] \begin{center} \includegraphics[scale=0.35]{image/Cell-main2.pdf} \caption{Cell の構成要素} \label{fig:cell-main} \end{center} \end{figure} PPE は 複数の SPU をコアプロセッサとして使用することができる汎用プロセッサである。 SPE は、 PPE のような複雑なプログラム制御よりも、計算を単純に繰り返すマルチメディア系の処理を得意とする 演算系プロセッサである。LS (Local Store) という256KBのメモリを持つ。 本研究で用いた PS3Linux では、6個の SPU を制御することができる。 \section{Cerium} \section{Texture} \section{評価} \section{今後の課題} \thispagestyle{fancy} \begin{thebibliography}{9} \bibitem{1}Sony Corporation. Cell BroadbandEngine \texttrademark アーキテクチャ, 2006 \bibitem{2} \end{thebibliography} \end{document} \ No newline at end of file diff -r 8ebab2df59b0 -r 82281024ce1f resume/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/resume/Makefile Tue Feb 24 19:07:54 2009 +0900 @@ -0,0 +1,76 @@ +TARGET = A-6-1-055734 + +LATEX = /opt/local/bin/platex-utf8 +#LATEX = platex +BIBTEX = jbibtex +DVIPS = dvips +DVIPDFM = dvipdfmx +RM = rm -f +EBB = ebb + +# Option definitions +DVIPDFMOPT = +DVIPSOPT = -D 720 -mode esphi -O 0mm,0mm -N0 + +# Suffixes definitions +.SUFFIXES: .tex .dvi + +# Recipes +all: pdf# $(TARGET).ps + open $(TARGET).pdf + +dvi: + @echo "----------- make dvi file ($(TARGET).dvi) ----------" + $(LATEX) $(TARGET) + $(LATEX) $(TARGET) + $(LATEX) $(TARGET) +pdf: dvi + $(DVIPDFM) $(DVIPDFMOPT) $(TARGET) + +clean: + $(RM) *~ \#* + @if [ -f $(TARGET).aux ];\ + then $(RM) $(TARGET).aux;\ + fi + @if [ -f $(TARGET).log ];\ + then $(RM) $(TARGET).log;\ + fi + @if [ -f $(TARGET).toc ];\ + then $(RM) $(TARGET).toc;\ + fi + @if [ -f $(TARGET).lof ];\ + then $(RM) $(TARGET).lof;\ + fi + @if [ -f $(TARGET).lot ];\ + then $(RM) $(TARGET).lot;\ + fi + @if [ -f $(TARGET).big ];\ + then $(RM) $(TARGET).big;\ + fi + @if [ -f $(TARGET).bbl ];\ + then $(RM) $(TARGET).bbl;\ + fi + @if [ -f $(TARGET).ilg ];\ + then $(RM) $(TARGET).ilg;\ + fi + @if [ -f $(TARGET).idx ];\ + then $(RM) $(TARGET).idx;\ + fi + @if [ -f $(TARGET).ind ];\ + then $(RM) $(TARGET).ind;\ + fi + @if [ -f $(TARGET).dvi ];\ + then $(RM) $(TARGET).dvi;\ + fi + @if [ -f $(TARGET).pdf ];\ + then $(RM) $(TARGET).pdf;\ + fi + @if [ -f $(TARGET).out ];\ + then $(RM) $(TARGET).out;\ + fi + @if [ -f $(TARGET).bbl ];\ + then $(RM) $(TARGET).bbl;\ + fi + @if [ -f $(TARGET).blg ];\ + then $(RM) $(TARGET).blg;\ + fi diff -r 8ebab2df59b0 -r 82281024ce1f resume/Makefile~ --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/resume/Makefile~ Tue Feb 24 19:07:54 2009 +0900 @@ -0,0 +1,76 @@ +TARGET = finalutf8 + +LATEX = /opt/local/bin/platex-utf8 +#LATEX = platex +BIBTEX = jbibtex +DVIPS = dvips +DVIPDFM = dvipdfmx +RM = rm -f +EBB = ebb + +# Option definitions +DVIPDFMOPT = +DVIPSOPT = -D 720 -mode esphi -O 0mm,0mm -N0 + +# Suffixes definitions +.SUFFIXES: .tex .dvi + +# Recipes +all: pdf# $(TARGET).ps + open $(TARGET).pdf + +dvi: + @echo "----------- make dvi file ($(TARGET).dvi) ----------" + $(LATEX) $(TARGET) + $(LATEX) $(TARGET) + $(LATEX) $(TARGET) +pdf: dvi + $(DVIPDFM) $(DVIPDFMOPT) $(TARGET) + +clean: + $(RM) *~ \#* + @if [ -f $(TARGET).aux ];\ + then $(RM) $(TARGET).aux;\ + fi + @if [ -f $(TARGET).log ];\ + then $(RM) $(TARGET).log;\ + fi + @if [ -f $(TARGET).toc ];\ + then $(RM) $(TARGET).toc;\ + fi + @if [ -f $(TARGET).lof ];\ + then $(RM) $(TARGET).lof;\ + fi + @if [ -f $(TARGET).lot ];\ + then $(RM) $(TARGET).lot;\ + fi + @if [ -f $(TARGET).big ];\ + then $(RM) $(TARGET).big;\ + fi + @if [ -f $(TARGET).bbl ];\ + then $(RM) $(TARGET).bbl;\ + fi + @if [ -f $(TARGET).ilg ];\ + then $(RM) $(TARGET).ilg;\ + fi + @if [ -f $(TARGET).idx ];\ + then $(RM) $(TARGET).idx;\ + fi + @if [ -f $(TARGET).ind ];\ + then $(RM) $(TARGET).ind;\ + fi + @if [ -f $(TARGET).dvi ];\ + then $(RM) $(TARGET).dvi;\ + fi + @if [ -f $(TARGET).pdf ];\ + then $(RM) $(TARGET).pdf;\ + fi + @if [ -f $(TARGET).out ];\ + then $(RM) $(TARGET).out;\ + fi + @if [ -f $(TARGET).bbl ];\ + then $(RM) $(TARGET).bbl;\ + fi + @if [ -f $(TARGET).blg ];\ + then $(RM) $(TARGET).blg;\ + fi diff -r 8ebab2df59b0 -r 82281024ce1f resume/fancyhdr.sty --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/resume/fancyhdr.sty Tue Feb 24 19:07:54 2009 +0900 @@ -0,0 +1,485 @@ +% fancyhdr.sty version 3.2 +% Fancy headers and footers for LaTeX. +% Piet van Oostrum, +% Dept of Computer and Information Sciences, University of Utrecht, +% Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands +% Telephone: +31 30 2532180. Email: piet@cs.uu.nl +% ======================================================================== +% LICENCE: +% This file may be distributed under the terms of the LaTeX Project Public +% License, as described in lppl.txt in the base LaTeX distribution. +% Either version 1 or, at your option, any later version. +% ======================================================================== +% MODIFICATION HISTORY: +% Sep 16, 1994 +% version 1.4: Correction for use with \reversemargin +% Sep 29, 1994: +% version 1.5: Added the \iftopfloat, \ifbotfloat and \iffloatpage commands +% Oct 4, 1994: +% version 1.6: Reset single spacing in headers/footers for use with +% setspace.sty or doublespace.sty +% Oct 4, 1994: +% version 1.7: changed \let\@mkboth\markboth to +% \def\@mkboth{\protect\markboth} to make it more robust +% Dec 5, 1994: +% version 1.8: corrections for amsbook/amsart: define \@chapapp and (more +% importantly) use the \chapter/sectionmark definitions from ps@headings if +% they exist (which should be true for all standard classes). +% May 31, 1995: +% version 1.9: The proposed \renewcommand{\headrulewidth}{\iffloatpage... +% construction in the doc did not work properly with the fancyplain style. +% June 1, 1995: +% version 1.91: The definition of \@mkboth wasn't restored on subsequent +% \pagestyle{fancy}'s. +% June 1, 1995: +% version 1.92: The sequence \pagestyle{fancyplain} \pagestyle{plain} +% \pagestyle{fancy} would erroneously select the plain version. +% June 1, 1995: +% version 1.93: \fancypagestyle command added. +% Dec 11, 1995: +% version 1.94: suggested by Conrad Hughes +% CJCH, Dec 11, 1995: added \footruleskip to allow control over footrule +% position (old hardcoded value of .3\normalbaselineskip is far too high +% when used with very small footer fonts). +% Jan 31, 1996: +% version 1.95: call \@normalsize in the reset code if that is defined, +% otherwise \normalsize. +% this is to solve a problem with ucthesis.cls, as this doesn't +% define \@currsize. Unfortunately for latex209 calling \normalsize doesn't +% work as this is optimized to do very little, so there \@normalsize should +% be called. Hopefully this code works for all versions of LaTeX known to +% mankind. +% April 25, 1996: +% version 1.96: initialize \headwidth to a magic (negative) value to catch +% most common cases that people change it before calling \pagestyle{fancy}. +% Note it can't be initialized when reading in this file, because +% \textwidth could be changed afterwards. This is quite probable. +% We also switch to \MakeUppercase rather than \uppercase and introduce a +% \nouppercase command for use in headers. and footers. +% May 3, 1996: +% version 1.97: Two changes: +% 1. Undo the change in version 1.8 (using the pagestyle{headings} defaults +% for the chapter and section marks. The current version of amsbook and +% amsart classes don't seem to need them anymore. Moreover the standard +% latex classes don't use \markboth if twoside isn't selected, and this is +% confusing as \leftmark doesn't work as expected. +% 2. include a call to \ps@empty in ps@@fancy. This is to solve a problem +% in the amsbook and amsart classes, that make global changes to \topskip, +% which are reset in \ps@empty. Hopefully this doesn't break other things. +% May 7, 1996: +% version 1.98: +% Added % after the line \def\nouppercase +% May 7, 1996: +% version 1.99: This is the alpha version of fancyhdr 2.0 +% Introduced the new commands \fancyhead, \fancyfoot, and \fancyhf. +% Changed \headrulewidth, \footrulewidth, \footruleskip to +% macros rather than length parameters, In this way they can be +% conditionalized and they don't consume length registers. There is no need +% to have them as length registers unless you want to do calculations with +% them, which is unlikely. Note that this may make some uses of them +% incompatible (i.e. if you have a file that uses \setlength or \xxxx=) +% May 10, 1996: +% version 1.99a: +% Added a few more % signs +% May 10, 1996: +% version 1.99b: +% Changed the syntax of \f@nfor to be resistent to catcode changes of := +% Removed the [1] from the defs of \lhead etc. because the parameter is +% consumed by the \@[xy]lhead etc. macros. +% June 24, 1997: +% version 1.99c: +% corrected \nouppercase to also include the protected form of \MakeUppercase +% \global added to manipulation of \headwidth. +% \iffootnote command added. +% Some comments added about \@fancyhead and \@fancyfoot. +% Aug 24, 1998 +% version 1.99d +% Changed the default \ps@empty to \ps@@empty in order to allow +% \fancypagestyle{empty} redefinition. +% Oct 11, 2000 +% version 2.0 +% Added LPPL license clause. +% +% A check for \headheight is added. An errormessage is given (once) if the +% header is too large. Empty headers don't generate the error even if +% \headheight is very small or even 0pt. +% Warning added for the use of 'E' option when twoside option is not used. +% In this case the 'E' fields will never be used. +% +% Mar 10, 2002 +% version 2.1beta +% New command: \fancyhfoffset[place]{length} +% defines offsets to be applied to the header/footer to let it stick into +% the margins (if length > 0). +% place is like in fancyhead, except that only E,O,L,R can be used. +% This replaces the old calculation based on \headwidth and the marginpar +% area. +% \headwidth will be dynamically calculated in the headers/footers when +% this is used. +% +% Mar 26, 2002 +% version 2.1beta2 +% \fancyhfoffset now also takes h,f as possible letters in the argument to +% allow the header and footer widths to be different. +% New commands \fancyheadoffset and \fancyfootoffset added comparable to +% \fancyhead and \fancyfoot. +% Errormessages and warnings have been made more informative. +% +% Dec 9, 2002 +% version 2.1 +% The defaults for \footrulewidth, \plainheadrulewidth and +% \plainfootrulewidth are changed from \z@skip to 0pt. In this way when +% someone inadvertantly uses \setlength to change any of these, the value +% of \z@skip will not be changed, rather an errormessage will be given. + +% March 3, 2004 +% Release of version 3.0 + +% Oct 7, 2004 +% version 3.1 +% Added '\endlinechar=13' to \fancy@reset to prevent problems with +% includegraphics in header when verbatiminput is active. + +% March 22, 2005 +% version 3.2 +% reset \everypar (the real one) in \fancy@reset because spanish.ldf does +% strange things with \everypar between << and >>. + +\def\ifancy@mpty#1{\def\temp@a{#1}\ifx\temp@a\@empty} + +\def\fancy@def#1#2{\ifancy@mpty{#2}\fancy@gbl\def#1{\leavevmode}\else + \fancy@gbl\def#1{#2\strut}\fi} + +\let\fancy@gbl\global + +\def\@fancyerrmsg#1{% + \ifx\PackageError\undefined + \errmessage{#1}\else + \PackageError{Fancyhdr}{#1}{}\fi} +\def\@fancywarning#1{% + \ifx\PackageWarning\undefined + \errmessage{#1}\else + \PackageWarning{Fancyhdr}{#1}{}\fi} + +% Usage: \@forc \var{charstring}{command to be executed for each char} +% This is similar to LaTeX's \@tfor, but expands the charstring. + +\def\@forc#1#2#3{\expandafter\f@rc\expandafter#1\expandafter{#2}{#3}} +\def\f@rc#1#2#3{\def\temp@ty{#2}\ifx\@empty\temp@ty\else + \f@@rc#1#2\f@@rc{#3}\fi} +\def\f@@rc#1#2#3\f@@rc#4{\def#1{#2}#4\f@rc#1{#3}{#4}} + +% Usage: \f@nfor\name:=list\do{body} +% Like LaTeX's \@for but an empty list is treated as a list with an empty +% element + +\newcommand{\f@nfor}[3]{\edef\@fortmp{#2}% + \expandafter\@forloop#2,\@nil,\@nil\@@#1{#3}} + +% Usage: \def@ult \cs{defaults}{argument} +% sets \cs to the characters from defaults appearing in argument +% or defaults if it would be empty. All characters are lowercased. + +\newcommand\def@ult[3]{% + \edef\temp@a{\lowercase{\edef\noexpand\temp@a{#3}}}\temp@a + \def#1{}% + \@forc\tmpf@ra{#2}% + {\expandafter\if@in\tmpf@ra\temp@a{\edef#1{#1\tmpf@ra}}{}}% + \ifx\@empty#1\def#1{#2}\fi} +% +% \if@in +% +\newcommand{\if@in}[4]{% + \edef\temp@a{#2}\def\temp@b##1#1##2\temp@b{\def\temp@b{##1}}% + \expandafter\temp@b#2#1\temp@b\ifx\temp@a\temp@b #4\else #3\fi} + +\newcommand{\fancyhead}{\@ifnextchar[{\f@ncyhf\fancyhead h}% + {\f@ncyhf\fancyhead h[]}} +\newcommand{\fancyfoot}{\@ifnextchar[{\f@ncyhf\fancyfoot f}% + {\f@ncyhf\fancyfoot f[]}} +\newcommand{\fancyhf}{\@ifnextchar[{\f@ncyhf\fancyhf{}}% + {\f@ncyhf\fancyhf{}[]}} + +% New commands for offsets added + +\newcommand{\fancyheadoffset}{\@ifnextchar[{\f@ncyhfoffs\fancyheadoffset h}% + {\f@ncyhfoffs\fancyheadoffset h[]}} +\newcommand{\fancyfootoffset}{\@ifnextchar[{\f@ncyhfoffs\fancyfootoffset f}% + {\f@ncyhfoffs\fancyfootoffset f[]}} +\newcommand{\fancyhfoffset}{\@ifnextchar[{\f@ncyhfoffs\fancyhfoffset{}}% + {\f@ncyhfoffs\fancyhfoffset{}[]}} + +% The header and footer fields are stored in command sequences with +% names of the form: \f@ncy with for [eo], from [lcr] +% and from [hf]. + +\def\f@ncyhf#1#2[#3]#4{% + \def\temp@c{}% + \@forc\tmpf@ra{#3}%