The Improved LaTeX App (Version 2.3)

Introduction

Starting with Origin 2016 SR2, the LaTeX App has undergone considerable improvement. If you’ve already been using the App, make sure update your Origin to the latest version and then choose Tools: App Center menu and select Updates tab to update to this newer version. You only need to download and install the newer version of the App; there is no need to reinstall either MiKTeX or OAutotrace.

Note: If you haven’t used the LaTeX App before, please read Introducing the LaTeX App. It discusses the steps necessary to install the App the first time along with basic App usage.

So what’s new? First, the App handles the temporary files it creates better. But this isn’t so interesting. What’s interesting is that you can now enter complete LaTeX documents if you wish and not just equation markup as mentioned in Introducing the LaTeX App. In this blog post, I’ll show you one thing you can do with the new version of the App that you couldn’t do before:

  • Change the font of an equation.

Here is a graph showing this thing:

Figure 1 (click to enlarge)
Figure 1 (click to enlarge)

It is the UV-Vis spectrum of the linear conjugated dye 1,1′-Diethyl-2,2′-carbocyanine chloride (pinacyanol chloride). The peaks are fitted with the Gaussian fitting function. I added the formula for the Gaussian function Origin uses to the graph. Keep reading to find out how I did it. The skeletal structure diagram of the molecule is inserted as an image by Insert: Images from Files. To download the files associated with this post click here. Note: the *.tex file in the zipped folder can be opened in Notepad or another plain text editor. While you can view the OPJU in Origin, you will need OriginPro to rerun or edit the fitting operation.

Note: If you have previously installed the earlier version 1.2, you need to first uninstall it and shut down Origin. Then go to a folder under your user name, C:\Users\<User Name>\AppData\Local\OriginLab\93\TMP\textemp\, and delete the temporary files in that folder. Then install the new version of the App.

Change the Equation Font

By default LaTeX and the LaTeX App use Computer Modern as the font for equations. However, because the new version of the App allows you to enter a complete LaTeX document, you can include additional packages such as the mathptmx package. That package lets you use Times New Roman as the equation font. Here is the markup to enter into the LaTeX App:

\documentclass{article}
\usepackage{amsmath}
\usepackage{mathptmx}
\pagestyle{empty}
\begin{document}
\begin{equation*}
y=y0+\frac{A\mathrm{e}^\frac{-4\ln\left(2\right)\left(x-x_c\right)^2}{w^2}}{w\sqrt{\frac{\pi}{4\ln\left(2\right)}}}
\end{equation*}
\end{document}

When you click the OK button in the App dialog, the typesetting engine MiKTeX may prompt you to download one or more packages. You should allow it to do so! While MiKTeX is downloading the packages, the App will pause. If for some reason the App reports an error, simply close it, reopen it, and try again. Sometimes it takes longer than anticipated for MiKTeX to download and install packages.

Conclusion

So you can see that the improvement to Origin’s LaTeX App opens the door to much more than just adding generic equations to graphs. You can customize fonts and do many other things not possible with the earlier version of the App.

Thanks for reading!

About Chris Drozdowski

Chris Drozdowski is a Product Support Engineer at OriginLab. He loves to talk to customers and educate them. He particularly relishes diagnosing and solving difficult, edge-case issues. As well, he contributes code to help solve problems or enhance user experience. In his down time at work, he likes to research and write about esoteric product features. Outside of work, he enjoys spending time with his family, having fun with C++, working on his aquarium, and exploring craft beers.

View all posts by Chris Drozdowski →

3 Comments on “The Improved LaTeX App (Version 2.3)”

    1. Hi,

      In the column for the Y data, set the Long Name to be \q(e=mc^2) where e=mc^2 is the LaTeX. That is, put the LaTeX into the \q() escape sequence. Then turn on Rich Text for the Long Name row.

      1. Sorry for not being clear, I intended to ask for converting the tick labels as well into latex fonts. Thanks, for your reply.

Leave a Reply

Your email address will not be published. Required fields are marked *