Advertisement
Guest User

pgfSweave-example.tex

a guest
Oct 13th, 2011
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.53 KB | None | 0 0
  1. \documentclass{article}
  2. \newcommand{\hlnumber}[1]{\textcolor[rgb]{0.0823529411764706,0.0784313725490196,0.709803921568627}{#1}}%
  3. \newcommand{\hlfunctioncall}[1]{\textcolor[rgb]{1,0,0}{#1}}%
  4. \newcommand{\hlstring}[1]{\textcolor[rgb]{0.6,0.6,1}{#1}}%
  5. \newcommand{\hlkeyword}[1]{\textcolor[rgb]{0,0,0}{\textbf{#1}}}%
  6. \newcommand{\hlargument}[1]{\textcolor[rgb]{0.694117647058824,0.247058823529412,0.0196078431372549}{#1}}%
  7. \newcommand{\hlcomment}[1]{\textcolor[rgb]{0.8,0.8,0.8}{#1}}%
  8. \newcommand{\hlroxygencomment}[1]{\textcolor[rgb]{0,0.592156862745098,1}{#1}}%
  9. \newcommand{\hlformalargs}[1]{\textcolor[rgb]{0.0705882352941176,0.713725490196078,0.0705882352941176}{#1}}%
  10. \newcommand{\hleqformalargs}[1]{\textcolor[rgb]{0.0705882352941176,0.713725490196078,0.0705882352941176}{#1}}%
  11. \newcommand{\hlassignement}[1]{\textcolor[rgb]{0.215686274509804,0.215686274509804,0.384313725490196}{\textbf{#1}}}%
  12. \newcommand{\hlpackage}[1]{\textcolor[rgb]{0.588235294117647,0.713725490196078,0.145098039215686}{#1}}%
  13. \newcommand{\hlslot}[1]{\textit{#1}}%
  14. \newcommand{\hlsymbol}[1]{\textcolor[rgb]{0,0,0}{#1}}%
  15. \newcommand{\hlprompt}[1]{\textcolor[rgb]{0,0,0}{#1}}%
  16.  
  17. \usepackage{color}%
  18.  
  19. \newsavebox{\hlnormalsizeboxclosebrace}%
  20. \newsavebox{\hlnormalsizeboxopenbrace}%
  21. \newsavebox{\hlnormalsizeboxbackslash}%
  22. \newsavebox{\hlnormalsizeboxlessthan}%
  23. \newsavebox{\hlnormalsizeboxgreaterthan}%
  24. \newsavebox{\hlnormalsizeboxdollar}%
  25. \newsavebox{\hlnormalsizeboxunderscore}%
  26. \newsavebox{\hlnormalsizeboxand}%
  27. \newsavebox{\hlnormalsizeboxhash}%
  28. \newsavebox{\hlnormalsizeboxat}%
  29. \newsavebox{\hlnormalsizeboxpercent}%
  30. \newsavebox{\hlnormalsizeboxhat}%
  31. \newsavebox{\hlnormalsizeboxsinglequote}%
  32. \newsavebox{\hlnormalsizeboxbacktick}%
  33.  
  34. \setbox\hlnormalsizeboxopenbrace=\hbox{\begin{normalsize}\verb.{.\end{normalsize}}%
  35. \setbox\hlnormalsizeboxclosebrace=\hbox{\begin{normalsize}\verb.}.\end{normalsize}}%
  36. \setbox\hlnormalsizeboxlessthan=\hbox{\begin{normalsize}\verb.<.\end{normalsize}}%
  37. \setbox\hlnormalsizeboxdollar=\hbox{\begin{normalsize}\verb.$.\end{normalsize}}%
  38. \setbox\hlnormalsizeboxunderscore=\hbox{\begin{normalsize}\verb._.\end{normalsize}}%
  39. \setbox\hlnormalsizeboxand=\hbox{\begin{normalsize}\verb.&.\end{normalsize}}%
  40. \setbox\hlnormalsizeboxhash=\hbox{\begin{normalsize}\verb.#.\end{normalsize}}%
  41. \setbox\hlnormalsizeboxat=\hbox{\begin{normalsize}\verb.@.\end{normalsize}}%
  42. \setbox\hlnormalsizeboxbackslash=\hbox{\begin{normalsize}\verb.\.\end{normalsize}}%
  43. \setbox\hlnormalsizeboxgreaterthan=\hbox{\begin{normalsize}\verb.>.\end{normalsize}}%
  44. \setbox\hlnormalsizeboxpercent=\hbox{\begin{normalsize}\verb.%.\end{normalsize}}%
  45. \setbox\hlnormalsizeboxhat=\hbox{\begin{normalsize}\verb.^.\end{normalsize}}%
  46. \setbox\hlnormalsizeboxsinglequote=\hbox{\begin{normalsize}\verb.'.\end{normalsize}}%
  47. \setbox\hlnormalsizeboxbacktick=\hbox{\begin{normalsize}\verb.`.\end{normalsize}}%
  48. \setbox\hlnormalsizeboxhat=\hbox{\begin{normalsize}\verb.^.\end{normalsize}}%
  49.  
  50.  
  51.  
  52. \newsavebox{\hltinyboxclosebrace}%
  53. \newsavebox{\hltinyboxopenbrace}%
  54. \newsavebox{\hltinyboxbackslash}%
  55. \newsavebox{\hltinyboxlessthan}%
  56. \newsavebox{\hltinyboxgreaterthan}%
  57. \newsavebox{\hltinyboxdollar}%
  58. \newsavebox{\hltinyboxunderscore}%
  59. \newsavebox{\hltinyboxand}%
  60. \newsavebox{\hltinyboxhash}%
  61. \newsavebox{\hltinyboxat}%
  62. \newsavebox{\hltinyboxpercent}%
  63. \newsavebox{\hltinyboxhat}%
  64. \newsavebox{\hltinyboxsinglequote}%
  65. \newsavebox{\hltinyboxbacktick}%
  66.  
  67. \setbox\hltinyboxopenbrace=\hbox{\begin{tiny}\verb.{.\end{tiny}}%
  68. \setbox\hltinyboxclosebrace=\hbox{\begin{tiny}\verb.}.\end{tiny}}%
  69. \setbox\hltinyboxlessthan=\hbox{\begin{tiny}\verb.<.\end{tiny}}%
  70. \setbox\hltinyboxdollar=\hbox{\begin{tiny}\verb.$.\end{tiny}}%
  71. \setbox\hltinyboxunderscore=\hbox{\begin{tiny}\verb._.\end{tiny}}%
  72. \setbox\hltinyboxand=\hbox{\begin{tiny}\verb.&.\end{tiny}}%
  73. \setbox\hltinyboxhash=\hbox{\begin{tiny}\verb.#.\end{tiny}}%
  74. \setbox\hltinyboxat=\hbox{\begin{tiny}\verb.@.\end{tiny}}%
  75. \setbox\hltinyboxbackslash=\hbox{\begin{tiny}\verb.\.\end{tiny}}%
  76. \setbox\hltinyboxgreaterthan=\hbox{\begin{tiny}\verb.>.\end{tiny}}%
  77. \setbox\hltinyboxpercent=\hbox{\begin{tiny}\verb.%.\end{tiny}}%
  78. \setbox\hltinyboxhat=\hbox{\begin{tiny}\verb.^.\end{tiny}}%
  79. \setbox\hltinyboxsinglequote=\hbox{\begin{tiny}\verb.'.\end{tiny}}%
  80. \setbox\hltinyboxbacktick=\hbox{\begin{tiny}\verb.`.\end{tiny}}%
  81. \setbox\hltinyboxhat=\hbox{\begin{tiny}\verb.^.\end{tiny}}%
  82.  
  83.  
  84.  
  85. \newsavebox{\hlscriptsizeboxclosebrace}%
  86. \newsavebox{\hlscriptsizeboxopenbrace}%
  87. \newsavebox{\hlscriptsizeboxbackslash}%
  88. \newsavebox{\hlscriptsizeboxlessthan}%
  89. \newsavebox{\hlscriptsizeboxgreaterthan}%
  90. \newsavebox{\hlscriptsizeboxdollar}%
  91. \newsavebox{\hlscriptsizeboxunderscore}%
  92. \newsavebox{\hlscriptsizeboxand}%
  93. \newsavebox{\hlscriptsizeboxhash}%
  94. \newsavebox{\hlscriptsizeboxat}%
  95. \newsavebox{\hlscriptsizeboxpercent}%
  96. \newsavebox{\hlscriptsizeboxhat}%
  97. \newsavebox{\hlscriptsizeboxsinglequote}%
  98. \newsavebox{\hlscriptsizeboxbacktick}%
  99.  
  100. \setbox\hlscriptsizeboxopenbrace=\hbox{\begin{scriptsize}\verb.{.\end{scriptsize}}%
  101. \setbox\hlscriptsizeboxclosebrace=\hbox{\begin{scriptsize}\verb.}.\end{scriptsize}}%
  102. \setbox\hlscriptsizeboxlessthan=\hbox{\begin{scriptsize}\verb.<.\end{scriptsize}}%
  103. \setbox\hlscriptsizeboxdollar=\hbox{\begin{scriptsize}\verb.$.\end{scriptsize}}%
  104. \setbox\hlscriptsizeboxunderscore=\hbox{\begin{scriptsize}\verb._.\end{scriptsize}}%
  105. \setbox\hlscriptsizeboxand=\hbox{\begin{scriptsize}\verb.&.\end{scriptsize}}%
  106. \setbox\hlscriptsizeboxhash=\hbox{\begin{scriptsize}\verb.#.\end{scriptsize}}%
  107. \setbox\hlscriptsizeboxat=\hbox{\begin{scriptsize}\verb.@.\end{scriptsize}}%
  108. \setbox\hlscriptsizeboxbackslash=\hbox{\begin{scriptsize}\verb.\.\end{scriptsize}}%
  109. \setbox\hlscriptsizeboxgreaterthan=\hbox{\begin{scriptsize}\verb.>.\end{scriptsize}}%
  110. \setbox\hlscriptsizeboxpercent=\hbox{\begin{scriptsize}\verb.%.\end{scriptsize}}%
  111. \setbox\hlscriptsizeboxhat=\hbox{\begin{scriptsize}\verb.^.\end{scriptsize}}%
  112. \setbox\hlscriptsizeboxsinglequote=\hbox{\begin{scriptsize}\verb.'.\end{scriptsize}}%
  113. \setbox\hlscriptsizeboxbacktick=\hbox{\begin{scriptsize}\verb.`.\end{scriptsize}}%
  114. \setbox\hlscriptsizeboxhat=\hbox{\begin{scriptsize}\verb.^.\end{scriptsize}}%
  115.  
  116.  
  117.  
  118. \newsavebox{\hlfootnotesizeboxclosebrace}%
  119. \newsavebox{\hlfootnotesizeboxopenbrace}%
  120. \newsavebox{\hlfootnotesizeboxbackslash}%
  121. \newsavebox{\hlfootnotesizeboxlessthan}%
  122. \newsavebox{\hlfootnotesizeboxgreaterthan}%
  123. \newsavebox{\hlfootnotesizeboxdollar}%
  124. \newsavebox{\hlfootnotesizeboxunderscore}%
  125. \newsavebox{\hlfootnotesizeboxand}%
  126. \newsavebox{\hlfootnotesizeboxhash}%
  127. \newsavebox{\hlfootnotesizeboxat}%
  128. \newsavebox{\hlfootnotesizeboxpercent}%
  129. \newsavebox{\hlfootnotesizeboxhat}%
  130. \newsavebox{\hlfootnotesizeboxsinglequote}%
  131. \newsavebox{\hlfootnotesizeboxbacktick}%
  132.  
  133. \setbox\hlfootnotesizeboxopenbrace=\hbox{\begin{footnotesize}\verb.{.\end{footnotesize}}%
  134. \setbox\hlfootnotesizeboxclosebrace=\hbox{\begin{footnotesize}\verb.}.\end{footnotesize}}%
  135. \setbox\hlfootnotesizeboxlessthan=\hbox{\begin{footnotesize}\verb.<.\end{footnotesize}}%
  136. \setbox\hlfootnotesizeboxdollar=\hbox{\begin{footnotesize}\verb.$.\end{footnotesize}}%
  137. \setbox\hlfootnotesizeboxunderscore=\hbox{\begin{footnotesize}\verb._.\end{footnotesize}}%
  138. \setbox\hlfootnotesizeboxand=\hbox{\begin{footnotesize}\verb.&.\end{footnotesize}}%
  139. \setbox\hlfootnotesizeboxhash=\hbox{\begin{footnotesize}\verb.#.\end{footnotesize}}%
  140. \setbox\hlfootnotesizeboxat=\hbox{\begin{footnotesize}\verb.@.\end{footnotesize}}%
  141. \setbox\hlfootnotesizeboxbackslash=\hbox{\begin{footnotesize}\verb.\.\end{footnotesize}}%
  142. \setbox\hlfootnotesizeboxgreaterthan=\hbox{\begin{footnotesize}\verb.>.\end{footnotesize}}%
  143. \setbox\hlfootnotesizeboxpercent=\hbox{\begin{footnotesize}\verb.%.\end{footnotesize}}%
  144. \setbox\hlfootnotesizeboxhat=\hbox{\begin{footnotesize}\verb.^.\end{footnotesize}}%
  145. \setbox\hlfootnotesizeboxsinglequote=\hbox{\begin{footnotesize}\verb.'.\end{footnotesize}}%
  146. \setbox\hlfootnotesizeboxbacktick=\hbox{\begin{footnotesize}\verb.`.\end{footnotesize}}%
  147. \setbox\hlfootnotesizeboxhat=\hbox{\begin{footnotesize}\verb.^.\end{footnotesize}}%
  148.  
  149.  
  150.  
  151. \newsavebox{\hlsmallboxclosebrace}%
  152. \newsavebox{\hlsmallboxopenbrace}%
  153. \newsavebox{\hlsmallboxbackslash}%
  154. \newsavebox{\hlsmallboxlessthan}%
  155. \newsavebox{\hlsmallboxgreaterthan}%
  156. \newsavebox{\hlsmallboxdollar}%
  157. \newsavebox{\hlsmallboxunderscore}%
  158. \newsavebox{\hlsmallboxand}%
  159. \newsavebox{\hlsmallboxhash}%
  160. \newsavebox{\hlsmallboxat}%
  161. \newsavebox{\hlsmallboxpercent}%
  162. \newsavebox{\hlsmallboxhat}%
  163. \newsavebox{\hlsmallboxsinglequote}%
  164. \newsavebox{\hlsmallboxbacktick}%
  165.  
  166. \setbox\hlsmallboxopenbrace=\hbox{\begin{small}\verb.{.\end{small}}%
  167. \setbox\hlsmallboxclosebrace=\hbox{\begin{small}\verb.}.\end{small}}%
  168. \setbox\hlsmallboxlessthan=\hbox{\begin{small}\verb.<.\end{small}}%
  169. \setbox\hlsmallboxdollar=\hbox{\begin{small}\verb.$.\end{small}}%
  170. \setbox\hlsmallboxunderscore=\hbox{\begin{small}\verb._.\end{small}}%
  171. \setbox\hlsmallboxand=\hbox{\begin{small}\verb.&.\end{small}}%
  172. \setbox\hlsmallboxhash=\hbox{\begin{small}\verb.#.\end{small}}%
  173. \setbox\hlsmallboxat=\hbox{\begin{small}\verb.@.\end{small}}%
  174. \setbox\hlsmallboxbackslash=\hbox{\begin{small}\verb.\.\end{small}}%
  175. \setbox\hlsmallboxgreaterthan=\hbox{\begin{small}\verb.>.\end{small}}%
  176. \setbox\hlsmallboxpercent=\hbox{\begin{small}\verb.%.\end{small}}%
  177. \setbox\hlsmallboxhat=\hbox{\begin{small}\verb.^.\end{small}}%
  178. \setbox\hlsmallboxsinglequote=\hbox{\begin{small}\verb.'.\end{small}}%
  179. \setbox\hlsmallboxbacktick=\hbox{\begin{small}\verb.`.\end{small}}%
  180. \setbox\hlsmallboxhat=\hbox{\begin{small}\verb.^.\end{small}}%
  181.  
  182.  
  183.  
  184. \newsavebox{\hllargeboxclosebrace}%
  185. \newsavebox{\hllargeboxopenbrace}%
  186. \newsavebox{\hllargeboxbackslash}%
  187. \newsavebox{\hllargeboxlessthan}%
  188. \newsavebox{\hllargeboxgreaterthan}%
  189. \newsavebox{\hllargeboxdollar}%
  190. \newsavebox{\hllargeboxunderscore}%
  191. \newsavebox{\hllargeboxand}%
  192. \newsavebox{\hllargeboxhash}%
  193. \newsavebox{\hllargeboxat}%
  194. \newsavebox{\hllargeboxpercent}%
  195. \newsavebox{\hllargeboxhat}%
  196. \newsavebox{\hllargeboxsinglequote}%
  197. \newsavebox{\hllargeboxbacktick}%
  198.  
  199. \setbox\hllargeboxopenbrace=\hbox{\begin{large}\verb.{.\end{large}}%
  200. \setbox\hllargeboxclosebrace=\hbox{\begin{large}\verb.}.\end{large}}%
  201. \setbox\hllargeboxlessthan=\hbox{\begin{large}\verb.<.\end{large}}%
  202. \setbox\hllargeboxdollar=\hbox{\begin{large}\verb.$.\end{large}}%
  203. \setbox\hllargeboxunderscore=\hbox{\begin{large}\verb._.\end{large}}%
  204. \setbox\hllargeboxand=\hbox{\begin{large}\verb.&.\end{large}}%
  205. \setbox\hllargeboxhash=\hbox{\begin{large}\verb.#.\end{large}}%
  206. \setbox\hllargeboxat=\hbox{\begin{large}\verb.@.\end{large}}%
  207. \setbox\hllargeboxbackslash=\hbox{\begin{large}\verb.\.\end{large}}%
  208. \setbox\hllargeboxgreaterthan=\hbox{\begin{large}\verb.>.\end{large}}%
  209. \setbox\hllargeboxpercent=\hbox{\begin{large}\verb.%.\end{large}}%
  210. \setbox\hllargeboxhat=\hbox{\begin{large}\verb.^.\end{large}}%
  211. \setbox\hllargeboxsinglequote=\hbox{\begin{large}\verb.'.\end{large}}%
  212. \setbox\hllargeboxbacktick=\hbox{\begin{large}\verb.`.\end{large}}%
  213. \setbox\hllargeboxhat=\hbox{\begin{large}\verb.^.\end{large}}%
  214.  
  215.  
  216.  
  217. \newsavebox{\hlLargeboxclosebrace}%
  218. \newsavebox{\hlLargeboxopenbrace}%
  219. \newsavebox{\hlLargeboxbackslash}%
  220. \newsavebox{\hlLargeboxlessthan}%
  221. \newsavebox{\hlLargeboxgreaterthan}%
  222. \newsavebox{\hlLargeboxdollar}%
  223. \newsavebox{\hlLargeboxunderscore}%
  224. \newsavebox{\hlLargeboxand}%
  225. \newsavebox{\hlLargeboxhash}%
  226. \newsavebox{\hlLargeboxat}%
  227. \newsavebox{\hlLargeboxpercent}%
  228. \newsavebox{\hlLargeboxhat}%
  229. \newsavebox{\hlLargeboxsinglequote}%
  230. \newsavebox{\hlLargeboxbacktick}%
  231.  
  232. \setbox\hlLargeboxopenbrace=\hbox{\begin{Large}\verb.{.\end{Large}}%
  233. \setbox\hlLargeboxclosebrace=\hbox{\begin{Large}\verb.}.\end{Large}}%
  234. \setbox\hlLargeboxlessthan=\hbox{\begin{Large}\verb.<.\end{Large}}%
  235. \setbox\hlLargeboxdollar=\hbox{\begin{Large}\verb.$.\end{Large}}%
  236. \setbox\hlLargeboxunderscore=\hbox{\begin{Large}\verb._.\end{Large}}%
  237. \setbox\hlLargeboxand=\hbox{\begin{Large}\verb.&.\end{Large}}%
  238. \setbox\hlLargeboxhash=\hbox{\begin{Large}\verb.#.\end{Large}}%
  239. \setbox\hlLargeboxat=\hbox{\begin{Large}\verb.@.\end{Large}}%
  240. \setbox\hlLargeboxbackslash=\hbox{\begin{Large}\verb.\.\end{Large}}%
  241. \setbox\hlLargeboxgreaterthan=\hbox{\begin{Large}\verb.>.\end{Large}}%
  242. \setbox\hlLargeboxpercent=\hbox{\begin{Large}\verb.%.\end{Large}}%
  243. \setbox\hlLargeboxhat=\hbox{\begin{Large}\verb.^.\end{Large}}%
  244. \setbox\hlLargeboxsinglequote=\hbox{\begin{Large}\verb.'.\end{Large}}%
  245. \setbox\hlLargeboxbacktick=\hbox{\begin{Large}\verb.`.\end{Large}}%
  246. \setbox\hlLargeboxhat=\hbox{\begin{Large}\verb.^.\end{Large}}%
  247.  
  248.  
  249.  
  250. \newsavebox{\hlLARGEboxclosebrace}%
  251. \newsavebox{\hlLARGEboxopenbrace}%
  252. \newsavebox{\hlLARGEboxbackslash}%
  253. \newsavebox{\hlLARGEboxlessthan}%
  254. \newsavebox{\hlLARGEboxgreaterthan}%
  255. \newsavebox{\hlLARGEboxdollar}%
  256. \newsavebox{\hlLARGEboxunderscore}%
  257. \newsavebox{\hlLARGEboxand}%
  258. \newsavebox{\hlLARGEboxhash}%
  259. \newsavebox{\hlLARGEboxat}%
  260. \newsavebox{\hlLARGEboxpercent}%
  261. \newsavebox{\hlLARGEboxhat}%
  262. \newsavebox{\hlLARGEboxsinglequote}%
  263. \newsavebox{\hlLARGEboxbacktick}%
  264.  
  265. \setbox\hlLARGEboxopenbrace=\hbox{\begin{LARGE}\verb.{.\end{LARGE}}%
  266. \setbox\hlLARGEboxclosebrace=\hbox{\begin{LARGE}\verb.}.\end{LARGE}}%
  267. \setbox\hlLARGEboxlessthan=\hbox{\begin{LARGE}\verb.<.\end{LARGE}}%
  268. \setbox\hlLARGEboxdollar=\hbox{\begin{LARGE}\verb.$.\end{LARGE}}%
  269. \setbox\hlLARGEboxunderscore=\hbox{\begin{LARGE}\verb._.\end{LARGE}}%
  270. \setbox\hlLARGEboxand=\hbox{\begin{LARGE}\verb.&.\end{LARGE}}%
  271. \setbox\hlLARGEboxhash=\hbox{\begin{LARGE}\verb.#.\end{LARGE}}%
  272. \setbox\hlLARGEboxat=\hbox{\begin{LARGE}\verb.@.\end{LARGE}}%
  273. \setbox\hlLARGEboxbackslash=\hbox{\begin{LARGE}\verb.\.\end{LARGE}}%
  274. \setbox\hlLARGEboxgreaterthan=\hbox{\begin{LARGE}\verb.>.\end{LARGE}}%
  275. \setbox\hlLARGEboxpercent=\hbox{\begin{LARGE}\verb.%.\end{LARGE}}%
  276. \setbox\hlLARGEboxhat=\hbox{\begin{LARGE}\verb.^.\end{LARGE}}%
  277. \setbox\hlLARGEboxsinglequote=\hbox{\begin{LARGE}\verb.'.\end{LARGE}}%
  278. \setbox\hlLARGEboxbacktick=\hbox{\begin{LARGE}\verb.`.\end{LARGE}}%
  279. \setbox\hlLARGEboxhat=\hbox{\begin{LARGE}\verb.^.\end{LARGE}}%
  280.  
  281.  
  282.  
  283. \newsavebox{\hlhugeboxclosebrace}%
  284. \newsavebox{\hlhugeboxopenbrace}%
  285. \newsavebox{\hlhugeboxbackslash}%
  286. \newsavebox{\hlhugeboxlessthan}%
  287. \newsavebox{\hlhugeboxgreaterthan}%
  288. \newsavebox{\hlhugeboxdollar}%
  289. \newsavebox{\hlhugeboxunderscore}%
  290. \newsavebox{\hlhugeboxand}%
  291. \newsavebox{\hlhugeboxhash}%
  292. \newsavebox{\hlhugeboxat}%
  293. \newsavebox{\hlhugeboxpercent}%
  294. \newsavebox{\hlhugeboxhat}%
  295. \newsavebox{\hlhugeboxsinglequote}%
  296. \newsavebox{\hlhugeboxbacktick}%
  297.  
  298. \setbox\hlhugeboxopenbrace=\hbox{\begin{huge}\verb.{.\end{huge}}%
  299. \setbox\hlhugeboxclosebrace=\hbox{\begin{huge}\verb.}.\end{huge}}%
  300. \setbox\hlhugeboxlessthan=\hbox{\begin{huge}\verb.<.\end{huge}}%
  301. \setbox\hlhugeboxdollar=\hbox{\begin{huge}\verb.$.\end{huge}}%
  302. \setbox\hlhugeboxunderscore=\hbox{\begin{huge}\verb._.\end{huge}}%
  303. \setbox\hlhugeboxand=\hbox{\begin{huge}\verb.&.\end{huge}}%
  304. \setbox\hlhugeboxhash=\hbox{\begin{huge}\verb.#.\end{huge}}%
  305. \setbox\hlhugeboxat=\hbox{\begin{huge}\verb.@.\end{huge}}%
  306. \setbox\hlhugeboxbackslash=\hbox{\begin{huge}\verb.\.\end{huge}}%
  307. \setbox\hlhugeboxgreaterthan=\hbox{\begin{huge}\verb.>.\end{huge}}%
  308. \setbox\hlhugeboxpercent=\hbox{\begin{huge}\verb.%.\end{huge}}%
  309. \setbox\hlhugeboxhat=\hbox{\begin{huge}\verb.^.\end{huge}}%
  310. \setbox\hlhugeboxsinglequote=\hbox{\begin{huge}\verb.'.\end{huge}}%
  311. \setbox\hlhugeboxbacktick=\hbox{\begin{huge}\verb.`.\end{huge}}%
  312. \setbox\hlhugeboxhat=\hbox{\begin{huge}\verb.^.\end{huge}}%
  313.  
  314.  
  315.  
  316. \newsavebox{\hlHugeboxclosebrace}%
  317. \newsavebox{\hlHugeboxopenbrace}%
  318. \newsavebox{\hlHugeboxbackslash}%
  319. \newsavebox{\hlHugeboxlessthan}%
  320. \newsavebox{\hlHugeboxgreaterthan}%
  321. \newsavebox{\hlHugeboxdollar}%
  322. \newsavebox{\hlHugeboxunderscore}%
  323. \newsavebox{\hlHugeboxand}%
  324. \newsavebox{\hlHugeboxhash}%
  325. \newsavebox{\hlHugeboxat}%
  326. \newsavebox{\hlHugeboxpercent}%
  327. \newsavebox{\hlHugeboxhat}%
  328. \newsavebox{\hlHugeboxsinglequote}%
  329. \newsavebox{\hlHugeboxbacktick}%
  330.  
  331. \setbox\hlHugeboxopenbrace=\hbox{\begin{Huge}\verb.{.\end{Huge}}%
  332. \setbox\hlHugeboxclosebrace=\hbox{\begin{Huge}\verb.}.\end{Huge}}%
  333. \setbox\hlHugeboxlessthan=\hbox{\begin{Huge}\verb.<.\end{Huge}}%
  334. \setbox\hlHugeboxdollar=\hbox{\begin{Huge}\verb.$.\end{Huge}}%
  335. \setbox\hlHugeboxunderscore=\hbox{\begin{Huge}\verb._.\end{Huge}}%
  336. \setbox\hlHugeboxand=\hbox{\begin{Huge}\verb.&.\end{Huge}}%
  337. \setbox\hlHugeboxhash=\hbox{\begin{Huge}\verb.#.\end{Huge}}%
  338. \setbox\hlHugeboxat=\hbox{\begin{Huge}\verb.@.\end{Huge}}%
  339. \setbox\hlHugeboxbackslash=\hbox{\begin{Huge}\verb.\.\end{Huge}}%
  340. \setbox\hlHugeboxgreaterthan=\hbox{\begin{Huge}\verb.>.\end{Huge}}%
  341. \setbox\hlHugeboxpercent=\hbox{\begin{Huge}\verb.%.\end{Huge}}%
  342. \setbox\hlHugeboxhat=\hbox{\begin{Huge}\verb.^.\end{Huge}}%
  343. \setbox\hlHugeboxsinglequote=\hbox{\begin{Huge}\verb.'.\end{Huge}}%
  344. \setbox\hlHugeboxbacktick=\hbox{\begin{Huge}\verb.`.\end{Huge}}%
  345. \setbox\hlHugeboxhat=\hbox{\begin{Huge}\verb.^.\end{Huge}}%
  346.  
  347.  
  348. \def\urltilda{\kern -.15em\lower .7ex\hbox{\~{}}\kern .04em}%
  349.  
  350. \newcommand{\hlstd}[1]{\textcolor[rgb]{0,0,0}{#1}}%
  351. \newcommand{\hlnum}[1]{\textcolor[rgb]{0.16,0.16,1}{#1}}
  352. \newcommand{\hlesc}[1]{\textcolor[rgb]{1,0,1}{#1}}
  353. \newcommand{\hlstr}[1]{\textcolor[rgb]{1,0,0}{#1}}
  354. \newcommand{\hldstr}[1]{\textcolor[rgb]{0.51,0.51,0}{#1}}
  355. \newcommand{\hlslc}[1]{\textcolor[rgb]{0.51,0.51,0.51}{\it{#1}}}
  356. \newcommand{\hlcom}[1]{\textcolor[rgb]{0.51,0.51,0.51}{\it{#1}}}
  357. \newcommand{\hldir}[1]{\textcolor[rgb]{0,0.51,0}{#1}}
  358. \newcommand{\hlsym}[1]{\textcolor[rgb]{0,0,0}{#1}}
  359. \newcommand{\hlline}[1]{\textcolor[rgb]{0.33,0.33,0.33}{#1}}
  360. \newcommand{\hlkwa}[1]{\textcolor[rgb]{0,0,0}{\bf{#1}}}
  361. \newcommand{\hlkwb}[1]{\textcolor[rgb]{0.51,0,0}{#1}}
  362. \newcommand{\hlkwc}[1]{\textcolor[rgb]{0,0,0}{\bf{#1}}}
  363. \newcommand{\hlkwd}[1]{\textcolor[rgb]{0,0,0.51}{#1}}
  364.  
  365. \newenvironment{Houtput}{\raggedright}{%
  366. %
  367. }
  368.  
  369. \usepackage{tikz}
  370. \usetikzlibrary{external}
  371. \tikzexternalize[mode=list and make]
  372.  
  373. \usepackage[margin=1in]{geometry}
  374. \title{Minimal pgfSweave Example}
  375. \author{Cameron Bracken}
  376.  
  377. \usepackage{/Library/Frameworks/R.framework/Resources/share/texmf/tex/latex/Sweave}
  378. \begin{document}
  379.  
  380.  
  381.  
  382. \maketitle
  383. This example is identical to that in the Sweave manual and is intended to
  384. introduce pgfSweave and highlight the basic differences. Please refer to
  385. the pgfSweave vignette for more usage instructions.
  386.  
  387. We embed parts of the examples from the \texttt{kruskal.test} help page
  388. into a \LaTeX{} document:
  389.  
  390. \begin{Houtput}
  391. \hspace*{\fill}\\
  392. \hlstd{}\ttfamily\noindent
  393. \hlprompt{\usebox{\hlnormalsizeboxgreaterthan}{\ }}{\ }{\ }{\ }{\ }{\ }{\ }{\ }{\ }\hlcomment{\usebox{\hlnormalsizeboxhash}{\ }{\ }{\ }{\ }{\ }hey,{\ }a{\ }comment}\mbox{}
  394. \normalfont
  395. \hspace*{\fill}\\
  396. \hlstd{}\ttfamily\noindent
  397. \hlprompt{\usebox{\hlnormalsizeboxgreaterthan}{\ }}\hlfunctioncall{data}\hlkeyword{(}\hlsymbol{airquality}\hlkeyword{)}\mbox{}
  398. \normalfont
  399. \hspace*{\fill}\\
  400. \hlstd{}\ttfamily\noindent
  401. \hlprompt{\usebox{\hlnormalsizeboxgreaterthan}{\ }}\hlfunctioncall{print}\hlkeyword{(}\hlfunctioncall{kruskal.test}\hlkeyword{(}\hlsymbol{Ozone}{\ }\hlkeyword{\urltilda{}}{\ }\hlsymbol{Month}\hlkeyword{,}{\ }\hlargument{data}{\ }\hlargument{=}{\ }\hlsymbol{airquality}\hlkeyword{)}\hlkeyword{)}{\ }{\ }\hlcomment{\usebox{\hlnormalsizeboxhash}{\ }and{\ }another}\mbox{}
  402. \normalfont
  403. \hspace*{\fill}\\
  404. \hlstd{}\begin{Schunk}
  405. \begin{Soutput}
  406. Kruskal-Wallis rank sum test
  407.  
  408. data: Ozone by Month
  409. Kruskal-Wallis chi-squared = 29.2666, df = 4, p-value = 6.901e-06
  410. \end{Soutput}
  411.  
  412. \end{Schunk}
  413. \end{Houtput}
  414.  
  415. \noindent which shows that the location parameter of the Ozone distribution varies
  416. significantly from month to month. Finally we include a boxplot of the data:
  417.  
  418. \begin{figure}[!ht]
  419. \centering
  420. %notice the new options
  421. {\pgfkeys{/pgf/images/include external/.code={\includegraphics[width=3in]{#1}}}
  422. \begin{Houtput}
  423. \hspace*{\fill}\\
  424. \hlstd{}\ttfamily\noindent
  425. \hlprompt{\usebox{\hlnormalsizeboxgreaterthan}{\ }}\hlfunctioncall{boxplot}\hlkeyword{(}\hlsymbol{Ozone}{\ }\hlkeyword{\urltilda{}}{\ }\hlsymbol{Month}\hlkeyword{,}{\ }\hlargument{data}{\ }\hlargument{=}{\ }\hlsymbol{airquality}\hlkeyword{,}{\ }\hlargument{main}{\ }\hlargument{=}{\ }\hlstring{"Ozone{\ }distribution"}\hlkeyword{,}\hspace*{\fill}\\
  426. \hlstd{}\hlprompt{+{\ }}{\ }{\ }{\ }{\ }\hlargument{xlab}{\ }\hlargument{=}{\ }\hlstring{"Month"}\hlkeyword{,}{\ }\hlargument{ylab}{\ }\hlargument{=}{\ }\hlstring{"Concentration"}\hlkeyword{)}\mbox{}
  427. \normalfont
  428. \hspace*{\fill}\\
  429. \hlstd{}
  430. \end{Houtput}
  431.  
  432. \tikzsetnextfilename{pgfSweave-example-boxplot}
  433.  
  434. \tikzexternalfiledependsonfile{pgfSweave-example-boxplot}{pgfSweave-example-boxplot.tikz}
  435. \input{pgfSweave-example-boxplot.tikz}
  436. NA
  437. \caption{This is from pgfSweave. Text is typset by \LaTeX\ and so matches the
  438. font of the document.}
  439. \end{figure}
  440.  
  441.  
  442. \end{document}
  443.  
  444.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement