Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Recap                   Proposed System                                A                               L TEX              ...
Recap                              Proposed System                                           A                            ...
Recap                             Proposed System                                          A                              ...
Recap                               Proposed System                                            A                          ...
Recap                             Proposed System                                          A                              ...
Recap                           Proposed System                                        A                                  ...
Recap                             Proposed System                                          A                              ...
Recap                              Proposed System                                           A                            ...
Recap                            Proposed System                                         A                                ...
Recap                             Proposed System                                          A                              ...
Recap                           Proposed System                                        A                                  ...
Recap                           Proposed System                                        A                                  ...
Recap                           Proposed System                                        A                                  ...
Recap                           Proposed System                                        A                                  ...
Recap                           Proposed System                                        A                                  ...
Recap                           Proposed System                                        A                                  ...
Recap                           Proposed System                                        A                                  ...
Recap                           Proposed System                                        A                                  ...
Recap                            Proposed System                                         A                                ...
Recap                              Proposed System                                           A                            ...
Recap                                  Proposed System                                               A                    ...
Recap                       Proposed System                                    A                                   L TEX  ...
Upcoming SlideShare
Loading in …5
×

Animations On PDF Using Lua and LaTeX

1,807 views

Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Animations On PDF Using Lua and LaTeX

  1. 1. Recap Proposed System A L TEX ConTEXt Laying out Data Structure Diagrams Implementation Example ReferencesAlgorithm Animation in PDF Documents Manthosh Kumar T, Mukund M, Prakash E Supervisor: R S Milton Professor Department of CSE January 17, 2013 Manthosh, Mukund, Prakash Algorithm Animation in PDF Documents
  2. 2. Recap Proposed System A L TEX ConTEXt Laying out Data Structure Diagrams Implementation Example ReferencesTable of contents 1 Recap 2 Proposed System Interface Diagram User Classification Interface 3 A LTEX TikZ Sample Code animate.sty Sample Code 4 ConTEXt Metapost Sample Code t-animation Sample Code 5 Laying out Data Structure Diagrams 6 Implementation Example 7 References Manthosh, Mukund, Prakash Algorithm Animation in PDF Documents
  3. 3. Recap Proposed System A L TEX ConTEXt Laying out Data Structure Diagrams Implementation Example ReferencesAbstract The objective is to incorporate animated diagrams in PDF documents for educational use. TEXto generate the PDF documents. Sequence of layers with capabilities to play, pause, resume and rewind. To animate algorithms for data structures. Automatic layout of diagrams for lists and trees and a module for animation in TEXwith LuaTEXand JavaScript. Manthosh, Mukund, Prakash Algorithm Animation in PDF Documents
  4. 4. Recap Proposed System A L TEX ConTEXt Laying out Data Structure Diagrams Implementation Example ReferencesLiterature Survey Diagrams Metapost Asymptote PGF/Tikz Animations Animate.sty t-animation module Manthosh, Mukund, Prakash Algorithm Animation in PDF Documents
  5. 5. Recap Proposed System A L TEX Interface Diagram ConTEXt User Classification Laying out Data Structure Diagrams Interface Implementation Example ReferencesProposed System Develop an interface for animating data strcutures and algorithms TEX, TikZ/PGF, or MetaPost and Lua TEX A LuaLTEX ConTEXt animate.sty t-animation module Tikz/PGF or MetaPost Tikz/PGF or MetaPost Figure: Interface organization Manthosh, Mukund, Prakash Algorithm Animation in PDF Documents
  6. 6. Recap Proposed System A L TEX Interface Diagram ConTEXt User Classification Laying out Data Structure Diagrams Interface Implementation Example ReferencesInterface Diagram Creating animations using a high-level API (in TEX) Higher level API (in Lua) Low level API Wraps TEXcommands for animation, drawing into Lua functions for use in high level API Figure: Layers in the Interface Manthosh, Mukund, Prakash Algorithm Animation in PDF Documents
  7. 7. Recap Proposed System A L TEX Interface Diagram ConTEXt User Classification Laying out Data Structure Diagrams Interface Implementation Example ReferencesUser Classification Interface must follow sound human engineering, and make simple things easy and complex things possible End User uses high level API to create animations User uses low Level API to create algorithms Pro User and package them into a high level API Figure: End users and Expert users Manthosh, Mukund, Prakash Algorithm Animation in PDF Documents
  8. 8. Recap Proposed System A L TEX Interface Diagram ConTEXt User Classification Laying out Data Structure Diagrams Interface Implementation Example ReferencesInterface Wrapper Class The interface is a set of Lua functions Implement necessary new TEX commands Pro-user uses the interface to create a high-level API Manthosh, Mukund, Prakash Algorithm Animation in PDF Documents
  9. 9. Recap Proposed System A L TEX TikZ Sample Code ConTEXt animate.sty Sample Code Laying out Data Structure Diagrams Implementation Example References AUsing LTEX TikZ/PGF: drawing Easy to place the nodes in diagrams Provides a lot of functionalities for positioning and customization of diagrams. A animate.sty package helps create animations in LTEX- frames Manthosh, Mukund, Prakash Algorithm Animation in PDF Documents
  10. 10. Recap Proposed System A L TEX TikZ Sample Code ConTEXt animate.sty Sample Code Laying out Data Structure Diagrams Implementation Example ReferencesTikz Sample Code newcommand{drawElement}[4]{ draw (#2,0) node[draw,rectangle,color=#3, minimum width=#4] {#1}; } function beginPicture() tex.sprint([[noexpandbegin{tikzpicture}]]) end function drawElement(val,pos,color,spacing) tex.sprint([[noexpanddrawElement{]],val," }{",pos,"}{",color,"}{",spacing,"};") end function endPicture() tex.sprint([[noexpandend{tikzpicture}]]) end Manthosh, Mukund, Prakash Algorithm Animation in PDF Documents
  11. 11. Recap Proposed System A L TEX TikZ Sample Code ConTEXt animate.sty Sample Code Laying out Data Structure Diagrams Implementation Example ReferencesSample Code - Explained beginPicture() wraps the begin Picture TEXcommand drawElement() takes necessary arguments and draws array element endPicture() wraps the end Picture TEXcommand Manthosh, Mukund, Prakash Algorithm Animation in PDF Documents
  12. 12. Recap Proposed System A L TEX TikZ Sample Code ConTEXt animate.sty Sample Code Laying out Data Structure Diagrams Implementation Example Referencesanimate.sty Sample Code function beginAnimation() tex.sprint([[noexpandbegin{animateinline}[controls,wid end function newFrame() tex.sprint([[noexpandnewframe]]) end function endAnimation() tex.sprint([[noexpandend{animateinline}]]) end Manthosh, Mukund, Prakash Algorithm Animation in PDF Documents
  13. 13. Recap Proposed System A L TEX TikZ Sample Code ConTEXt animate.sty Sample Code Laying out Data Structure Diagrams Implementation Example ReferencesSample Code - Explained beginAnimation() wraps the TEX code for animation newFrame() creates a new frame endAnimation() ends the animation Manthosh, Mukund, Prakash Algorithm Animation in PDF Documents
  14. 14. Recap Proposed System A L TEX Metapost Sample Code ConTEXt t-animation Sample Code Laying out Data Structure Diagrams Implementation Example ReferencesUsing ConTEXt Metapost: mainline syntax and hence can be programmed easily ConTEXt can use it directly with PDF With t-animation module easy to use interface for creating animations Manthosh, Mukund, Prakash Algorithm Animation in PDF Documents
  15. 15. Recap Proposed System A L TEX Metapost Sample Code ConTEXt t-animation Sample Code Laying out Data Structure Diagrams Implementation Example ReferencesMetapost Sample Code defdrawElement[#1][#2]{ draw unitsquare scaled 1cm with color #2; dotlabel.bot(#1, origin); } function beginPicture() tex.sprint([[noexpandstartMPcode]]) end function drawElement(val,pos,color,spacing) tex.sprint([[noexpanddrawElement{]],val,"}{",color,"};") end function endPicture() tex.sprint([[noexpandstopMPcode]]) end Manthosh, Mukund, Prakash Algorithm Animation in PDF Documents
  16. 16. Recap Proposed System A L TEX Metapost Sample Code ConTEXt t-animation Sample Code Laying out Data Structure Diagrams Implementation Example ReferencesSample Code - Explained beginPicture() wraps the startMPcode conTEXt command drawElement() takes necessary arguments and draws array element endPicture() wraps the stopMPcode conTEXt command Manthosh, Mukund, Prakash Algorithm Animation in PDF Documents
  17. 17. Recap Proposed System A L TEX Metapost Sample Code ConTEXt t-animation Sample Code Laying out Data Structure Diagrams Implementation Example Referencest-animation Sample Code function beginAnimation() tex.sprint([[noexpand{startanimation[menu=yes]]]) end function newFrame() tex.sprint([[noexpandframe]]) end function endAnimation() tex.sprint([[noexpandstopanimation}]]) end Manthosh, Mukund, Prakash Algorithm Animation in PDF Documents
  18. 18. Recap Proposed System A L TEX Metapost Sample Code ConTEXt t-animation Sample Code Laying out Data Structure Diagrams Implementation Example ReferencesSample Code Explained startanimation[menu=yes] analogous to begin{animateinline} in animate.sty package. frame analogous to begin{newframe in animate.sty package. stopanimation analogous to end{animateinline} in animate.sty package. Manthosh, Mukund, Prakash Algorithm Animation in PDF Documents
  19. 19. Recap Proposed System A L TEX ConTEXt Laying out Data Structure Diagrams Implementation Example ReferencesLaying out Data Structure Diagrams Higher level API implemented using the Interface Algorithms for an illustrative set of data structures Manthosh, Mukund, Prakash Algorithm Animation in PDF Documents
  20. 20. Recap Proposed System A L TEX ConTEXt Laying out Data Structure Diagrams Implementation Example ReferencesLinear Array Search Function call : linearArraySearch{21,42,24,76,46,81,69,72,83,93,14,97}{69} Element to be Found : 69 Linear Search Animation : 21 42 24 76 46 81 69 72 83 93 14 97 0 1 2 3 4 5 6 7 8 9 10 11 j=0 Manthosh, Mukund, Prakash Algorithm Animation in PDF Documents
  21. 21. Recap Proposed System A L TEX ConTEXt Laying out Data Structure Diagrams Implementation Example References0s and 1s Separation Function call : digitSep{0,1,0,1,0,0,0,1,1,1,1,1} 0 1 0 1 0 0 0 1 1 1 1 1 0 1 2 3 4 5 6 7 8 9 10 11 j=0 Manthosh, Mukund, Prakash Algorithm Animation in PDF Documents
  22. 22. Recap Proposed System A L TEX ConTEXt Laying out Data Structure Diagrams Implementation Example ReferencesAlexander Grahn. The animate Package.http://www.ctan.org/tex-archive/macros/latex/contrib/animate/Jannis Pohlmann. Configurable Graph Drawing Algorithms forthe TikZ Graphics Description Language. IInstitute forTheoretical computer science, University of lbeckKonstantin Skodinis. Construction of linear tree-layouts whichare optimal with respect to vertex separation in linear time.Journal of Algorithms, Volume 47, Issue 1, April 2003John D. Hobby. Drawing Graphs with MetaPost. AT&T BellLaboratories, 1992.ConTEXt Wikihttp://wiki.contextgarden.net Manthosh, Mukund, Prakash Algorithm Animation in PDF Documents

×