I'm really interested to publish my thesis on a website HTML + CSS (when it's done) augmented with tools to annotate it, like the philoweb initative (see here, and here).
I know the universal converter Pandoc or the latex2html, but i'm interested to know if others tools exists, or if some users already create a batch workflow to make this conversion automaticaly.
Perhaps it can be a community wiki question ?
Updated list (16 april 2015) :
-
latex2html (discontinued)
-
Support for latex in great Substance.io composer for web, used by elife lens open source solution (to survey)
MWE creation :
I propose a first link to collaborate on a complex MWE to test these tools, which contain all complex elements you want :
Link to public MWE on sharelatex
Things to transform and eventually beautify with some js :
- Math
- Complex Side Caption
- Bibliography
- Public annotation
Example of great conversion :
Best Answer
I will show a solution with
tex4ht
. I used your sample text and added some math samples from the internet. You can see the complete resulting webpage on my Github page. All code is also hosted on Github.You have four wishes, some of them can be solved using external Javascript tools, for others we must create custom JS scripts.
tex4ht
can be configured using.cfg
file. This file has special structure:we can require some packages before
\Preamble
command, which we may use for some helper packages. In our example, we may need two packages:tex4ht
you need recently updated TeX Live for latest bug fixes for
tex4ht
Memoir support, in this case you need only fo fix this issue with double Bibliography entry in the TOC.This can be fixed with
mem4hack.sty
:the other supporting package is
tools.sty
:This simplifies inclusion of
CSS
andJS
files in your project.Regarding used libraries, we can use
mathjax
for math support andhypothes.is
for annotating. Unfortunately, this doesn't work with local pages, you have to use a webserver (but you can install it on your local computer, you don't need actual server).Math example:
annotation examples:
For sidebar, you can make a standalone file for each chapter, with local TOC for sections and subsections. So you can make sidebar containing this TOC and links to previous and next chapter.
The code is here
js/sidebar.js
:this uses standard Javascript DOM functions, only small library
js/fw.js
is being used:The
TOC
can be hidden by click on the^^^
text.For bibliography, we can load bibliography page using
AJAX
and show the citations in a window when you point a cursor over a citation. Window can be closed by clicking anywhere in the document.File
js/bib.js
:We can also make a better typography, I really like Viljami Salminen's responsive CSS boilerplate. Use the
css/scale.css
file.We can put it all together now, make file
myconfig.cfg
:In the
\Preamble
command, options fortex4ht
are specified.xhtml
requestsxhtml
output,2
breaks document into standalone web page at every\chapter
(1
would break it at every part,3
at every section ...),mathml
requests conversion of math tomathml
.Configurations should go after
\Preamble
command.Internal
js
andCSS
files are included using\AddJs
resp.\AddCss
commands.mathjax
andhypothes.is
are included using links to external pages, which is configured usingthis configuration add stuff to the html
<head>
element.You can add
CSS
styles using\Css
command. The included styles are pretty basic, you may want to (and really should) modify them for better look, concentrated only on functionality, not aesthetics)Now you can compile your file using
or better, use make4ht which is alternative build system for
tex4ht
. This build file will copy all used files to/var/www/html/reyman/
directory, so you can open in your browser this address: localhost/reyman/thesis.html and everything should work. If you have Unix like system, Apache web server and write permissions to that directory. Filethesis.mk4
:Compile with
to speedup the compilation, you can use
which will compile the document only once with LaTeX and it will skip the
bibtex
.You can see the result on my Github page