source_code_example/0000755000175000017500000000000011217236153013526 5ustar niconicosource_code_example/texput.log0000644000175000017500000000122511215014701015551 0ustar niconicoThis is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6) (format=pdflatex 2009.4.27) 13 JUN 2009 18:27 entering extended mode %&-line parsing enabled. **basic. ! Emergency stop. <*> basic. End of file on the terminal! Here is how much of TeX's memory you used: 4 strings out of 95086 113 string characters out of 1183255 45034 words of memory out of 1500000 3277 multiletter control sequences out of 10000+50000 3640 words of font info for 14 fonts, out of 1200000 for 2000 28 hyphenation exceptions out of 8191 0i,0n,0p,1b,6s stack positions out of 5000i,500n,6000p,200000b,5000s ! ==> Fatal error occurred, no output PDF file produced! source_code_example/foo.tex0000644000175000017500000000000011215015226015013 0ustar niconicosource_code_example/Makefile0000644000175000017500000000170111215015344015160 0ustar niconicoall: main.pdf # Is there a better way? # Hack to make it work when foo.code => foo.code.tex code/%.tex: code/%.* code/%.aux code/%.tex @rm code/*.aux $(MAKE) -C . code/%.tex: code/%.* pygmentize -f latex -O style='border=#000000,colorful,linenos=1' $< > $@ # Search each code file to format and include CODE_FILES:=$(shell ls code/|egrep -v '.tex$ |.aux$ ' ) CODE_FILES_DEP:=$(addprefix code/, $(CODE_FILES)) CODE_FILES_TGT:=$(addsuffix .tex, $(basename $(CODE_FILES_DEP))) main.pdf: $(shell ls *.tex) $(CODE_FILES_TGT) pdflatex main.tex > /dev/null .PHONY: run clean edit edit: gvim -S vim.sess run: evince main.pdf & clean: @# for each .tex file, remove the extension @# and delete its generated files @for PART in $(shell ls *.tex| sed 's:.tex::g'); do \ echo "*.out *.nav *.aux *.toc *.log *.snm *.pdf *.vrb" | \ sed "s:*:$$PART:g" | xargs rm -f; \ done @# Clean up the included code files too rm -f $(CODE_FILES_TGT) code/*.aux source_code_example/code/0000755000175000017500000000000011217236147014443 5ustar niconicosource_code_example/code/stdsort.cpp.tex0000644000175000017500000000033511212073527017445 0ustar niconico\begin{Verbatim}[commandchars=@\[\],numbers=left,firstnumber=1,stepnumber=1] T@PYbd[*] zort(T@PYbd[*] v) { std@PYbd[:]@PYbd[:]sort(v, v@PYbd[-]@PYbd[>]begin(), v@PYbd[-]@PYbd[>]end()); @PYay[return] v; } \end{Verbatim} source_code_example/code/inc_pygments.tex0000644000175000017500000000701611211065551017661 0ustar niconico\usepackage{fancyvrb} \usepackage{color} \newcommand\at{@} \newcommand\lb{[} \newcommand\rb{]} \newcommand\PYbg[1]{\textcolor[rgb]{0.00,0.50,0.00}{\textbf{#1}}} \newcommand\PYbf[1]{\textcolor[rgb]{0.73,0.40,0.53}{\textbf{#1}}} \newcommand\PYbe[1]{\textcolor[rgb]{0.40,0.40,0.40}{#1}} \newcommand\PYbd[1]{\textcolor[rgb]{0.73,0.13,0.13}{#1}} \newcommand\PYbc[1]{\textcolor[rgb]{0.00,0.50,0.00}{\textbf{#1}}} \newcommand\PYbb[1]{\textcolor[rgb]{0.40,0.40,0.40}{#1}} \newcommand\PYba[1]{\textcolor[rgb]{0.00,0.00,0.50}{\textbf{#1}}} \newcommand\PYaJ[1]{\textcolor[rgb]{0.73,0.13,0.13}{#1}} \newcommand\PYaK[1]{\textcolor[rgb]{0.00,0.00,1.00}{#1}} \newcommand\PYaH[1]{\fcolorbox[rgb]{1.00,0.00,0.00}{1,1,1}{#1}} \newcommand\PYaI[1]{\textcolor[rgb]{0.69,0.00,0.25}{#1}} \newcommand\PYaN[1]{\textcolor[rgb]{0.00,0.00,1.00}{\textbf{#1}}} \newcommand\PYaO[1]{\textcolor[rgb]{0.00,0.00,0.50}{\textbf{#1}}} \newcommand\PYaL[1]{\textcolor[rgb]{0.73,0.73,0.73}{#1}} \newcommand\PYaM[1]{\textcolor[rgb]{0.74,0.48,0.00}{#1}} \newcommand\PYaB[1]{\textcolor[rgb]{0.00,0.25,0.82}{#1}} \newcommand\PYaC[1]{\textcolor[rgb]{0.67,0.13,1.00}{#1}} \newcommand\PYaA[1]{\textcolor[rgb]{0.00,0.50,0.00}{#1}} \newcommand\PYaF[1]{\textcolor[rgb]{1.00,0.00,0.00}{#1}} \newcommand\PYaG[1]{\textcolor[rgb]{0.10,0.09,0.49}{#1}} \newcommand\PYaD[1]{\textcolor[rgb]{0.25,0.50,0.50}{\textit{#1}}} \newcommand\PYaE[1]{\textcolor[rgb]{0.63,0.00,0.00}{#1}} \newcommand\PYaZ[1]{\textcolor[rgb]{0.00,0.50,0.00}{\textbf{#1}}} \newcommand\PYaX[1]{\textcolor[rgb]{0.00,0.50,0.00}{#1}} \newcommand\PYaY[1]{\textcolor[rgb]{0.73,0.13,0.13}{#1}} \newcommand\PYaR[1]{\textcolor[rgb]{0.10,0.09,0.49}{#1}} \newcommand\PYaS[1]{\textcolor[rgb]{0.25,0.50,0.50}{\textit{#1}}} \newcommand\PYaP[1]{\textcolor[rgb]{0.49,0.56,0.16}{#1}} \newcommand\PYaQ[1]{\textcolor[rgb]{0.40,0.40,0.40}{#1}} \newcommand\PYaV[1]{\textcolor[rgb]{0.00,0.00,1.00}{\textbf{#1}}} \newcommand\PYaW[1]{\textcolor[rgb]{0.73,0.13,0.13}{#1}} \newcommand\PYaT[1]{\textcolor[rgb]{0.50,0.00,0.50}{\textbf{#1}}} \newcommand\PYaU[1]{\textcolor[rgb]{0.82,0.25,0.23}{\textbf{#1}}} \newcommand\PYaj[1]{\textcolor[rgb]{0.00,0.50,0.00}{#1}} \newcommand\PYak[1]{\textcolor[rgb]{0.73,0.40,0.53}{#1}} \newcommand\PYah[1]{\textcolor[rgb]{0.63,0.63,0.00}{#1}} \newcommand\PYai[1]{\textcolor[rgb]{0.10,0.09,0.49}{#1}} \newcommand\PYan[1]{\textcolor[rgb]{0.67,0.13,1.00}{\textbf{#1}}} \newcommand\PYao[1]{\textcolor[rgb]{0.73,0.40,0.13}{\textbf{#1}}} \newcommand\PYal[1]{\textcolor[rgb]{0.25,0.50,0.50}{\textit{#1}}} \newcommand\PYam[1]{\textbf{#1}} \newcommand\PYab[1]{\textit{#1}} \newcommand\PYac[1]{\textcolor[rgb]{0.73,0.13,0.13}{#1}} \newcommand\PYaa[1]{\textcolor[rgb]{0.50,0.50,0.50}{#1}} \newcommand\PYaf[1]{\textcolor[rgb]{0.25,0.50,0.50}{\textit{#1}}} \newcommand\PYag[1]{\textcolor[rgb]{0.40,0.40,0.40}{#1}} \newcommand\PYad[1]{\textcolor[rgb]{0.73,0.13,0.13}{#1}} \newcommand\PYae[1]{\textcolor[rgb]{0.40,0.40,0.40}{#1}} \newcommand\PYaz[1]{\textcolor[rgb]{0.00,0.63,0.00}{#1}} \newcommand\PYax[1]{\textcolor[rgb]{0.60,0.60,0.60}{\textbf{#1}}} \newcommand\PYay[1]{\textcolor[rgb]{0.00,0.50,0.00}{\textbf{#1}}} \newcommand\PYar[1]{\textcolor[rgb]{0.10,0.09,0.49}{#1}} \newcommand\PYas[1]{\textcolor[rgb]{0.73,0.13,0.13}{\textit{#1}}} \newcommand\PYap[1]{\textcolor[rgb]{0.00,0.50,0.00}{#1}} \newcommand\PYaq[1]{\textcolor[rgb]{0.53,0.00,0.00}{#1}} \newcommand\PYav[1]{\textcolor[rgb]{0.00,0.50,0.00}{\textbf{#1}}} \newcommand\PYaw[1]{\textcolor[rgb]{0.40,0.40,0.40}{#1}} \newcommand\PYat[1]{\textcolor[rgb]{0.10,0.09,0.49}{#1}} \newcommand\PYau[1]{\textcolor[rgb]{0.40,0.40,0.40}{#1}} source_code_example/code/bogosort.cpp.tex0000644000175000017500000000057011212073527017602 0ustar niconico\begin{Verbatim}[commandchars=@\[\],numbers=left,firstnumber=1,stepnumber=1] T@PYbd[*] bogosort(T@PYbd[*] v) { @PYay[while] (@PYbd[!] v@PYbd[-]@PYbd[>]is_ordered() ) { @PYaJ[int] x @PYbd[=] v@PYbd[-]@PYbd[>]length() @PYbd[*] rand(); @PYaJ[int] y @PYbd[=] v@PYbd[-]@PYbd[>]length() @PYbd[*] rand(); v@PYbd[-]@PYbd[>]shuffle(x, y); } @PYay[return] v; } \end{Verbatim} source_code_example/code/bogosort.cpp0000644000175000017500000000022711215015241016772 0ustar niconicoT* bogosort(T* v) { while (! v->is_ordered() ) { int x = v->length() * rand(); int y = v->length() * rand(); v->shuffle(x, y); } return v; } source_code_example/code/stdsort.cpp0000644000175000017500000000010211212074727016641 0ustar niconicoT* zort(T* v) { std::sort(v, v->begin(), v->end()); return v; } source_code_example/main.tex0000644000175000017500000000065411217235736015207 0ustar niconico\documentclass{beamer} \mode{ \usetheme{Frankfurt} } \usepackage[english]{babel} \include{code/inc_pygments} \begin{document} \begin{frame}{This is a test presentation} \begin{center} Using Beamer + gVim \end{center} \end{frame} \begin{frame}{Bogosort implementation} \include{code/bogosort} \end{frame} \begin{frame}{std sort implementation} \include{code/stdsort} \end{frame} \include{foo} \end{document}