# LaTeX Improvements in Origin 2017

#### Introduction

LaTeX fans rejoice! Support for LaTeX has vastly improved in Origin 2017. Previously in Origin 2016, LaTeX support consisted of using the LaTeX App to add LaTeX objects to graphs, primarily as equations. But Origin 2017 now allows for the addition of LaTeX objects to:

• Worksheet Label Row Cells
• Graph Axis Titles
• Graph Legends

In this blog post, I’ll highlight how to add LaTeX objects to all three of those areas. If you wish to see the end result of what will be presented, you can download a sample project here. Note you must be running Origin 2017 and download and install the latest version of the LaTeX App (along with MiKTeX and OAutotrace if not already installed).

#### Worksheet Label Row Cells

The improvement in Origin in 2017 that makes possible to include LaTeX objects in label row cells is a new Origin escape sequence:\q(). This escape sequence tells Origin to render any LaTeX markup between the two parentheses as a LaTeX object at the location of the escape sequence. Take, for example, the following sequence and its result:

To use such a sequence in a label row cell, you need to make sure that Rich Text is not enabled for the cells in that row. This step simply makes it easier to enter the escape sequence and markup. This is how to do that:

Next, you can ether type in the sequence or copy and paste it from another source. In the image below, I’ve entered values in the first two Long Name cells:

And when I turn Rich Text back on for the row, The result is:

Let’s move on to the next subject.

#### Graph Axis Titles

In the worksheet illustrated below, I’ve gone ahead and added a few more LaTeX objects to the column Long Names:

When a multi-axis, multi-plot graph is created from these columns, it can be seen that Origin will intelligently pick up on the escape notations used in the column long names and uses them to render the Axis Titles as LaTeX objects:

Alternatively, LaTex objects can be added to axis titles directly in the graph in one of two ways. First the new Object Properties dialog can be opened for the axis title and LaTeX markup can be entered directly using the escape sequence. For example:

The other way to add LaTeX objects to axis titles is to use the LaTeX App itself by double-clicking on the axis title to enter in-place edit mode, opening the LaTeX App from the Apps Gallery, entering the LaTeX markup in the dialog, and clicking the OK button:

Once again, Let’s move on to the next subject.

#### Graph Legends

Lastly, I will explain how to add LaTeX objects to graph Legends. In much the same manner that LaTeX objects can be used for axis titles, they can be used for legend entries. In the example below, I have entered a few escaped LaTeX markup strings into the Comments column label row cells. When I add the two Legends to the graph, the default Legend Translation Mode picks up on the escaped LaTeX and renders it into the legend. Note how I did not turn on Rich Text in the worksheet cells and yet the Legend still renders the LaTeX!

Also like how one can enter in-place edit mode and use the LaTeX App dialog to place LaTeX objects into axis titles, one can enter in-place edit mode for legend entries and do the same thing. For example:

#### Conclusion

I hope that this blog post has helped illustrate the new possibilities for using LaTeX objects in various places in Origin 2017. If you are a LaTeX fan and are not using Origin 2017 yet, consider downloading a demo from our website or contacting us to discuss how you can get the latest version.

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 →

### 14 Comments on “LaTeX Improvements in Origin 2017”

1. lerh says:

Hi! I’m Lerh, a Chinese student.

Recentely , I found that Origin can work with LaTeX!

Amazimg!It’s an owesome app!

Everything is fine when I type English and equations.
But how shouuld I type Chinese？

For exmaple:
\documentclass[UTF8]{ctexart}
\begin{document}
OriginPro 最棒的科学绘图软件！
\end{document}

It tips:
The document header may not be using recommended 12pts fonts. The font size combobutton may not work properly.

So I tried this

\documentclass[UTF8,12pt]{ctexart}
\begin{document}
OriginPro 最棒的科学绘图软件！
\end{document}

It tips nothings.

All above codes works well with TeXworks, XeLaTeX and pdfLaTeX

Many thanks!

1. Yiming Chen says:

Thank you for bringing this up, we will discuss with our developer to see if it’s easy to implement.

2. Lerh says:

Hi!
It’s an owesome app! Everything is fine with English and equations.
But how should I type Chinese via this app?
I tried to use the package-CJK. But it’s failed.
Can u help me with this problem? Many thanks.

1. Chris Drozdowski says:

Hi,

I was briefly able to get the following snippet to generate Chinese characters but it seems buggy and not reliable with the App.
\documentclass{article}
\usepackage{CJK}
\begin{document}
\begin{CJK}{UTF8}{gbsn}
OriginPro 最棒的科学绘图软件！
\end{CJK}
\end{document}

But actually the App is designed primarily for equations and not normal text (despite what is possible with normal LaTex), so I am not sure that we can do anything about it.

BTW- starting with Origin 2018, you can create graph annotations in chinese directly through standard keyboard input.

~Chris

3. shufenglaimo says:

How to combien the MIKTEX and the origin2017, I can not solve it successfully.
Thank you!
kind regards

4. Smile says:

I install it and it doesn’t work for me. I use Win 10. Before I use Win 7 and it works well. I want to know is it not compatible with Win 10? Thanks

1. snow says:

What is the symptom.

It should work for Win10 as well. Did you install MiKTeX and OAutotrace mentioned on the file exchange page?
And did you check if your Origin is higher or same as the required minimum version?

Thanks, Snow

5. Orie says:

Is there any way to change the default font used by LaTeX, perhaps by changing the default statements that are automatically wrapped around the input?
Also, when attempting to change the font by inserting a complete LaTeX document the created object is very long with a black streak down the middle. Any suggestions?

1. Shirley Tian says:

If you want to change the default font, please insert the renewcommand line as below into the document block:
 \documentclass[12pt]{article} \renewcommand{\familydefault}{\sfdefault} \begin{document} Hello \LaTeX \end{document} 

You said “the created object is very long”, then you can use other package to adjust it, such as below:
 \documentclass{article} \usepackage[a6paper]{geometry} \begin{document} 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 \end{document} 
To learn more about LaTaX page layout, I think you can refer to this public wiki page, https://en.wikibooks.org/wiki/LaTeX/Page_Layout

For the “black streak down the middle”, would you please share us the LaTeX strings or a screenshot of the APP dialog? Then, we can try to reproduce the problem here.

You can reach us via emailing to tech@originlab.com too.

Shirley
OriginLab Technical Support

1. Nils says:

Could you elaborate on that topic?
When I use your code and change from 12pt to 18pt I get an error message.
‘The document header may not be using recommended 12pts fonts. The font size combo button may not work properly.’
How would I display \q(E=mc^2) with Origin default font, bold and 14pt?

1. Shirley Tian says:

Hi Nils,

Sorry, our LaTEX app is not very complete to fully support all fonts.

For your case, I have created some examples to set font and font size in Origin, please try them to see if you can get what you want.

You can refer to this page to learn how to change the font size using the text formatting commands.
http://www.originlab.com/doc/Origin-Help/Escape-Sequences

Thanks,
Shirley
OriginLab

6. mark says:

Everything works as stated but when I add \q(\psi) to a cell and turn on Rick text, there is a delay as if though the software is chugging away, but the symbol does not show up. BTW ever other feature works as promised.

1. Chris Drozdowski says:

Hi Mark,

I’ll contact you via email!

Thanks,
~Chris