For a project at university I needed a tool that automatically generates a documentation of calculations.
But I needed more flexibility than with tools like MathCad.
So I started writing my own tool with Lua and LuaLaTex.
During the project I kept on making the tool more user friendly and implementing more functions.
Now I want to know what other people think about it.
The tool is called TexVar (for LaTex Variable) and is hosted on GitLab:
https://gitlab.com/Specht08/TexVar
You can find a documentation in the download folder.
All commands can also be found in the GitLab wiki (https://gitlab.com/Specht08/TexVar/wikis/home) and in the CheatSheet that is included in the download folder.
Before you download the tool and start testing

I’m looking forward to some new input for my project.
Code: Select all
\documentclass{article}
%
\usepackage{luacode}
\usepackage[fleqn]{amsmath}
% create commands for units (not needed but good practice)
\newcommand{\msKpW}{\tfrac{m^2K}{W}}
\newcommand{\WpmsK}{\tfrac{W}{m^2K}}
\newcommand{\WpmK}{\tfrac{W}{mK}}
\newcommand{\m}{m}
%
\begin{document}
Calculating the U-Value for an element with two layers and resistance of surface internal and external.\\
\begin{luacode}
-- load tVar library
require("tVar/init.lua")
-- global Definitions
tVar.outputMode = "RES_EQ_N"
tVar.numFormat = "%.2f"
tVar.numeration = true
-- define variables
tex.print("\\noindent Resistance of surface")
R_se = tVar:New(0.04,"R_{se}"):setUnit("\\msKpW"):outRES()
R_si = tVar:New(0.13,"R_{si}"):setUnit("\\msKpW"):outRES()
tex.print("Parameters for elements")
d_1 = tVar:New(0.2,"d_1"):setUnit("\\m"):outRES()
lambda_1 = tVar:New(0.035,"\\lambda_1"):setUnit("\\WpmK"):outRES()
d_2 = tVar:New(0.1,"d_2"):setUnit("\\m"):outRES()
lambda_2 = tVar:New(0.5,"\\lambda_2"):setUnit("\\WpmK"):outRES()
tex.print("Calculate thermal resistance")
R = (R_se + d_1/lambda_1 + d_2/lambda_2 + R_si):setName("R"):setUnit("\\msKpW"):print():clean()
tex.print("Calculate U-Value")
U=(1/R):setName("U"):setUnit("\\WpmsK"):print()
\end{luacode}
\end{document}