package htmlfromtexbooks

  1. Overview
  2. Docs
From TeX To Human-Readable HTML

Install

Dune Dependency

Authors

Maintainers

Sources

v3.3.2.tar.gz
md5=8eafd939e9dbcb31919c5be0ed144840
sha512=4e7d13452e0a6b358e013711085500d82faf034eb03845be7de86a631fbc7b66a9aede7eba63cfd35460992c16e74de6c7db9aa152234f7dbc3acf9ab31c12ee

Description

A simple command line tool to generate human-readable HTML from a LaTeX Book

Published: 23 Mar 2022

README

README.md

HTMLFromTeXBooks

A simple command-line tools to generate HTML code from TeX files.

coco33920 - HTMLFromTeXBooks GitHub release License - MIT

View site - GH Pages

What is this project

Welcome to this little project, I decided to make this because I like OCaml and the previous version of it was in Python. This program translates TeX Books (simple one like stories kind of book) to HTML. I use this to publish the HTML version of agh and to publish chapters written in TeX on ScribbleHub.

What this project is not

The purpose of this project is not and never will be a kind of "TeX To HTML" compiler, I do not intend to implement the full TeX and LaTeX specification. This is a tool mainly done for me for my usage, that is publishing my book on ScribbleHub and the web. I'm sure you can find real compilers if you want to support the full specification of TeX and LaTeX

Usage

The tool automatically detect the first tex file which's name's not "glossary.tex", scrapes the name and eventual glossary input from the preamble and throw out an html file so the easiest way to use it is just

htmlfromtexbooks

by default it only prints after the first (or the nth depending on the command line args) chapter was read you can change that behaviour with the --write argument

htmlfromtexbooks --write

A full usage breakdown will be quickly made

Install

Downloading last stable from release

The Automatic Script install is available here, just type this command and the htmlfromtexbooks is installed under ~/.local/bin

curl https://raw.githubusercontent.com/coco33920/HTMLFromTeXBooks/master/downloading.sh | sh

Alternatively you can download the script then run it if you want to read it before executing it

wget https://raw.githubusercontent.com/coco33920/HTMLFromTeXBooks/master/downloading.sh
sh downloading.sh

Or executing the individual commands themselves

wget https://github.com/coco33920/HTMLFromTeXBooks/releases/latest/download/htmlfromtexbooks
mv htmlfromtexbooks ~/.local/bin/htmlfromtexbooks
chmod +x ~/.local/bin/htmlfromtexbooks

Building from source

The script to automatically build from sources

curl https://raw.githubusercontent.com/coco33920/HTMLFromTeXBooks/master/building.sh | sh

It builds it with dune and install it under the OPAM path with the name htmlfromtexbooks, which performs these commands

git clone https://github.com/coco33920/HTMLFromTeXBooks
cd HTMLFromTeXBooks
dune build @install 
dune install

Support

The project currently translate LaTeX to human-readable HTML files (the line breaks in the HTML follows the line breaks in the TeX file while line breaks on HTML is let to the browser.) and supports the following features:

  • Parsing chapter by chapter

  • Automatically detect a tex file, generate a name for the output, detects the glossary and use the configuration file for name/starting chapter

  • Extracting the title of the tex file for name

  • Printing chapter

  • LaTeX center environment

  • LaTeX macros

    • textit is replaced by <i>

    • textbf is replaced by <b>

    • newline, \\, and par puts a <br>

    • bigskip closes the paragraph and open another one.

  • Some math

    • Inline math with $

    • Math env

      • Align*

      • Align

      • Equation

      • Equation*

Math image are generated with the latex.codecogs.com backend an example bellow with $\int^b_a f(x) \mathrm(d)x$

Near Future TODO List

  • parsing glossary entries from a glossary file and printing the gls with a link to the glossary

  • reference

  • supports for section,subsection and subsubsection (<h3>,<h4> and <b> for books and <h2> <h3> <h4> for articles)

If you have an idea post an ISSUE, any contribution is welcomed :) Let make no one ever forgets the name ~~Enter..~~ OCAML :)!

Installing

Be sure to have dune installed and OCaml version >=4.08

ocaml --version #must be >= 4.08
opam install dune

and

git clone git@github.com:coco33920/HTMLFromTeXBooks.git
dune build @install
dune install

Usage

WILL COME

Dependencies (2)

  1. dune >= "2.9"
  2. ocaml >= "4.08.0"

Dev Dependencies (1)

  1. odoc with-doc

Used by

None

Conflicts

None

OCaml

Innovation. Community. Security.