Latex Plugin For Powerpoint

Posted on  by 

-->

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:

  • 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

Below is a solution from Scott Hoge, who is a LaTeX whiz and wanted to find a nice way to use a Linux or Windows computer for making equations. Following the outline on Rob's page, one can generate the latex equations in a tex file, one equation per file. Then, run dvips with the -E option, to generate.eps output files. In this video, you will learn how to insert latex equations into powerpoint using a free addin called IguanaTexThis video series includes two videosPart 1: i. IguanaTex is a PowerPoint add-in which allows you to insert LaTeX equations into your PowerPoint presentation on Windows. It is distributed completely for free, along with its source code. This repository hosts the source code in a form that can be easily tracked, shared and discussed. IguanaTex is a free LaTeX Add-In for PowerPoint. Once you install the free addin provided by IguanaTex, you can add new equations to your PowerPoint slides just like in the example above. This is great for teachers or educators who use LaTex in the University including Algebra professors, Math professors but also Statistics courses, economy.

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

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.

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

Tips in this section:

Create accessible PowerPoint slides

Note: This will not create PowerPoint slides in which the math can be read by VoiceOver on an iOS or macOS device.

Issues:

There are several issues that factor in to creating PowerPoint slides that are easily readable by screen readers (primarily NVDA):

  1. With NVDA, you'll need both MathPlayer and MathType for the screen reader to read equations. Neither is required by JAWS, but more work is required on your part for creating slides that JAWS can read.
  2. Unfortunately there is no such thing in PowerPoint as an inline object, objects being things such as MathType equations. Thus inline MathType equations are problematic, regardless of whether they’re intended for sighted viewers or sight-impaired viewers. The equation editor Microsoft includes with PowerPoint does allow true inline equations, but those are not accessible.
  3. That being the case, it's best if you can avoid inline equations to the extent possible, and stick with display equations. If you're not familiar with the terms inline equation and display equation, an inline equation is what its name suggests. It's an equation that's part of your paragraph, and there is text before and sometimes after the equation. A display equation is in a paragraph of its own, sometimes centered on the line. Since there's no text to sequence with a display equation, specifying the order in which they are to be read is easier.
  4. Since MathType equations are 'floating' on a PowerPoint slide, they are not read in sequence with the text of a slide 'placeholder' (the part of the slide where you type text). Thus, if you use the normal 'visual' method of typing text, leaving empty spots for the equations, and move the equations into position later, NVDA will not read the equations with the text. It will likely read all of the text first, then all of the equations next. It will be difficult if not impossible to understand a slide read in this manner.
  5. PowerPoint allows you to add alt text to graphics, including MathType equation objects. If you're reading the slide with JAWS, that's what JAWS will read. Trouble is, with NVDA, it sees the alt text and also understands the content of the MathType equation itself. Thus, in design view (edit view), NVDA will read each equation twice. In Presentation view, JAWS will read the alt text and NVDA will look inside the MathType equation and read the MathML contained therein, resulting in the equations each being read once, regardless of which editor you use.
  6. These things considered, it seems best to create a PowerPoint file that works as well as it can for a specified screen reader. Then when the PowerPoint file is distributed, instructions would say 'the output is optimized for XXXX screen reader. Using other screen readers will produce less satisfactory output', or something to that effect.

Creating the slide:

These steps will assume you are creating ONLY display equations. If you need inline equations, the set of steps following this section will describe that. You can download the Accessible PowerPoint file if you want to open the one we used for writing this tip. It may help understand some of the points below if you see it on your own computer.

  1. Text placeholders. Rather than use only one text placeholder per slide, use a separate placeholder for each block of text – before the first equation, between equations, and after the last equation. This example shows 3 separate placeholders and 2 display equations:Note these are placeholders, not text boxes. There's a difference. If you prefer to use text boxes instead of placeholders, most of the time there will be no difference and for the purposes of these instructions it should not matter. We will continue to use the term 'placeholder'.
  2. Open the Selection Pane. The first step in determining reading order is opening the Selection Pane. To open the Selection Pane, look to the far right of the Home tab, and find the Editing group. Click Select, then Selection Pane. For my example slide above, I now see this (I'm using PowerPoint 2016; other versions will be similar):
  3. Arrange the slide's elements in the order you want them read. I see one possible issue already with the example above. Notice some things have unique names – Title 3, Object 5, and Object 7. The placeholders all have the same name; there are 3 instances of 'Content Placeholder 4'. Let's fix that. Click to select one of them in the Selection pane, and notice the corresponding placeholder is selected on the slide:I've selected the item at the top of the Selection Pane, which is logical to assume would be the first thing read. In reality, that's backward. It's the item at the bottom of the list that will be read first; the item at the top will be read last.
    The situation with three of the objects having the name 'Content Placeholder 4' is not a problem for the screen reader, and will not confuse it. If you want, you can rename them as you wish. To rename an item in the Selection Pane, double-click its name in the pane, and replace the old name with the new. Press Enter when you're finished renaming an item, or just double-click (twice) the next one you want to change.

Inline Equations

As already mentioned, slides with inline equations are more difficult to create if the goal is a slide that will make sense when read aloud with a screen reader. These steps should help:

  1. If it is at the end of a paragraph, you may treat an inline equation like a display equation, and the steps in the previous section will work. For inline equations that are not at the end of a paragraph, read on...
  2. If it is not at the end of a paragraph, type your text inside the placeholder up to the point where the equation will go. Move the equation into position. You may need to adjust the Line Spacing of the placeholder text so the text doesn't overlap the equation. In the shot below, the Line Spacing is at 1.2 lines, where the Line Spacing in the shot above is 0.9 lines. In PowerPoint 2016, the easiest way to set this is to right-click inside the placeholder you want to change, and choose 'Paragraph' from the contextual menu.
  3. Once you have the text in place preceding the equation, the equation in place, and the Line Spacing set, create (or copy & paste) another placeholder. Type the text that will follow the equation, and move it into position.
  4. Set the reading order as above. Note I've named the placeholder preceding the equation as 'Placeholder 1' and the placeholder following the equation 'Placeholder 1a'. You can choose names that work for you -- or don't rename them at all. It's your choice.

Using this process to create slides definitely adds some time to your preparation, but it's the best way to create a PowerPoint file with slides that are truly accessible.

Creating true inline equations in PowerPoint

Note: In this section, we'll refer to Word 2016 and PowerPoint 2016, but the process applies to Office 2016 and later, including the installed version of Office 365 (not the online version).

Situation

You're working in PowerPoint and you've been inserting MathType equations and moving them into position every time. If there is inline text that follows the equation, you must add enough space to allow for the equation. If you add text above the line containing the equation, or if you edit the text, you have to move the equation. It would be nice if the equations were truly inline, like in Word, and would flow with the text.

Background

PowerPoint doesn't allow for inline objects of any type — drawings, photos, logos, charts, etc. — and since MathType equations are 'objects' that are inserted onto the slide, they cannot be inline either. Therefore, the method described here uses MathType, but the equations produced for PowerPoint are not MathType equations; they're 'OMML' equations.

Note there is a different solution than what's presented here. If you'd rather, you can create the entire slide — bullets, text, and equations — as a single MathType object, then add that object to the slide. We present an alternative here.

Creating inline equations in PowerPoint

Since PowerPoint does not allow inline objects, nor any objects that are not Microsoft Office objects, we're going to use MathType to create the equation, but the equation that's actually on the PowerPoint slide will be an OMML equation, as described above. We'll also be using Word 2016, since it is able to create an OMML equation from MathType, and PowerPoint is not.

  1. Open MathType from the Applications folder or Dock (Mac) or the Start menu (Windows).
  2. In MathType's Preferences > Cut and Copy Preferences, choose 'MathML 2.0 (namespace attr)' from the MathML or TeX section. Click OK to close the dialog.
  3. Create the equation in MathType, then select & copy it ('cut' is actually better than 'copy') and paste it into the Word document. When you do, you'll see the MathType Paste dialog (screen shots here are from a Mac; Windows is similar):
  4. Choose the option to Create an OMML equation, and click OK.
  5. Click the blue tab to the left of the equation. If the blue tab isn't showing, click inside the equation, then click the blue tab. This will select the equation:Copy the equation (again, 'cut' is actually better than 'copy').
  6. On Mac proceed to step 8. On Windows, paste the equation onto the slide.
    1. If you clicked inside the equation, part of it will be shaded. If you didn't click inside, or if none of it is shaded, click inside and it should look something like this:
    2. Now 'select all'. The easiest way to do that is with the shortcut Ctrl+A. Now it looks like this:
    3. Now copy it — Ctrl+C.
  7. At the point in your slide's text where you want the equation, insert an equation from the Insert tab on the ribbon. It should look something like this:
  8. Don't click inside the gray area; just paste the equation you copied from Word. It should look something like this:
  9. If you're using Mac, depending on your PowerPoint configuration, you may see the Paste options icon. If you're using Windows, you can get to the Paste options by right-clicking before you paste. You don't need to do anything with the paste options but if you do, choose either Keep Source Formatting or Use Destination Theme. Do not select Keep Text Only.
    'Keep Source Formatting' will likely (depending on the equation's position in Word before you copied it) result in a 'display-style' equation. That is, the large operators (summation, in this example) will be larger, position of limits will be more relaxed, and fraction numerator and denominator will be the same size as your text on the slide. 'Use Destination Theme' will result in an 'inline-style' equation. That is, the summation and fraction components will be smaller than the display-style equation. Here's how the 2 choices would affect the equation in this example (Source Formatting left; Destination Theme right):
  10. Remember, this is an OMML equation, not a MathType one. If you need to edit it:
    1. You can click inside and edit it directly if you want.
    2. If you'd rather use MathType, you can do that too. Click inside, select all, copy, then paste into Word 2016 (it will not paste directly into MathType).
    3. Before you paste into MathType, confirm Word's settings are correct for this. In Word's Format menu, choose Equation Options (at the bottom). Click to select the option to 'Copy MathML to the clipboard as plain text'. Click OK. You should only need to do this once, but in the future if equations don't paste properly into MathType, check the setting to make sure it's correct.
    4. Copy it from Word and paste into MathType. Make your edits, then replace the old equation in PowerPoint with the newly-edited one, using the techniques above.

Group MathType equation objects with drawings and pictures in PowerPoint

Situation:

Suppose you want to add a graph or a picture to a slide in Microsoft PowerPoint, and you want to annotate parts of it with math expressions you create in MathType. Or maybe you've created a drawing of a right triangle by using Shapes in Pages. You want to label the triangle's sides with MathType. If you move the drawing and annotations to another place in the document, or to a different document, you have to move the drawing and its annotations separately. It would be a huge help if you could 'group' everything together so that it moves and acts like a single object.

Note: This tip is written as if you're using Word, but the general process is also valid in PowerPoint. Disregard the mention of inline and floating objects, since all objects in PowerPoint are floating by default and cannot be forced to be inline.

Solution:

Note the procedures in this tip work in Microsoft Office and Apple Pages/Keynote/Numbers, but generically they should work in just about any word processor or office suite. It's impossible for us to test all applications, but try it in the software you use and let us know how it goes.

MathType expressions and equations are normally inserted as inline 'objects' in word processors. This means they look and act as if they're part of the paragraph into which they're inserted. Generally, word processors don't allow grouping of inline objects, period.

Special steps for Microsoft Word and WPS Writer

In the case of Word and most other word processors, it is possible to change the object's 'text wrapping' properties to be something other than inline, but the newest versions of Word don't allow you to group these 'floating' objects with other objects, such as drawings you create in Word or pictures you insert. (Note: Whenever we mention Word in this section, the same applies to WPS Writer.)

There are two techniques for grouping equations with drawings in Word:

Latex plugin for powerpoint presentation
  1. Insert a text box. After you insert a text box, use the Inline button on the MathType tab in Word to insert the equation. After the equation is inside the text box, you can follow the 'General steps' below.
  2. (Not Word 2016 for Mac) Save the document as a DOC file instead of the default DOCX. (If you're using Word 2007 DOCX is fine, and in Word 2016 for Mac, it's the only choice that works.) If you're not aware of the differences between the 2 file formats, you should understand that although in this case we're recommending saving as DOC, there are normally advantages to saving as DOCX. The biggest advantages are probably the availability of SmartArt and the fact that a DOCX is more stable and less susceptible to corruption than is a DOC file. Word users have been using DOC for years and for the most part there aren't any issues with that. Chances are these differences between DOC and DOCX won't affect you, so saving as DOC shouldn't be a problem.

General steps

To continue this tip, we'll be using Word 2016 for Windows, but remember we're talking about a general procedure that should work with almost any word processor or office suite. If we say 'Word' below, it doesn't mean the step is specific to Word; it just means that's what we're using.

To summarize, let's say you want to create a right triangle with sides a = 5 and b = 6, and you want your students to compute the length of c. You might want this diagram:

  1. Type a = 5 and b = 6 into individual MathType equations, inserting them into your document or presentation. Type the equation for c into a third equation and insert it. You don't actually have to use MathType for the first 2 labels of course, but we're doing that to keep a uniform appearance.
  2. If you elected option 1 above (inserting the equations into a text box), skip to step 2c below, otherwise continue. If the equations are inline equations, like they will be in Word or Pages, we need to change them to floating. Do this for each (these steps are specific to Word, so you may have to adapt them to whatever software you're using):
    1. Right-click (Win) or ctrl+click (Mac) and choose Format object (Word 2016 for Windows: Picture).
    2. In the Layout tab, click In Front of text. Click OK.
      If you're using Pages, click once to select the equation and in the Format Inspector, click the Arrange tab. In the Text Wrap section, click None.

      Note: If you have more equations than this to use as annotations, you may wish to do this a bit differently. Create one of the equations. Perform steps 2a above. Copy the equation and paste as many as you need, moving each one into its approximate position. Before you go further, edit each of the duplicate equations to be the one you need for the position it's in.
      Now continue...

    3. Click the equation and move it close to where you want it. To fine-tune its position, hold down the Ctrl (Mac: option) key and use the arrows on the keyboard.
    4. It should still be selected, so now hold down the Shift key and click the other objects -- the triangle and the equations for the other 2 sides. (On the Mac, sometimes the MathType object will deselect, so watch and make sure it remains selected. Click it again if necessary -- all the time holding down the Shift key.)
      If you're using text boxes, you probably want 'no line' or if that's not an option, make the line 100% transparent. You probably also want 'no fill' (i.e., transparent background). Note the text boxes will be difficult, but not impossible, to select once you make the background 'no fill', so consider moving them into position before changing the background.
  1. Windows: Right-click the group and click Grouping > Group.
    Mac: Ctrl-click the group and click Group > Group.
    NOTE:
    If these options are grayed-out, you may need to first save the document or presentation, and if you're in Word, make sure to save it with a .doc extension.

After you follow these steps, if you need to change one of the MathType objects, you can double-click it, make the changes in MathType, and close MathType. You generally don't need to ungroup it first. On the Mac, you'll need to ungroup, make the changes in MathType, then re-group.

Rotating equations in PowerPoint

Applies to:

  • PowerPoint 2011 for Mac

Most of the steps below are not needed for PowerPoint 2016 for Mac, since it's possible to rotate equations in that version of PowerPoint without any special configuration steps. See Now rotate below for the steps that do apply to PowerPoint 2016 for Mac.

Latex Plugin For Powerpoint File

Situation:

You have a diagram, chart, or drawing and you want to label it with MathType equations. You'd like to rotate the equations to align with an axis on the chart or part of the drawing. On the slide below, for example, you'd like the label for the y-axis to rotate 90° CCW.

Latex Plugin For Powerpoint Background

Can't get there from here

Sometimes software just doesn't let us do what it is we want to do, so we have to get creative. In this case, PowerPoint for Windows and PowerPoint 2011 for Mac don't let you rotate inserted objects. That is, anything listed on the Insert Object dialog -- Excel Chart, Visio Drawing, MathType equation, etc. Since MathType equations are inserted objects, whatever equation(s) we want to rotate must be inserted as something other than an object.

Options

Game not over. MathType has output choices other than 'object'. Consider the equation above that we want to rotate. If we double-click it to open it in MathType, we can use the Save Copy As command (in MathType's File menu) to save into a format that PowerPoint will accept and allow us to rotate. Without going into the details of 'why', let's cut to the chase and say out of the choices offered, the one that's best is Graphics Interchange Format (GIF). You need to change a few things first though.

  1. Font size. Always important, but now even more so. NEVER leave MathType's font size for PowerPoint slides set the same as for Word documents, then insert them into PowerPoint and click & drag to resize them. Why 'never'? Two reasons. One, the whole reason you're using MathType is so your equations will look their best. We assume you don't want them to be 'good enough'; you want them to be as good as they can be. If you're in the habit of inserting small equations into PowerPoint, then dragging to make them larger, no two equations in your document will ever be the same size. You may not be able to tell they're different sizes, but your viewers will be able to. So set the Full size in MathType's Size menu to be whatever size you're using in PowerPoint – probably somewhere between 24 and 36pt. The other reason you don't want to click and drag to resize is because it takes a LOT longer to resize every equation in the presentation than it would take to simply do it correctly the first time and set the size in MathType's Size menu. Many people work on a presentation at the same time they're working on a Word document. That's OK. Set a Preference File for each, and switch back and forth.
  2. Resolution. GIFs don't actually have a 'dots per inch' or 'pixels per inch', but for the sake of this exercise we're going to pretend they do. In MathType, open Web and GIF Preferences (in the Preferences menu), and change Bitmap resolution to Other:XXX, where XXX is:
    384 for Windows
    288 for Mac except…
    880 for 15' Retina screen MacBook Pros
    908 for 13' Retina screen MacBook Pros
    The reason for this is because this is a situation where you do need to resize the equation once it's in PowerPoint, but you don't want to have to stretch it to make it larger. To do so would make it fuzzy and not look very good. Much better is to make it large, then reduce it to the proper size. The reason for the numbers above is because these are 4 times normal size. When you insert the equation (or expression, but 'equation' generically) into PowerPoint, use the Format Picture > Size controls to reduce the size to 25% of the original.

Now rotate

You can do this in one of two ways. The easiest – at least in this example – is to stay on the Format Picture panel or dialog, because that's where the Rotation control is also located. For our example, we want to rotate it to -90°.

The other way to rotate it is to click and drag the 'rotation handle' in the direction you want it to rotate. The rotation handle may be a partial circle with an arrowhead, or a green dot, depending on your version of PowerPoint and/or your operating system:

GIF in PowerPoint 2016 for Windows MathType object in PowerPoint 2016 for Mac

Latex Plugin For Powerpoint Slides

Tip: If you hold the Shift key before you click the resizing handle, it will constrain the GIF's rotation to 15° increments. That will give you an easy, precise way to get exactly 90° CCW rotation.

Latex Plugin For Powerpoint Presentations

Here's our slide now:

Coments are closed