LaTeX is a computer language designed for typesetting. The most popular use of LaTeX is math and Greek fonts for technical purposes. Use the LaTeX option of the Text Details dialog (accessed via the LaTeX Box button in the Text Details dialog) to switch between normal and LaTeX text.
The following options are available:
• Generate LaTeX - Renders the LaTeX output based on the current text field.
• Size - Select a character height unit from the drop-down menu, then enter the size in the associated field. LaTeX size commands are still valid and will resize relative to the Size value:
• Points - Specify character height in points. One point is 1/72nd of an inch.
• Frame% - Specify character height as a percentage of frame height.
• Grid - Specify character height in grid units. (Available only when Position By is set to Grid.)
• LaTeX - Switches between regular and LaTeX output in the text field.
• X/Y Position - Choose the position of the text element's anchor point (see Anchor button).
• Position by - Choose to position the text using the frame or grid coordinate system.
• Anchor - Choose how the text is aligned with the anchor point. As new text is added, the text expands away from the anchor point chosen in the Anchor Alignment dialog (See Section 18 - 1.1 “Text Details” for a complete image of the Anchor Alignment dialog).
• Macro function - Enter the name of the macro function to be linked to this text object. See Section 18 - 3 “Linking Text and Geometries to Macros” for more information. To run the linked macro function, hold down Control while right-clicking the text object in the workspace. (On Mac, hold down Command while right-clicking.).
A few requirements are needed before LaTeX outputs can be generated. The first is to have a LaTeX engine installed. LaTeX distributions are largely free and available on many different operating systems. For installation recommendations, see the LaTeX Project page.
The second requirement is to have the tecplot_latex.mcr file correctly configured in your installation directory. Each LaTeX engine will come configured with different ways to parse commands. Details of how to configure it can be found in the tecplot_latex.mcr file. The default settings have been tested with MiKTeX and TeXLive engines. If using the default install options for MiKTeX, the zhmetrics package will also need to be installed.
For information on how to load a custom tecplot_latex.mcr file, see Section 30 - 1 “Custom Files loaded on Startup”.
Example 1: Mathematical Symbols
LaTeX allows for easy configuration symbol production. The example below shows how to create simple vector and square root symbols:
$$\vec a =\sqrt 2$$
The dollar signs denote the start of an equation. The output is shown below:
Figure 18-2. Vector a equals square root of 2
Example 2: Mathematical Formula
In LaTeX, syntax is crucial to produce a correct output. Each symbol has its own syntax. The formula for Kirchhoff's current law, for example, is used like so:
Kirchhoff's current law\ldots
\begin{equation}
\sum_{k=1}^{n} I_k = 0 \; .
\end{equation}
Notice in the Figure 18-3 below how the begin and end equations separate the equation from regular text. LaTeX changes paragraph spacing as well as symbols.
Figure 18-3. Kirchhoff's Current Law in LaTeX
Example 3: Sizing and Accented Phrase
LaTeX allows for easy alphabetical accents. The following example shows the variety of accented phrases that can be accomplished by LaTeX typesetting. The phrase:
\huge ?`D\'onde est\'a el avi\'on? \\
Is easily converted to non-English symbols. In LaTeX, these symbols are converted inline with other text allowing fluid transitions between both.
Figure 18-4. Multi-lingual phrases in LaTeX
Example 4: Color, Sizing, and Text Boxes
LaTeX allows for easy customizability with certain keywords. Some keywords and formatting are dependent on packages that do not come preinstalled with your LaTeX engine. The following example uses the xcolor package to show custom formatting. To initialize xcolor in the preamble, add the following to the end of the preamble in the tecplot_latex.mcr file:
\usepackage{xcolor}
Now your Tecplot 360 EX installation will be ready to use the xcolor package. Use the following phrases as an example for color, size, and text box formatting:
\noindent
\fcolorbox{red}{gray!20}{\color{red} Colors are fun} but \ldots \\
\emph{\small sometimes they are not ideal} \\
{\color{blue}\framebox{This might be better.} \\
But \colorbox{orange}{whatever you do,} \\
\color{black}don't make a {\huge Big Deal} about it.
This example shows three different text boxes each with different parameters. \fcolorbox allows for a colored frame as well as a background. \framebox has a transparent background and takes the frame color of whichever color is currently being used. \colorbox creates a highlight in the color specified. The output is shown below:
Figure 18-5. LaTeX Color, Sizing, and Text Boxes
For more examples on LaTeX use, syntax, or concepts check Tobias Oetiker's PDF, The Not So Short Introduction to LaTeX.
Many frequently asked questions can also be found on the TeX StackExchange website: https://tex.stackexchange.com/