fbpx

How to show a LaTeX formula

User Rating: 4 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Inactive
 

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

You can learn more about LaTeX commands from the section of the User Guide.

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:

TechEditor - application script equation

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:

TechEditor - insert script equation

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

TechEditor - insert script equation

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:

TechEditor - insert script equation

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.

English forum

Simple calculator in TechEditor in 10 minutes!

Ontario Building Code 2012 | Load combination (Free Application & Report Template)

Videoreview version 1.0

New articles

Dystlab™ — Project for Engineers

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.

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

Telegram:
https://t.me/techeditor

 

Legal information