Sha256: 0081ec9150e23761077d91477205ad6e10a913ad59318bd4bbbb7a995fb257e5
Contents?: true
Size: 862 Bytes
Versions: 6
Compression:
Stored size: 862 Bytes
Contents
\documentclass{article} \begin{document} % This demonstrates that a local variable defined in one chunk of Ruby code % can be picked up and used in a later chunk. {: x = 99999 :} \section{Some Pointed Questions} {: 25.times do :} \noindent Did you know that {: new_x = Math.sqrt(x) :} $\sqrt{{:= "%0.10f" % x :}} \approx {:= "%0.10f" % new_x :}$?\par {: x = new_x :} {: end :} Maybe if you're Rain Man. % The following shows that local variables don't persist across a 'require' % statement. Local variables defined in required file disappear on return. % Use a global variable $var to communicate between files. {: require './testbind' :} The `required' file set x to 1957, but it still reads {:= x :} in the \LaTeX\ doc. However, the global variable \$x set to 1957 in the required file is {:= $x :} %$ in the \LaTeX\ file. \end{document}
Version data entries
6 entries across 6 versions & 1 rubygems