## How to show a LaTeX formula

User Rating: 4 / 5

Let's consider how to add a mathematical formula to a report using a script.

### LaTeX

All formulas in TechEditor reports are generated in a special formula layout language LaTeX. TechEditor uses LaTeX dialect, that is, not all commands of the base language are supported, and some of them may be different.

For example, the formula

$\frac{A^2}{B_f}=C_2$

is generated by a script:

\frac{A^2}{B_f}=C_2

### Defining the formula in the script

To display automatically a LaTeX formula in a report, you must first define a variable or constant in the active application:

This example uses the script:

uses  Classes, Dialogs;const  PARAM_C2 = '\frac{A^2}{B_f}=C_2'; begin   UpdateReport;end;

Note that the module's begin..end block contains the UpdateReport procedure. This is done in order to automatically update the report when the application starts.

### Adding a scripting formula to the report

Place the cursor where you want to display the formula in the report. Click "Script equation" on the Automation> Report automation objects toolbar:

In the window that appears, specify the name of the parameter that is responsible for the formula in the script:

Click OK. Make sure an object with the same text appears at the cursor location. For now, ignore the character style, the text is output in LaTeX format.

### We get the finished formula

Run your application with the Run button. Make sure the formula looks correct:

Congratulations! Now you know that absolutely any text information can be output from the TechEditor script engine.

### Reuse a formula in a report

To reuse a formula in a report, just select it, copy and paste it where you want it. In this case, changes to the formula through the script will be automatically applied to all copied instances of the formula.

### Events

Sorry, we currently have no events.

## New articles

Address in Canada: 223-2275 Lake Shore Boulevard West, Toronto, ON, M8V 3Y3

Address in Ukraine: 76006, Ivano-Frankivsk, st. Ivana Mykolaichuka 17/97

E-mail:
technot needed texteditoranother not needed text@dystlabdummy text.store

Telegram:
https://t.me/techeditor

### Legal information

Dystlab™ is a trademark registered in the State Register of Certificates of Ukraine for Goods and Services Marks 26.02.2018, certificate No. 238304. Owner: entepreneur Artomov V.E., EGRPOU/ITN: 3003314690.