# yt.workshop2012.fields / README

  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 Hi there. This is a template for using Dexy to produce talks for the 2012 yt workshop. Email me if you run into any problems (matthewturk@gmail.com). What Does Dexy Do For Us? ========================= Dexy will: * Automatically re-run any scripts it has detected have changed * Include the output of those scripts (stdout) in your presentation if requested * Include the syntax-highlighted content of those scripts in your presentation if requested * Allow you to version control your talk * Separate scripts from the talk: people can download and inspect them without having to copy/paste from a PDF If you don't want to use Dexy, and instead prefer something like Keynote or PowerPoint, please feel free to use those. It would be very helpful if you would include annotations on each slide that includes a script that point to a paste on paste.yt-project.org, so that we can include them in a repository at a later time. Getting Started =============== * First install Dexy, which can be done with pip: $pip install dexy Dexy's homepage is http://dexy.it , but for the most part we might be able to avoid detailed documentation. * In this directory, copy the example.tex_ file to a filename of your talk. (It has an extra underscore because I don't want it to get run by dexy.) You can name them however you like, but mine will be lowercase with underscores. You'll need to 'hg add' this file. * Now we have to initialize dexy. Run this command:$ dexy setup * I've already provided a config file, .dexy , which you can inspect or modify. It took me a while to decipher the contents when I started using dexy, but basically it describes associations between files and operations to perform on those files. How To Add Scripts ================== Inside the scripts directory, you can place new scripts which can then be included. While support exists for many different types, I have only ever used .py and .sh scripts. For examples on these, see the princeton tutorial I gave, here: https://bitbucket.org/MatthewTurk/2011-yt-princeton-tutorial/src To add a new script to the presentation, it should be under the scripts/ subdirectory. You then simply include it in the presentation with this little bit of magic: <> This tells Dexy to take the file scripts/inspect_grids.py, tell it that it's a filename, run it through pygments (a syntax highlighter) and then convert it to LaTeX. Whew! This won't actually *run* the script, but it will include the contents verbatim. To have Dexy run the script through Python, you have to additionally specify a 'py' filter, like so: <> So, for instance, this is how I set up a slide in my talk, using Beamer (and a few macros of my own.) \begin{frame}[fragile,t]{} \tiny <> \hline <> \end{frame} \fullimage{DD0087_Projection_x_Density_Density.png} This uses the "fullimage" command which I made for Beamer, but you should feel free to include images however you like. NOTE: If you want to include images *not* created from the output of running scripts, you have to use ../ to point back to the top level. How To Build Your Talk ====================== Now that you have a .tex file with some scripts and images included, just run: \$ dexy This will build any .tex files in your current directory. The resulting PDF will be under output/ .