Latex Plugin For Powerpoint

Written: 17 Jun 2019 by Jeremy Howard

The simplest solution is to use Powerpoint or similar software online, converting LaTeX to images, and to use their built-in version control. Answers to this question detail how you can diff such versions. You could use a Markdown-based solution. My eventual choice was AsciiDoctor because it's free, well-maintained, and does what I need. Insert LaTeX Equations into PowerPoint Presentation (PPT) with IguanaTeX (LaTeX Tips/Solution-43) - YouTube IguanaTex is a PowerPoint add-in which allows you to insert LaTeX equations into your. Easily use LaTeX formatting on your Confluence pages. Your LaTeX will be rendered instantly as PNG images. This also means that they will be included in exported PDFs. Add equations, units, and more to your Confluence pages. Intuitively add LaTeX representations of complex formula that will be rendered properly.

Latex Plugin For Powerpoint Slides

For creating presentations there’s a lot of features in PowerPoint that are hard to beat. So it’s not surprising that it’s a very popular tool—I see a lot of folks presenting PowerPoint presentations at machine learning talks that I attend. However, for equation-heavy academic publishing, many scientists prefer LaTeX. There are many reasons for this, but one key one is that LaTeX provides great support for creating equations. Whilst PowerPoint has an equation editor of its own, it is not a great match for LaTeX-using scientists, because:

  • It’s a pain to have to re-enter all your equations again into a new tool
  • The GUI approach takes a lot longer to enter equations compared to LaTeX (once you’ve learned LaTeX’s syntax). Although Microsoft Office equations have great keyboard support too, if you know where to look.

To avoid this problem, most scientists I’ve seen tend to copy screenshots from the LaTeX output of their papers, and paste them into PowerPoint. However this has it’s own problems, for instance:

  • The fonts are unlikely to match up correctly
  • It’s hard to resize the text to match the equation picture, and visa versa
  • The bitmap screenshot is low resolution, so doesn’t print well
  • The equations don’t reflow with the text, so have to be manually placed
  • Alignment commands don’t work, so alignment has to be done manually
  • …and so forth

If you’re one of those people looking to include LaTeX equations in PowerPoint, I’ve got some good news for you—have a look at this:

That’s right, this picture shows a real, editable, resizable, full-resolution equation in PowerPoint, created using LaTeX syntax! What’s the secret? Well… the secret is that Microsoft has actually included this functionality in PowerPoint for us, but they just totally butchered the front-end implementation, and failed to document it properly! So for my father’s day 2019 project, I created a little add-in to try to address that. Here’s how to use it.

How to use LaTeX in PowerPoint

To use LaTeX in PowerPoint you have to complete a few setup steps first. (I’ve only tested this on the latest Office 365 on Windows 10.)

  1. Download the latex PowerPoint add-in from here
  2. Put the add-in file somewhere convenient, and then add it to PowerPoint by clicking File then Options, clicking Add-ins in the options list on the left, then choose PowerPoint Add-ins from the Manage drop-down, and click Go. Choose Add New in the dialog box that pops up, and select the latex.ppam file you downloaded
  3. Click Enable Macros in the security notice that pops up.
Plugin

Latex Plugin For Powerpoint

You’ll now find that there’s a new LaTeX tab in your ribbon. Each time you open a new PowerPoint session you’ll need to switch it to “LaTeX mode”. To do so, click inside a text box (so the cursor is flashing) and choose Enable LaTeX in the LaTeX tab. This file will now be in LaTeX mode until you close and reopen PowerPoint. This is necessary to use the Input LaTeX button (see next paragraph), which is the only way I suggest to try to enter or edit LaTeX in PowerPoint.

Latex plugin for powerpoint slides

Now you are ready to insert your equation. Click inside a text box, and ensure the cursor is at the end of the text box (currently the macro only works if you’re at the end of the selected text box). Now click Input LaTeX in the LaTeX tab, and paste your equation into the input box that pops up (you can also type into it, of course, although I’d suggest you type your LaTeX into a regular text editor and paste it to PowerPoint from there, so you have a convenient source for all your equations’ LaTeX source). That’s it! The equation is now a regular PowerPoint equation, so when you click inside it, everything is editable, and you can also select the equation and change its font size, color, etc.

Latex plugin for powerpoint slides

You can even select the equation and add Wordart effects to it, if you want to really ham things up!…

Additional customization and tips

You can edit the equation using the normal Microsoft Office equation ribbon commands. If you want to see and edit the LaTeX source again, click Linear on the Equation ribbon. However, don’t edit this LaTeX directly in PowerPoint—it will mangle it as you type! Instead, copy it into an external editor and change it there, then create a new equation with the Input LaTeX command as above. (This is why it’s easier to simply keep all your original LaTeX source in a plain text file, if you’re not editing the equations using the equation ribbon.)

Apparently Microsoft hates productivity, or at least that’s the only reason I can think of that they decided to remove one of the most important features for productivity: the ability to customize and add keyboard shortcuts. So if you want to add a keyboard shortcut for Input LaTeX, you instead have to right-click on the Input LaTeX button in the ribbon, and choose Add to Quick Access Toolbar. You’ll now see an extra button in the very top left of your window (that’s the Quick Access Toolbar). Press and release Alt, and you’ll be able to see what numeric shortcut has been assigned to that button. Press and release Alt again to remove the shortcut overlays. Now you’re ready to use the keyboard shortcut. Click inside a textbox as before (at the end of it) and, while holding down Alt, press the number you noted down before. You should see the input box appear.

If you want to contribute improvements to the add-in, or just see how it works, head over to the latex-ppt repo. latex.pptm contains the macro, so you can edit it and try out your changes there. If you just want to see the (tiny amount) of code, I’ve popped it in the macros.bas file. My macros are very basic right now, so PRs with improvements and fixes are most welcome!

How this works

Microsoft have actually added all the necessary stuff to make LaTeX work in PowerPoint already. They’ve just not provided any UI for it, or documentation. And the editor doesn’t work. So I created a little add-in to automate the use of the features described below.

Microsoft Office supports a rather nifty plain text equation format called UnicodeMath, which used to be called Linear format. That’s what the PowerPoint ribbon still calls it, in fact. In the Equation ribbon you can click the Linear format button to type UnicodeMath directly. You can switch the linear format mode to LaTeX by typing Unicode character “Ⓣ” into an equation. Apparently that’s been in Microsoft Office for a while, but it’s only recently that the developer actually got around to writing it down. This post includes some additional useful information:

The LaTeX option supports all TeX control words appearing in Appendix B of the UnicodeMath spec. That includes many math operators, Greek letters, and various other symbols. The verbose LaTeX notations like begin{equation} and begin{matrix} aren’t supported, but the more concise TeX notations are supported, such as matrix{…} and pmatrix{…}. Fractions can be entered in the LaTeX form frac{…}{…} or in the TeX form {…over…}. displaymath is implied if the math zone fills the hard/soft paragraph and currently it can’t be turned on in inline math zones. Unicode math alphanumerics can be entered using control words like mathbf{}.

I hope you find this add-in and documentation useful! Many thanks to Murray Sargent of Microsoft who built the functionality in Office that this add-in uses.

This post is tagged: [technical] (click a tag for more posts in that category).

Latex Plugin For Powerpoint Free

Related Posts

-->

You can use PowerPoint add-ins to build engaging solutions for your users' presentations across platforms including Windows, iPad, Mac, and in a browser. You can create two types of PowerPoint add-ins:

Powerpoint
  • Use content add-ins to add dynamic HTML5 content to your presentations. For example, see the LucidChart Diagrams for PowerPoint add-in, which you can use to inject an interactive diagram from LucidChart into your deck.

  • Use task pane add-ins to bring in reference information or insert data into the presentation via a service. For example, see the Pexels - Free Stock Photos add-in, which you can use to add professional photos to your presentation.

PowerPoint add-in scenarios

The code examples in this article demonstrate some basic tasks for developing add-ins for PowerPoint. Please note the following:

  • To display information, these examples use the app.showNotification function, which is included in the Visual Studio Office Add-ins project templates. If you aren't using Visual Studio to develop your add-in, you'll need replace the showNotification function with your own code.

  • Several of these examples also use a Globals object that is declared beyond the scope of these functions as:var Globals = {activeViewHandler:0, firstSlideId:0};

  • To use these examples, your add-in project must reference Office.js v1.1 library or later.

Detect the presentation's active view and handle the ActiveViewChanged event

If you are building a content add-in, you will need to get the presentation's active view and handle the ActiveViewChanged event, as part of your Office.Initialize handler.

Note

Latex plugin for powerpoint free

In PowerPoint on the web, the Document.ActiveViewChanged event will never fire as Slide Show mode is treated as a new session. In this case, the add-in must fetch the active view on load, as shown in the following code sample.

In the following code sample:

  • The getActiveFileView function calls the Document.getActiveViewAsync method to return whether the presentation's current view is 'edit' (any of the views in which you can edit slides, such as Normal or Outline View) or 'read' (Slide Show or Reading View).

  • The registerActiveViewChanged function calls the addHandlerAsync method to register a handler for the Document.ActiveViewChanged event.

Navigate to a particular slide in the presentation

In the following code sample, the getSelectedRange function calls the Document.getSelectedDataAsync method to get the JSON object returned by asyncResult.value, which contains an array named slides. The slides array contains the ids, titles, and indexes of selected range of slides (or of the current slide, if multiple slides are not selected). It also saves the id of the first slide in the selected range to a global variable.

In the following code sample, the goToFirstSlide function calls the Document.goToByIdAsync method to navigate to the first slide that was identified by the getSelectedRange function shown previously.

Navigate between slides in the presentation

In the following code sample, the goToSlideByIndex function calls the Document.goToByIdAsync method to navigate to the next slide in the presentation.

Latex Plugin For Powerpoint Template

Get the URL of the presentation

In the following code sample, the getFileUrl function calls the Document.getFileProperties method to get the URL of the presentation file.

Create a presentation

Your add-in can create a new presentation, separate from the PowerPoint instance in which the add-in is currently running. The PowerPoint namespace has the createPresentation method for this purpose. When this method is called, the new presentation is immediately opened and displayed in a new instance of PowerPoint. Your add-in remains open and running with the previous presentation.

The createPresentation method can also create a copy of an existing presentation. The method accepts a base64-encoded string representation of an .pptx file as an optional parameter. The resulting presentation will be a copy of that file, assuming the string argument is a valid .pptx file. The FileReader class can be used to convert a file into the required base64-encoded string, as demonstrated in the following example.

See also