Alessio Caiazza is sharing code with you
Bitbucket is a code hosting site. Unlimited public and private repositories. Free for small teams.
Don't show this againruby-beamer / ruby.sty
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | \RequirePackage{color}
%\RequirePackage{fancyvrb}
\RequirePackage{ifthen}
\RequirePackage{listings}
\definecolor{CommentColor}{rgb}{0.0,0.0,1.0}
\definecolor{ReferenceColor}{rgb}{0.8039215,0.0,0.0}
\definecolor{StringColor}{rgb}{0.0,0.545098,0.0}
\definecolor{FunctionColor}{rgb}{0.545098,0.1372549,0.1372549}
\definecolor{KeywordColor}{rgb}{0.545098,0.0,0.0}
\definecolor{VariableColor}{rgb}{0.545098,0.0,0.545098}
\definecolor{TypeColor}{rgb}{0.2745098,0.5098,0.7058823}
\providecommand{\codecomment}[1]{{\color{CommentColor}#1}}
\providecommand{\codereference}[1]{{\color{ReferenceColor}#1}}
\providecommand{\codestring}[1]{{\color{StringColor}#1}}
\providecommand{\codefunctionname}[1]{{\color{FunctionColor}#1}}
\providecommand{\codekeyword}[1]{{\color{KeywordColor}#1}}
\providecommand{\codevariablename}[1]{{\color{VariableColor}#1}}
\providecommand{\codetype}[1]{{\color{TypeColor}#1}}
\definecolor{RubyBack}{rgb}{1.0,0.95,0.9}
\definecolor{RubyFrame}{rgb}{0.9,0.0,0.0}
\definecolor{OutputBack}{rgb}{0.9,0.95,1.0}
\definecolor{OutputFrame}{rgb}{0.0,0.0,0.9}
\definecolor{ShellBack}{rgb}{0.95,1,0.9}
\definecolor{ShellFrame}{rgb}{0.0,0.9,0.0}
\newlength{\rubyindent}
\setlength{\rubyindent}{1ex}
\providecommand{\RubyIndent}[1]{\hspace{#1\rubyindent}}
\lstdefinestyle{rubysource}{language=Ruby,columns=fullflexible,showstringspaces=false,
aboveskip=0.4em,
belowskip=0em,
escapeinside=��,
numbers=left,
numberstyle=\tiny\texttt,
numbersep=1em,
xleftmargin=2em,
frame=lines,
framexleftmargin=2em,
backgroundcolor=\color{RubyBack},
rulecolor=\color{RubyFrame}
}
\lstdefinestyle{rubyout}{%
columns=fullflexible,showstringspaces=false,
%aboveskip=1pt,
%belowskip=1em,
escapeinside=��,
numbers=left,
numberstyle=\tiny\texttt,
numbersep=1em,
xleftmargin=2em,
frame=lines,
framexleftmargin=2em,
backgroundcolor=\color{OutputBack},
rulecolor=\color{OutputFrame}
}
\lstdefinestyle{shell}{%
columns=fullflexible,showstringspaces=false,
%aboveskip=1pt,
%belowskip=1em,
escapeinside=��,
numbers=none,
numberstyle=\tiny\texttt,
numbersep=1em,
xleftmargin=1em,
frame=lines,
framexleftmargin=1em,
backgroundcolor=\color{ShellBack},
rulecolor=\color{ShellFrame}
}
\definecolor{ReferenceColor}{rgb}{0.8039215,0.0,0.0}
\definecolor{FunctionColor}{rgb}{0.545098,0.1372549,0.1372549}
\definecolor{KeywordColor}{rgb}{0.545098,0.0,0.0}
\definecolor{VariableColor}{rgb}{0.545098,0.0,0.545098}
\definecolor{TypeColor}{rgb}{0.2745098,0.5098,0.7058823}
\providecommand{\rubysource}[2][]{%
\begin{otherlanguage}{english}
\lstinputlisting[style=rubysource,#1]{#2}
\end{otherlanguage}
}
\providecommand{\rubyout}[2][]{
\begin{otherlanguage}{english}
\lstinputlisting[style=rubyout,#1]{#2.out}
\end{otherlanguage}
}
\providecommand{\ShellInput}[2][]{
\begin{otherlanguage}{english}
\lstinputlisting[style=shell,#1]{#2}
\end{otherlanguage}
}
\newlength{\xmpsize}
\setlength{\xmpsize}{2cm}
\providecommand{\RubyXMP}[3][2cm]{%
\setlength{\xmpsize}{#1}%
\rubysource[#2]{#3.xmp}%
}
\providecommand{\XMPresult}[1]{\hfill{\makebox[\xmpsize][l]{\textit{>>\ #1}}}}
\newlength{\sidebysidewidth}
\providecommand{\sidebyside}[3][0.5]{%
\makebox{%
\setlength{\sidebysidewidth}{\textwidth}%
\setlength{\sidebysidewidth}{#1\sidebysidewidth}
\addtolength{\sidebysidewidth}{-0.5em}%
\begin{minipage}[t]{\sidebysidewidth}%
#2%
\end{minipage}%
\setlength{\sidebysidewidth}{\textwidth}%
\addtolength{\sidebysidewidth}{-#1\textwidth}%
\addtolength{\sidebysidewidth}{-0.5em}%
\hspace{1em}%
\begin{minipage}[t]{\sidebysidewidth}%
#3%
\end{minipage}}%
}
\newcommand{\exercise}[2]{%
\begin{block}{#1}
#2
\end{block}}
|