LaTeX in MS PowerPoint and VS Code on macOS

LaTeXiT + MS Power Point

My presentations often include fair share of math equations and videos/ animation. Although making presentation in beamer is always an option, but as of now, embedding animation or video in a beamer-generated PDF isn’t very intuitive or natively supported. So, I have always opted in for Power Point because of the ease of use. While equation editor in MS Word and PowerPoint has improved drastically over the last few years, it’s still not nowhere near what LaTeX can produce. Additionally, I already have equations written in LaTeX and I use overleaf these days for LaTeX.

After I got the 2022 M2 Macbook Air, I was looking for a way to integrate LaTeX into the MS PowerPoint. Previously, I had the full LaTeX distribution installed via MacTeX and I used IguanaTex plugin to generate LaTeX equation within the PowerPoint. But this time around, I was reluctant to install the full MacTeX distribution as it will occupy 8 GB+ space on my SSD. MacTeX is essentially TexLive distribution specific to macOS. On Windows, the popular Tex distribution is MiKTeX. Anyway, also to use IguanaTex on Apple Silicon processors, MS Power Point needs to be run with “Open with Rosetta” option. Rosetta is a software which emulates Intel x86 architecture for Apple’s ARM silicon processor, but that comes with performance penalty. I decided not to opt-in for that either.

Considering the situations at hand, my new workflow for having LaTeX equations in the PowerPoint slides requires installation of BasicTeX, Ghostscript, and LaTeXiT. BasicTeX is a light-weight tex distribution (only a few hundred megabytes) of MacTeX, Ghostscript is a rendering package of PostScript and PDF, and LaTeXiT is a very light-weight equation editor. Download basictex and ghostscript from here: Install in this order; first BasicTeX and then Ghostscript. Both of these come as .pkg file, so the installation procedure is straightforward and no customization is necessary. Now download and install LaTeXIt from here: Installation process is trivial. Open LaTeXiT and then from the Menu bar on the top of the screen, go to Settings. Make sure your export format is “PDF Vector Output”. You can also export the equations as .png, .jpg, .tiff, .eps, and .svg format, but I found PDF to be the most compatible format in which you can easily edit later.

You can now start typing equations and if you click on the LaTeXiT icon, it will produce the beautifully crafted LaTeX formula in the preview box on the top. You can drag it to the Desktop Window and it will be saved as a PDF file. You can also directly drag it to a PowerPoint slide. It will embed there as image. If you’d like to edit the equation later, you can drag that image to the preview window of LaTeXiT, it will generate the .tex code for you which you can edit and repeat the process of drag and embed. There are two things I should mention about this workflow:

  • BasicTeX does not have all the packages you may need and manual installation of the packages might be needed. We will see how to do that..
  • I would have loved it even more if LaTeXiT had a PowerPoint plug-in like IguanaTeX. I wish the developer step forward at some point.

LaTeXiT settings (optional)

In typesettings tab, you can create your own preamble. This is how my current preamble looks like:




LaTeX packages, dsfont and mathtools, are not part of the basictex distribution. So, I had to install them manually. If you’d like to see what LaTeX packages are installed in your distribution, type:

$ tlmgr list --only-installed

tlmgr is the TexLive distribution manager. You can search for TexLive (tlmgr) documentation to learn more commands. To install the additional packages I have here, open terminal and type the following:

$ sudo tlmgr install doublestroke mathtools

The LaTeX package, dsfont, is distributed as doublestroke on the repository. You can follow the same procedure to install any LaTeX package that is hosted on CTAN repository. We will see a few more examples later.

Integrating LaTeX with VS Code

Since I already installed BasicTeX, I decided to give local LaTeX compilation a shot but without using any additional software like TexShop, TexWorks, TexMaker, etc. Since I am a regular user of Overleaf, this is not a priority to me but I thought it would be nice to have the option, just in case. Visual Studio Code is my favorite text editor for a while, so I decided to check out the options to integrate LaTeX compilation to VS Code. If you haven’t used VS Code before, you should try it out: VS Code is probably the most popular code/text editor now. Anyway, on my VS code, I installed the extension: LaTeX Workshop to manage LaTeX linking and compilation. Before configuring LaTeX Workshop for compilation, we need to install a few LaTeX packages: chktex, synctex, latexmk, texcount, latexindent. Installation process is same as before; open the terminal app and type:

$ sudo tlmgr install chktex synctex latexmk texcount latexindent

Now we need to get the PATH for these packages to be included in the LaTeX Workshop settings inside VS Code. To get the path for each packages, on terminal, type:

$ which chktex

This will return the path for chktex installation. You can repeat the same command for other packages as well. Now, let’s open the VS code and from the top Menu bar, go to Code > Settings > Extension > LaTeX Workshop. From the top search bar menu, search “latex-workshop path”. This will result in some options that requires the path variable. I had to enter the path for chktex, synctex, texcount, and latexindent. By default, VS Code uses latexmk for compilation, so does not require entering the path in there. I guess, it finds automatically from the system, if installed. You can also customize other options from LaTeX workshop extension, such as cleaning additional files after compilation and choice of PDF viewer, etc. Once all the set up is done, you can now start writing in LaTeX and compile it.

Final words

While this method is capable of compiling LaTeX file to PDF via pdflatex, lack of packages in the BasicTeX installation makes it harder to compile a more realistic LaTeX file. You may have to install LaTeX packages manually. MikTeX on Windows has on-the-fly package installation feature which is awesome, but I have not found a way to do it with MacTeX or TexLive. As of now, the apparent remedy is to install the complete MacTeX distribution. MikTeX is also now available on macOS; so installing MikTeX instead of BasicTeX might be helpful in that case.