LiA
A transpiled superset of TeX for writing LaTeX.
This is more for my personal use however you're welcome to use it or contribute. These added features are just designed to make LaTeX code less verbose, faster to write but also just catered more towards my personal preference.
For a more detailed explanation of the features see the documentation.
For installation instructions see the installation section.
Example #1
LiA code
eq {
dy/dx = x*(a - b) + [[1, 2], [3, 4]] + sin(x)
}
Resulting TeX
\begin{document}
\begin{equation}
\frac{dy}{dx} = x \times \left(a - b\right) + \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} +\sin \left(x\right)
\end{equation}
\end{document}
Example #2
LiA code
use graphicx, [utf8]inputenc
@cat = 🐈
@img = (src, desc) => {
env center {
\image{@("images/" + src), 10cm}
\linebreak
**@desc**
}
}
#* Cool Cat Image
## A subsection
@img(cat.png, Meow @cat!)
Resulting TeX
\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\newcommand{\cat}{🐈}
\newcommand{\img}[3]{
\begin{center}
\image{#3, 10cm}
\linebreak
\textit{#2}
\end{center}
}
\begin{document}
\section*{Cool Cat Image}
\subsection{A subsection}
\img{cat.png}{Meow \cat!}{images/cat.png}
\end{document}
Example #3
LiA code
@muliplication = (a: Number, b: Number) => { $@a \times @b = @(a * b)$ }
* I'm a **Markdown** style ***list***
* @muliplication(2, 3)
* @muliplication(6, 6)
* @muliplication(2, 9)
* I'm indented
* {I'm a multiline
list item}
Resulting TeX
\newcommand{\muliplication}[3]{
$#1 \times #2 = #3$
}
\begin{document}
\begin{itemize}
\item I'm a \textit{Markdown} style \textbf{list}
\item \muliplication{2}{3}{6}
\item \muliplication{6}{6}{36}
\item \muliplication{2}{9}{18}
\begin{itemize}
\item I'm indented
\end{itemize}
\item {I'm a multiline
list item}
\end{itemize}
\end{document}
Installation
OS | Instructions |
---|---|
Windows | Download the latest release from the releases page. There is currently no installer so you will need to add the directory to your path manually. If you have Rust intalled it is recommended that you use the instructions in the building section. |
Arch Linux | Install from the AUR https://aur.archlinux.org/packages/lia-git. |
Other | Follow the instructions in the building section. |
Usage
lia file.lia -w
- Run
lia --help
for more information on usage. - The
-w
flag will tell the compiler to watch the file for changes and recompile it.
Building
Requires Rust to be installed.
git clone https://github.com/jaspwr/LiA
cargo install --path [path-to-cloned-repo]
You will need to add Cargo's bin directory to your PATH environment variable.
Building docs and tooling.
If you have made changes to the code that alter the language in anyway or bumped the version, it is a good idea to run the following command. This will recompile all of the code examples in the documentation, update list of known macros and keywords, etc.
cargo run --bin docs_and_tooling_builder
VSCode extension
For syntax highlighting and other features in VSCode, you can use the extension. To install it, copy tooling/vscode/lia-helper
to your VSCode extensions directory (normally ~\.vscode\extensions
) then restart VSCode.