L2T: An Algorithm to Support The Generation of 2D Texture from LaTeX Math Equations - Santos, Adriano; Camargo, Edson; Scheffel, Roberto; Merli, Renato; Pezutti, Eduardo; Lima, Phyllipe; Silva, Heloisa (Anais do Simpósio Brasileiro de Jogos e Entretenimento Digital (SBGames), 2022)
Serious or educational games for learning mathematics have in common the representation of mathematical equations during the game. However, the tools available to represent an equation in the Unity platform are paid or proprietary. This work introduces L2T, a free and open-source tool capable of reading a LaTeX mathematical expression and generating an equivalent and suitable texture to be displayed in a game scene. The algorithm is divided into two parts. The first part extracts the tokens from the input and builds the Abstract Syntax Tree (AST), while the latter traverses the AST and renders the final texture. The reference implementation is a Unity Script and can be imported as any regular asset. The L2T is currently being used as part of a project to develop a series of educational and serious mathematical games. It was validated within the game “Math Archipelago”, a treasure hunt genre in which the player has to find hidden treasures while solving math problems. The developed solution is essential for creating diverse games for teaching mathematics.