DEV Community

Cover image for MaTeX
Mustafif
Mustafif

Posted on

MaTeX

I had a little fun in creating a little mate to LaTeX that looks simpler and when compiled, goes to tex then pdf.

So why don't we look at some simple latex code and see how it looks like in MaTeX:

% Latex Code
\documentclass{article}
\author{Mustafif}
\title{Latex Code}
\date{Feb 24 2022}
\usepackage{listings}

\begin{document}
   \maketitle
   \pagenumbering{arabic}
    \newpage
\end{document}
Enter fullscreen mode Exit fullscreen mode
% Matex code 
documentclass: article
author: Mustafif 
title: Matex Code 
date: Feb 24 2022
import: listings 

document > begin
   maketitle;
   pagenumbering: arabic
   newpage;
document > end
Enter fullscreen mode Exit fullscreen mode

You can see the following:

  • Environments are defined as env > begin ... env > end
  • Elements are defined as element: value
  • Literals are defined as name;

There are still lots to do in terms of the "compiler" with error handling, optimizations, but here's the base of this simpler latex.

To install, use cargo:

$ cargo install matex
# To create new project
$ matex new <name>
# To compile project  
$ cd <name> && matex compile 
# To build pdf for matex file
$ matex build <name>
Enter fullscreen mode Exit fullscreen mode

Please comment below what you think of the project, and any suggestions to improve it. In the coming future proper documentation will be added and the project will be added to mkproj.com and in mkpm-cl

Top comments (1)

Collapse
 
mustafif profile image
Mustafif

In terms of documentation, I will also write a MaTeX Basics to explore going from LaTeX to MaTeX.