A quick insight into the capabilities of TexVar, a LuaLaTeX library for doing mathematical calculations within LaTeX. The presentation contains a small example. Website: http://texvar.projectzoo.at
2. TexVar
TexVar (short tVar) is a basic LaTeX math calculations tool written in
Lua. For integration into LaTeX, it has to be used together with
LuaLaTeX. Compared to software like Mathcad TexVar is a lot more
flexible. You can fill custom designed tables with results, do calculations
within text documents and print beautiful LaTeX equations. The current
version also supports 2D-plotting with gnuplot.
Let’s take a look at an example ...
3. Assume you have to calculate the maximum critical load for a collumn,
with both ends fixed (Euler buckling case 2).
You can just write this:
begin{tVar}
{
E:=21000:setUnit("kN/cm^2")
I:=8360:setUnit("cm^4")
L:=400:setUnit("cm")
}
F_crit:=(tVar.PI^2/(4*L^2)*E*I):setUnit("kN"):CRLF("=")
end{tVar}
4. And TexVar returns you this:
E = 21000 kN/cm2
I = 8360 cm4
L = 400 cm
Fcrit =
π2
4 · L2
· E · I =
π2
4 · 4002 · 21000 · 8360 =
= 2707.356 kN
5. Now we want to calculate the load for a collumn with only half the
length.
To compare the results we store the previous one in another variable and
print both results in a text.
begin{tVar}
{
F_crit_1:=F_crit
L_2:=(L/2):setUnit("cm")
}
F_crit:=(tVar.PI^2/(4*L_2^2)*E*I):setUnit("kN"):CRLF("=")
# Critical load: full length $$F_crit_1$$, half length $$F
_crit$$.
end{tVar}
6. And TexVar returns you this:
Fcrit,1 = Fcrit = 2707.356 kN
L2 =
L
2
=
400
2
= 200 cm
Fcrit =
π2
4 · L2
2 · E · I =
π2
4 · 2002 · 21000 · 8360 =
= 10829.423 kN
Critical load: full length 2707.356 kN, half length 10829.423 kN.
7. TexVar offers: all LATEX formatting options, 2D plots with gnuplot and a
very simple syntax.
Details on commands can be found in the manual.
http://texvar.projectzoo.at
8. TexVar offers:
• all LATEX formatting options
• 2D plots with gnuplot
• matrix and vector calculations
• a very simple syntax
... and is fully extensible with any lua function.
Download the current version today from:
http://texvar.projectzoo.at