| Crates.io | late2htm |
| lib.rs | late2htm |
| version | 0.1.0 |
| created_at | 2025-06-02 12:51:24.104072+00 |
| updated_at | 2025-06-02 12:51:24.104072+00 |
| description | A Rust library for converting LaTeX-formatted text into HTML with minimal styling. |
| homepage | |
| repository | https://github.com/LunaStev/late2htm |
| max_upload_size | |
| id | 1697928 |
| size | 43,642 |
LaTeX to HTML is a Rust library that converts LaTeX-formatted text into equivalent HTML.
This crate is designed to help developers transform LaTeX documents or fragments into structured HTML. Styling is intentionally kept minimalโdevelopers are encouraged to apply custom CSS or integrate this library into a broader styling pipeline.
โ Lightweight LaTeX parsing and conversion to HTML
โ Supports the following LaTeX commands:
\section, \subsection, \subsubsection, \paragraph, \subparagraph\textbf, \textit, \underline, \emph\textcolor, \fontsize (planned)$...$, \[...\], \begin{equation} (planned)itemize, enumerate, description (planned)tabular (planned)figure, \includegraphics (planned)\label, \ref, \cite, \footnote (planned)thebibliography, \bibitem (planned)\newcommand, \renewcommand (planned)RawLatexNote: Features marked (planned) are on the roadmap but not yet implemented.
use late2htm::convert_latex_to_html;
fn main() {
let latex_code = r"\\section{Hello}This is \\textbf{bold}.";
let html = convert_latex_to_html(latex_code);
println!("{}", html);
}
use late2htm::convert_latex_to_html;
fn main() {
let input = r"\section{Main}\subsection{Sub}\subsubsection{SubSub}\paragraph{Para}\subparagraph{SubPara}Text \textbf{bold} and \textit{italic} and \underline{under} and \emph{emph}.";
let html = convert_latex_to_html(input);
println!("{}", html);
}
parser โ Parses LaTeX code into an AST (LatexNode enum).htmlgen โ Converts AST into HTML.ast โ Defines the LaTeX abstract syntax tree (LatexNode).This project is licensed under the MPL-2.0 License.
Contributions, issues, and feature requests are welcome! Feel free to fork and submit pull requests.