Skip to content

MithilSaiReddy/Mex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mex

mex — write LaTeX like Markdown

mex is a minimal CLI tool to make writing LaTeX research documents easier by using a Markdown-like syntax. It generates valid .tex files that can be compiled with any LaTeX engine (Overleaf, pdflatex, etc.).


Features

  • Write sections and subsections with #, ##, ###
  • Bold, italic, and inline code formatting
  • Inline and block math support: $...$ and $$...$$
  • Theorems, definitions, and other environments with ::: name ... :::
  • Simple citations with @key (converted to \cite{key})
  • Generates fully ready-to-compile LaTeX documents

Goals: Reduce LaTeX boilerplate and make writing research notes and papers faster.


Installation

Install mex in editable mode (recommended for development):

git clone https://github.com/MithilSaiReddy/Mex
cd mex
pip install -e .

This will make the mex command available globally.


Usage

Basic usage

mex input.mex -o output.tex
  • input.mex — your Markdown-like source file
  • output.tex — generated LaTeX file (default: out.tex)

Compile the output with pdflatex or Overleaf:

pdflatex output.tex

Example .mex file

title: My Research Paper
author: Alice

# Introduction

This is **bold**, *italic*, and math $E=mc^2$.

## Theorem Example

::: theorem
Every vector space has a basis.
:::

See @smith2020 for more details.

This will generate a LaTeX document with sections, formatted text, math, the theorem environment, and citations.


Supported Syntax

Syntax Example Output
Section # Title \section{Title}
Subsection ## Subtitle \subsection{Subtitle}
Bold **bold** \textbf{bold}
Italic *italic* \textit{italic}
Inline code `code` \texttt{code}
Math block $$ ... $$ \[ ... \]
Environment ::: theorem ... ::: \begin{theorem} ... \end{theorem}
Citation @key \cite{key}

Philosophy

mex is not a replacement for LaTeX.

It is a lightweight writing layer designed to:

  • Reduce cognitive load
  • Remove repetitive boilerplate
  • Let researchers focus on ideas, not formatting

Contributing

  • Clone the repository
  • Install in editable mode (pip install -e .)
  • Modify the source code
  • Add tests and examples
  • Submit a pull request

Roadmap

Planned features:

  1. Lists (- and numbered 1.)
  2. Figures: ![caption](image.png)
  3. Bibliography support (.bib integration)
  4. Enhanced error messages
  5. Unit tests and CI pipeline

License

MIT License © 2025


About

write LaTeX like Markdown

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors