Because people complained to me about the formula feature in my PowerPointLaTeX add-in, which used a somewhat experimental approach to editing formula objects by adding an editing text shape that contained the formula code and that would be merged back into the formula as soon as you deselect it, I decided to rewrite it to use a standard modal dialog to edit formula objects:
The editor isn’t perfect (yet), but it certainly shouldn’t add any bugs to the add-in and solve some natural issues the old approach created.
The idea was pretty straight-forward but the actual UI design was a PITA due me not knowning the panel/flow/table layout concepts very well and the code still has some annoying quirks with auto-scroll, so I need to fix that later.
I almost rewrote the whole cache system, because I’m using a background thread for updating the preview (if the text is changed, a 500 msec timer is started which triggers an update) and the update accesses the cache system, which in turn accesses PowerPoint to return some data, which in turn is busy because of the modal dialog -> dead-lock.
The solution to this is very simple but was not obvious to me at first (I actually began to rewrite the cache system with a feeling that there should be an easier solution):
The background thread needs an Invoke call to update the preview picture because the control has been created by a different thread (the main thread) and the code to get an updated picture can simply be moved into Invoke delegate function.
This solved all my problems and made 4 hours of previous work and thinking about a new cache system obsolete
Download the new build at: http://code.google.com/p/powerpointtools/downloads/list
Cheers,
Andreas
Tags: Formula Object, Invoke, LaTeX, PowerPoint
I’ve written my last exam yesterday (except for two oral exams in September), so now I have got some spare time before I start working on my Bachelor Thesis tomorrow and I want to use it to wrap up a few things.
During this term I took part in a course that was both a (research) project/presentation/lecture thing, which was fun but also a lot of work.
I’ve already written about one mathematical aspect of it in my post about Analysis, Cauchy-Schwarz and Reciprocal Sums.
The project was about optimizing semi-conductor wiring placement. We wrote a small paper about our findings and the work it was based one – you can look download it here.
We also created a self-running presentation that doesn’t contain any Maths at all but makes heavy use of Flash animations (which were exported to .gif manually, which was a huge pain in the ass, which I will never do again if possible) to visualize all the concepts and algorithms.
You can download a PowerPoint 2007 (.pptx) version here or one that works with PowerPoint 2003 here.
For the Student’s I sat down and wrote a small Flash application to show the algorithms at work. It’s not obvious how it works, so let me explain the major points:
Last but not least I’ve also uploaded the current version of all my .fla and .as files. You can download it here.
ActionScript is a nice language and you can quickly learn it using the available resources from Adobe.
While ActionScript 2.0 is arguably weird, ActionScript 3.0 is quite logical and it’s syntax is straight-forward and consistent, too. You can’t say that about the IDE (Flash CS4), which is braindead, but if you’re only interested in writing ActionScript code, FlashDevelop is an excellent and free alternative.
This is it for now, maybe I’ll play around with Flash some more another time.
Cheers,
Andreas
Tags: ActionScript, Flash, MatLAB, PowerPoint, Semi-Conductor Optimization
I’ve finally managed to upload a version of my PowerPoint LaTeX add-in for PowerPoint 2007.
I’m just going to post a short Vimeo video here that shows how inline formulas work (the main feature):
http://www.vimeo.com/4442353I’ve tried to work on the add-in during my spring vacation but somehow I have instead spent all my time watching four seasons of House M.D. (which was totally worth it though
).
There are still some features like support for MikeTeX, code clean-ups, small bugfixes and a preference window that I should work on, but I don’t plan on selling it, so I don’t really care if it’s still somewhat work in progress.
I’m going to continue working on it when I have to use PowerPoint again.
You can check it out (and another add-in dubbed Language Painter that I wrote to fix some annoyances when writing presentations in languages different from your keyboard layout) at http://code.google.com/p/powerpointtools/.
Tags: AddIn, C#, LaTeX, MiKTeX, PowerPoint, TexPoint
Two weeks ago I had to give a presentation about Motion Retargeting, which I want to share with you now.
I created it due to me attending a seminar about the latest developments in Computer Graphics at university and my presentation was about the Siggraph ‘08 paper “Real-time Motion Retargeting to Highly Varied User-Created Morphologies” from Chris Hecker et al.
You can check it out on Chris Hecker’s homepage – his website also contains a bunch of other really cool articles and presentations from various conferences, so it certainly is worth taking a look at it.
I’ve also sifted through quite a lot of IK papers and lectures for my presentation to understand the later part about the IK solver in Spore and I’ve found a few links that are a nice read:
Ive created a huge PowerPoint presentation for my seminar
It includes a few videos (thanks again to Chris Hecker for uploading them and replying to my emails incredibly fast ´) and two awesome IK solvers that I’ve implemented with VBA macros´ to show how CCD and Particle IK solvers work.
You can find a zip with all the videos and high resolution images here (includes both a PPT 2003 file and a 2007 file). I’ve also uploaded a small version without videos, macros as PPT 2003 file here, if you don’t feel like downloading the 23 MB .zip file.
Here’s a YouTube video of the two IK solvers:
http://www.vimeo.com/3021779I’ve exported the code into an additional IK Playground presentation which contains just one slide and the two IK solvers with the setup you see in the video above. You can find the PPT 2003 version of it here and the 2007 one here.
I’ve zipped up the macros here if you want to use them in your own slides. I’ve also written a handy VBA form that allows one to edit everything more easily (the macros are hardly documented though, but if anyone really wants to use them and runs into problems – you can always drop me a line or two in a comment
)
BTW I’m not sure you know about it´, but Blender contains an awesome video editor – the UI needs some time to get used to, but the online documentation has improved a lot and with it, it works like a charm. Blender also supports some pretty professional filters, so it’s going to be my video editing tool of choice from now on.
Cheers,
Andreas
Tags: CCD, Inverse Kinematics, Macros, Motion Retargeting, Particle IK, PowerPoint, Spore, VBA
I have to do a presentation at university and it needs to be done in PowerPoint – OpenOffice and LaTeX are explicity not allowed.
Usually I’m all for Microsoft, but PowerPoint really lacks quite a few things that one would expect to be common in modern presentation software:
LaTeX is a 1000x more user-friendly in that regard to be honest. You can download some packages for free that automate everything that is worth automating and you won’t be bothered with updating all possible things manually everytime. It also usually supports more powerful slides with advanced navigation, etc.
Nonetheless if PowerPoint sucks, then Visual Basic for Applications for PowerPoint is one big brainfuck. The level of stupidity and general suckiness of VBA as language and the fact that you somehow don’t find up-to-date documentation about it online (no language specs?) and some braindead decisions in the PowerPoint macro API make it a real PITA to work with..
Anyway, I’ve written a macro to create a Table of Contents slide automatically for a PowerPoint presentation – it also allows for updating it later on and for customizing its title without overwriting it on update:
' create a Table of Contents slide as second slide (but you can move it around afterwards)
' you can use the macro to update an already generated one without it resetting the title or the slide's position
Const TOCTag = "TOC?Level"
Const TOCSlideName = "TOC?Slide"
Sub CreateTOCSlide()
Dim contentSlide As Slide
On Error Resume Next
Set contentSlide = ActivePresentation.Slides(TOCSlideName)
If contentSlide Is Nothing Then
Set contentSlide = ActivePresentation.Slides.AddSlide(2, ActivePresentation.Slides(1).CustomLayout)
contentSlide.Name = TOCSlideName
contentSlide.Layout = ppLayoutText
contentSlide.Shapes.title.TextFrame.TextRange.Text = "Table of Contents"
End If
UpdateTOCSlide
End Sub
Private Function FindTOCSlideWithTitle(title As String) As Slide
Dim cSlide As Slide
For Each cSlide In ActivePresentation.Slides
If cSlide.Tags(TOCTag) <> "" Then
If cSlide.Shapes.title.TextFrame.TextRange.Text = title Then
Set FindTOCSlideWithTitle = cSlide
Exit Function
End If
End If
Next cSlide
Set FindTOCSlideWithTitle = Nothing
End Function
Sub UpdateIndentationFromTOC()
Dim contentSlide As Slide
On Error Resume Next
Set contentSlide = ActivePresentation.Slides(TOCSlideName)
If contentSlide Is Nothing Then
Exit Sub
End If
Dim contentTextRange As TextRange2
Set contentTextRange = contentSlide.Shapes.Placeholders(2).TextFrame2.TextRange
Dim p As TextRange2
For Each p In contentTextRange.Paragraphs()
Dim cSlide As Slide
Set cSlide = FindTOCSlideWithTitle(Left(p.Text, Len(p.Text) - 1))
If Not cSlide Is Nothing Then
cSlide.Tags.Add TOCTag, p.ParagraphFormat.indentLevel
End If
Next p
End Sub
Private Sub UpdateTOCSlide()
Dim contentSlide As Slide
On Error Resume Next
Set contentSlide = ActivePresentation.Slides(TOCSlideName)
If contentSlide Is Nothing Then
Exit Sub
End If
Dim contentTextRange As TextRange2
Set contentTextRange = contentSlide.Shapes.Placeholders(2).TextFrame2.TextRange
contentSlide.Shapes.Placeholders(2).TextFrame2.DeleteText
contentTextRange.ParagraphFormat.Bullet.Type = ppBulletNumbered
Dim index As Integer
index = 1
For Each pSlide In ActivePresentation.Slides
Dim tagValue As Integer
tagValue = Val(pSlide.Tags(TOCTag))
If tagValue > 0 Then
contentTextRange.InsertAfter pSlide.Shapes.title.TextFrame.TextRange.Text & vbCrLf
contentTextRange.Lines(index, 1).ParagraphFormat.indentLevel = tagValue
contentTextRange.Lines(index, 1).ParagraphFormat.LeftIndent = 40 * tagValue
'contentTextRange.Lines(index).ParagraphFormat.Bullet.Type = ppBulletNumbered
index = index + 1
End If
Next pSlide
End Sub
Sub ToggleTOCEntrySlide()
Dim currentSlide As Slide
Set currentSlide = ActiveWindow.View.Slide
Dim newValue As String
If currentSlide.Tags(TOCTag) <> "" Then
newValue = ""
Else
newValue = "1"
End If
currentSlide.Tags.Add TOCTag, newValue
UpdateTOCSlide
End Sub
Private Function ClampIndentLevel(level As Integer) As Integer
If level < 1 Then
ClampIndentLevel = 1
ElseIf level > 5 Then
ClampIndentLevel = 5
Else
ClampIndentLevel = level
End If
End Function
Sub IndentTOCEntrySlide()
Dim currentSlide As Slide
Set currentSlide = ActiveWindow.View.Slide
currentSlide.Tags.Add TOCTag, ClampIndentLevel(1 + Val(currentSlide.Tags(TOCTag)))
UpdateTOCSlide
End Sub
Sub UnindentTOCEntrySlide()
Dim currentSlide As Slide
Set currentSlide = ActiveWindow.View.Slide
currentSlide.Tags.Add TOCTag, ClampIndentLevel(Val(currentSlide.Tags(TOCTag)) - 1)
UpdateTOCSlide
End Sub
The most recent version can be found in this .zip file here (TOC.bas).
Some remarks:
Hopefully this is useful for other poor souls who have to or try to work with PowerPoint’s macro facilities.
Cheers,
Andreas
Tags: Macro, PowerPoint, Table of Contents, VBA