# Introduction to $\TeX$

$TEXDraw$ brings the creation of equations and other beauties of math expression typing in Unity using $\TeX$-typesetting designed by Donald E. Knuth since around 1987. $\TeX$ is a language that became popular in the eye of academia from scientist to mathematician, because how easily $\TeX$ can produce high quality book and journals with minimal effort. $\TeX$ is then heavily improved with other derivation works such as $\LaTeX$ and $Con{\TeX}t$. Until today it’s still used by a lot of academics and $\TeX$ enthusiasts around the world.

$\TeX$ is capable of creathing from common math expressions like $-b \pm \sqrt{b^2 - 4ac} \over 2a$ (from $-b \pm \sqrt{b^2 - 4ac} \over 2a$) to the most complex one with little learning curve:

\begin{align*} y = y(x,t) &= A e^{i\theta} \\ &= A (\cos \theta + i \sin \theta) \\ &= A (\cos(kx - \omega t) + i \sin(kx - \omega t)) \\ &= A\cos(kx - \omega t) + i A\sin(kx - \omega t) \\ &= A\cos \Big(\frac{2\pi}{\lambda}x - \frac{2\pi v}{\lambda} t \Big) + i A\sin \Big(\frac{2\pi}{\lambda}x - \frac{2\pi v}{\lambda} t \Big) \\ &= A\cos \frac{2\pi}{\lambda} (x - v t) + i A\sin \frac{2\pi}{\lambda} (x - v t) \end{align*}

\begin{align*} y = y(x,t) &= A e^{i\theta} \\ &= A (\cos \theta + i \sin \theta) \\ &= A (\cos(kx - \omega t) + i \sin(kx - \omega t)) \\ &= A\cos(kx - \omega t) + i A\sin(kx - \omega t) \\ &= A\cos \Big(\frac{2\pi}{\lambda}x - \frac{2\pi v}{\lambda} t \Big) + i A\sin \Big(\frac{2\pi}{\lambda}x - \frac{2\pi v}{\lambda} t \Big) \\ &= A\cos \frac{2\pi}{\lambda} (x - v t) + i A\sin \frac{2\pi}{\lambda} (x - v t) \end{align*}

$\TeX$ is the de-facto to write mathematical expressions. But does it work in Unity? This is where $TEXDraw$ is useful.

Previously, if you want to display math equations in Unity is either you have to use Unicode symbols, prerender it as sprites, or use third-pary services. But with $TEXDraw$ this kind of hassle is gone. You can directly type $\TeX$ in Unity using it. The default config is works out of the box and it’s fairly easy to setup if you want something different.

## Installation

You need to purchase the asset from Unity Asset Store in order to proceeds. You only need to purchase it once and future updates will be available freely.

TEXDraw assets will be in Assets/Plugins/TEXDraw after you’ve install the package in your project. For a starting point, you can open example scenes from folder Samples there.

## Usage

TEXDraw comes with 2 primary game object components, TEXDraw for use in Unity UI and TEXDraw 3D for use in regular 3D mesh. Both is similar like Unity’s built-in Text and Text 3D but with $\TeX$ capabilites.

To add a TEXDraw UI component, go to menu GameObject, UI, TEXDraw. To add a TEXDraw 3D component, go to menu GameObject, 3D, TEXDraw 3D.

More explanation for component usage please see Extending TEXDraw

## Syntax

Writing $\TeX$ is fairly simple. Go read TeX syntax from top to bottom, you’ll understand it in no time.

Upgrading from v5.x to v6.x should be seamless. You may only check release notes if there’s something you already use is changing.

Upgrading between the same major version (v5.x and v6.x) should be straightforward too. However if you have made changes in the configuration files, you should refrain from overwriting the Resources folder.

Unfortunately upgrading between major versions (e.g. v4.x to v5.x) is not supported and it’s better to stick with latest major version available. Archived releases are available in GitLab repository.

## Compatibility

$TEXDraw$ has no compiled binary files, has no platform-specific shader files, and not using any third-party services. It should able to run in all Unity supported devices.

Although $\TeX$ implementation is differs among different platform and plugins, we aim to make $TEXDraw$ fits to daily common cases in working with $\TeX$. Any $\TeX$ syntax you see in this documentation should works out of the box.

The latest TEXDraw v5.0.0 is aimed to be compatible with Unity 2019 LTS and up above. If you want to see support for older version of Unity you can check the latest v4.4.1 which supports Unity 2018 LTS out of the box.

## Licensing

The usage of this asset should be companied with Legal Asset Store EULA Terms. This means you should only get a copy of this product if you have purchased the asset from Asset Store.

Note that if you purchase/download this asset from another source, you’ll not get an invoice number which is required if you want:

• Asking direct support via email
• Accessing the Git repo
• Supporting the TEXDraw development

### Accessing the Git Repo

Accessing the Git Repo is useful if you want the bleeding edge of features that are in development or not released in Asset store yet.

You need to have a GitLab account, then grant an access with your invoice number. After you have the access you can jump to the repo. You can ask us if you have problem with getting an access to GitLab repo.

### Reporting Problem

If you found problem in the syntax or in the rendered $\LaTeX$, first check if what you expect is addressed in other $\LaTeX$ renderer, such as texrendr.com. If the rendered $\LaTeX$ there is different with us, then you can report the problem to Forum or Email along with the $\LaTeX$ syntax.

If you have problem with the library, like console error popups, or you want to report a bug, please report it to Forum or Email too. We will try to fix it as soon as possible.

Please note, we can’t guarantee if we (TEXDraw developer) has availability or enough time to reply you nor identify and fixing the bug, so please check the documentation (use the search feature!) before asking for direct support.

### Third Party Assets

You can use assets inside the TEXDraw package for non-commercial or commercial purposes including third parties. Some third party assets we use include: