BD Tech Concepts LLC

to HTML Converter — the lwarp package

The lwarp package directly converts LaTeX () to HTML5 and CSS, using external utility programs only for the final conversion of text and images, under the control of the provided TeXLua script.

A tutorial is provided to quickly introduce the user to the major components of the package. In most cases, it is sufficient to simply load lwarp near the start of the document’s preamble.

Print and HTML versions of each document may coexist, each with its own set of auxiliary files. Support files are self-generated. Assistance is provided for import into EPUB conversion software and word processors.

Documents may be produced by DVI or PDF LaTeX, LuaLaTeX, XeLaTeX, or customized systems such as perltex, pythontex, etc. Math may be represented by SVG images with LaTeX expressions in the ALT tags, or by MathJax with advanced equation numbering under the direct control of lwarp.

A modular package-loading system uses the lwarp version of a package for HTML when available. More than three hundred LaTeX packages are supported by these high-level source-compatibility replacements, including complicated tables (which copy/paste well into LibreOffice Writer), memoir and koma-script, CTeX, cleveref, caption, mdframed, siunitx, and many popular packages for tabulars, floats, graphics, theorems, the title page, bibliography, indexing, footnotes, and editorial work.

TeX is a self-modifying tokenized macro-expansion language. Since lwarp is written directly in LaTeX, it is able to interpret the document’s meaning at a deeper level than external conversions which merely approximate TeX. HTML5 and CSS3 are leveraged to provide advanced features such as booktabs trim, multicolumns, side-by-side minipages, and JavaScript-free navigation.

lwarp requires the installation of the Poppler utilities, which are available as packages on the major operating systems, and also included in MiKTeX. Perl is also required by some of the Poppler utilities. Installation instructions are included.

Lwarp technology white paper

For an introduction to the technology used to create the lwarp package, please see the publication Producing HTML directly from : the lwarp package.

Latest News

v0.63:

Improved mdframed. Fixes for xeCJK. Tested and added support for numerous classes and packages for CJK. Chinese: cjkpunct, upzhkinsoku, xpinyin, zhspacing, zhlineskip. Japanese: pLATEX, upLATEX, bxjsarticle and related, ltjsarticle and related, luatexja, luatexja-fontspec, ujarticle and related, zxjatype. Korean: kotex, luatexko, xetexko.

v0.62:

Added option for HTML page titles to show section name before/after overall website name. Updated MiK docs. Updated asymptote docs. Added C and xeCJK. Fixed or updated algorithm2e, chemfig, register, nicefrac, units, xfrac, textcomp, xunicode, ulem. Added bitpattern, pdfcomment, pdfmarginpar, tram, unitsdef, xechangebar. Added musicography, octave, semantic-markup. Added 2in1, flippdf, notespages, rviewport, twoup.

v0.61:

Supports custom compilation commands, such as for perltex, pythontex, etc. Fixed paragraph tags in a tabular, captions for supertabular and xtab, DVI EPS images, newfloat lists, CSS for footnotes. Added epsfig, psfrag, psfragx, pstool, and a dozen other miscellaneous packages. Documentation and indexing improvements.

v0.60:

Fixed longtable package slowdown and memory management with very long tables. Fixed listings package HTML entities, and for use inside a list environment. Fixed diagbox package HTML paragraph tags. Added 2up, twoup-gen, booklet. Added bophook, draftfigure, fullminipage, grid-system, layaureo. Added leading, widows-and-orphans. Added fancytabs, thumb, thumbs.

v0.59:

Improved error checking for lwarpmk. Added support for DVI latex. Added lwarpmk epstopdf to convert large numbers of EPS images. Fix for Mathjax chapter numbers. Added MathJax support for nicefrac, units. Added asymptote, pdftricks, pstricks, pst-eps. Added breqn, SIunits. Added bxpapersize, canoniclayout, draftcopy, fnbreak, nccfancyhdr. Added accsupp, axessibility. Added xunicode. Improved and now supports epstopdf. Tested to work as-is: eepic, sepfootnotes.

v0.58:

Extensive improvements for indexing and glossaries. Added support for makeindex. (Previously xindy only.) Added indexing packages: imakeidx, index, repeatindex, splitidx. Added improved automation for lwarpmk generation of indexing and glossaries. Added PDF-inclusion packages attachfile, attachfile2, intopdf, pdfpages, pdfx. Added package cases. Tested to work as-is with hvindex, notes2bib.

v0.57:

Adds support for equation footnotes with MathJax. Adds lateximage alt tag localization. Fixes for lateximages, \href, \subref, \rule, \boxframe, marginnote, ellipsis, breakurl. Adds support for float and rotfloat styles ruled and boxed. Adds packages algorithm2e, register, ltablex, xltabular, xellipsis, trimclip, errata, vowel, xpiano. Verified to work as-is with packages gauss, phonrule, piano, SIunits, tikzcodeblocks.

v0.56:

Added lwarpmk pdftosvg to convert user images to SVG. Added support for -shell-escape. Added support for array w and W columns, double \hlines and rules, arydshln dashed rules. Improved \multicolumn parameter handling. Fixed \thinspace, paralist compact environments. Added parnotes, quoting, lua-check-hyphen, tocenter, underscore. Verified works as-is with babelbib, bibunits, bodegraph, fast-diagram, nicematrix, structmech.

v0.55:

Fixes for file links, EPUB conversion, float optional argument regression, \phantomsection, overfull boxes in lateximages, QED symbol in a lateximage, \centering etc. with koma-script. Adds clrdblpg.

v0.54:

Improved lwarpmk error checking and messages. Added documentation regarding bibtex, polyglossia, macros in section names. Added options for xindy and pdftolatex. Figures and tables now honor \centering, etc. Fixes for tikz, ragged2e, hyperref, glossaries, textcomp, latex verse environment. Minor update for memoir. Added inputencx, bibunits, chngpage, forest, magaz, gridset. Prevents packages ae, aecc, t1enc, wasysym.

v0.53:

Added a warning about corrupted images due to the need to recompile the document one more time. Added the lwarpmk cleanlimages command.

v0.52:

Fixes for memory overflow while generating numerous images, equation* with split, tabbing inside a lateximage, MathJax script. Adds SVG math scaling, global MathJax custom functions. Fixes for footnote numbering, paragraph tags, \kill in a lateximage, problems when not UTF8 encoding, \texorpdfstring in a section name. Adds verbatim footnotes with fancybox, fancyvrb. Fixes for special characters with hyperref, url. Updates for new versions of graphicx, endfloat.

v0.51:

Improved SVG math, Mathjax, tikz, fancybox, and titling. Various additional fixes. Added mhchem, chemfig, chemformula, chemmacros, chemnum, chemgreek, epstopdf-base, grid, ltxgrid.

v0.50:

SVG math now is converted using multiple CPU processors/cores. Inline SVG math images are hashed and reused when identical. Improved SVG display math, siunitx units, verbatim and listings alignment. Additional fixes for SVG math, authblk, ntheorem. Added xy, epstopdf, diagbox, pbox, bytefield, axodraw2, phfqit, schemata, dblfloatfix, nonfloat, morefloats.

v0.49:

Added xcolor \rowcolors. Added vwcol, vertbars, hyphenat, lineno, fnlineno, figsize, hypdestopt, pagegrid, pdfrender, luacolor, resizegather. Several bug fixes.

v0.48:

Updated compatibility for cleveref v0.21. Improved SVG math, siunitx. Numerous minor fixes. Added colortbl, chapterbib, acro, acronym, hypernat, hypcap, stfloats, vmargin, fancyheadings, fancyref.

v0.47:

Improves SVG math baseline and sizing. Fixes for SVG math in captions, subcaptions, and \nameref. Adds packages endheads, multitoc, sectionbreak, blowup, xurl.

v0.46:

Fix for spaces in \usepackage. Additional improvements in SVG math. Allows MathJax inside verse.

v0.45:

Adds memoir. Adds cite, natbib, backref. Also works as-is with biblatex. Fixes bibliography italic names. Adds subfigure, prettyref, hanging, midpage, flafter, fltrace, changebar, endfloat, continue, fwlw, turnthepage, footnpag, pagesel, textfit, titleref. Fixes for underscores in labels, empty lines between tabular rows, SVG math in minipages and lists and subfig.

v0.44:

Added Koma-script classes and packages. Completed todonotes and luatodonotes. Added todo, easy-todo, fixmetodonotes, fixme, soulutf8, soulpos, cancel, section, fancyref, iffoddpage, preview, atbegshi, watermark, hang, ltxtable. Improved algorithmicx, tocloft, HTML title and author options. Added list and trivlist environments. Fix for \multicolumn alignment for word processor conversion. Fix for MathJax when combined with images.

v0.43:

Added FootnoteDepth for printing pending footnotes. Fixed for tabular column specifications, \multicolumn specifications, \bottomrule. Fixed for math equation*, SVG math in a section name, references in SVG math. Made several macros robust for hyperref. Added todonotes and luatodonotes (but only disabled for now), and breakurl.

v0.42:

Greatly-improved copy/paste into the LibreOffice word processor. Fix for text copy/paste of AMS Math environment numbers and names. Improved \ensuremath. Adding tabbing environment, overpic package. Improved textcomp and realscripts.

v0.41:

Added tabular vertical rules, booktabs margin and trim.

v0.40:

Improved \graphicspath, grffile. Improved and textcomp symbols. Fixes for bigdelim with improved HTML output, additional objects inside a lateximage, xltxtra with , tocbibind, \multicolumnrow with older versions of xparse and multirow, \underline. Added support for adjmulticol, cuted, midfloat, pfnote, fnpos, dblfnote, stabular, tabls, sectsty, anonchap, quotchap.

Sample Output

This website:

  • • Check the HTML code of these web pages for examples of the lwarp generator’s output.

  • • Download a 7 MB PDF print version of this website, to compare with the online HTML version.

Technical book conversion:

Print PDF:

Introduction to Gear Design — Print — PDF

Tablet PDF:

Introduction to Gear Design — Tablet — PDF

HTML version:

Introduction to Gear Design — Website — HTML

Sample camping trailer manual:

PDF print version:

Camping Trailer Manual — PDF

HTML version:

Camping Trailer Manual — HTML

Download

Download the lwarp package from the lwarp page on CTAN — the Comprehensive Archive Network, or use your distribution’s update tools.

The lwarp v0.63 manual is also available here.

Supported Packages

Table 1 lists some of the various features which may be used. Hundreds of packages have been adapted for lwarp, and many more work without modification.

Table 1: –HTML generation — lwarp package — Supported features

Category

Status and supported features.

Engines:

DVI , pdf, , Lua, p, up

Compiling:

latexmk, perltex, pythontex, make, etc.

Classes:

article, book, report, scrartcl, scrbook, scrreprt, memoir, C-related, bxjsarticle and related, ltjsarticle and relatex, ujarticle and related.

Koma-script:

scrextend, scrhack, scrlayer. Others as listed below.

Memoir:

memhfixc

Languages:

babel, polyglossia. cjkpunct, xeCJK.

Chinese:

C, ctex, upzhkinsoku, xpinyin, zhlineskip, zhspacing.

Japanese:

p, up, bxjsarticle and related, ltjsarticle and related, luatexja, luatexja-fontspec, ujarticle and related, zxjatype.

Korean:

kotex, luatexko, xetexko.

Page layout:

2in1, 2up, a4, a4wide, a5comb, addlines, anysize, atbegshi, blowup, booklet, bophook, bxpapersize, canoniclayout, clrdblpg, continue, draftcopy, draftfigure, draftwatermark, ebook, everyshi, fancyhdr, fancytabs, flippdf, fullminipage, fullpage, fwlw, geometry, grid, grid-system, gridset, layaureo, leading, ltxgrid, nccfancyhdr, notespages, pagegrid, pdfprivacy, pagesel, preview, scrlayer-scrpage, textarea, threadcol, thumb, thumbs, titleps, tocenter, turnthepage, twoup, typearea, vmargin, watermark, zwpagelayout.

Tested to work as-is: underlin.

Sectioning:

Adds FileDepth for splitting the HTML output. Files may be numbered sequentially or named according to section name. Common short words and punctuation are removed from the filenames. anonchap, fncychap, quotchap, section, sectionbreak, sectsty, titlesec.

Table of contents, figures, tables:

Supported, with hyperlinks. multitoc, shorttoc, titletoc, tocbasic, tocbibind, tocloft, tocstyle.

Title page:

\maketitle, titlepage, authblk, titling.

Front & back matter:

abstract, appendix.

Indexing:

makeindex and xindy are supported, with hyperlinks.

idxlayout, imakeidx, index, makeidx, repeatindex, splitidx.

Tested to work as-is: hvindex, sepfootnotes.

Glossary:

glossaries and xindy are used.

Bibliography:

babelbib, backref, biblatex, bibunits, chapterbib, cite, hypernat, natbib.

Tested to work as-is: notes2bib.

Cross-references:

bookmark, breakurl, cleveref, fancyref, hypdestopt, hyperref, prettyref, titleref, url, varioref, xurl.

Margin notes:

marginfit, marginfix, scrlayer-notecolumn.

Footnotes:

Adds FootnoteDepth to print footnotes at section breaks. dblfnote, endheads, endnotes, fnbreak, fnpos, footmisc, footnote, footnpag, marginnote, nccfoots, pagenote, parnotes, pfnote, sidenote.

Math:

Converted to SVG images with HTML <alt> tags containing the source for the math expression. MathJax supported as an alternative. amsmath: environments are supported. User-defined macros are available during converson, due to native processing.

Theorems:

Native theorems, amsthm, ntheorem, theorem.

Additional math:

Math fonts via SVG images, breqn, cases, resizegather, xy.

Tested to work as-is: amscd, bm, braket, delarray, guass, nicematrix, pb-diagram, tikz-cd, etc.

Display math with \displaymathother:

Complicated math objects in display math, such as tikz-cd, etc.

Units and fractions:

nicefrac, SIunits, siunitx, units, unitsdef, xfrac.

Tested to work as-is: SIunits.

Floats:

Appear where declared. capt-of, caption, cutwin, dblfloatfix, endfloat, fix2col, flafter, float, floatflt, floatrow, fltrace, hypcap, keyfloat, morefloats, newfloat, nonfloat, placeins, rotfloat, stfloats, subcaption, subfig, subfigure, subfloat, trivfloat, wrapfig.

Tabular:

tabular environment, array, arydshln, bigdelim, booktabs, colortbl, diagbox, longtable, ltablex, ltxtable, multirow, supertabular, tabularx, tabulary, threeparttable, xltabular, xtab.

Graphics:

graphics and graphicx. \includegraphics supports width, height, origin, angle, and scale tags, and adds class. References to PDF files are changed to SVG, other image types are accepted as well. \rotatebox and \scalebox are supported as well as HTML can handle. rotating is emulated but all objects are unrotated. picture, tikz, and xy are converted to an SVG image.

asymptote, epsfig, epstopdf, figsize, grffile, overpic, psfrag, psfragx, pst-eps, pstool, pstricks, rviewport.

Tested to work as-is: eepic, tikz-3dplot.

xcolor:

Full package color names, any color models, and mixing. \textcolor, \colorbox, \fcolorbox. Enhanced for HTML compatibility.

Lists:

Standard environments, enumerate, enumitem, hang, paralist.

Environments:

Standard environments.

minipage, \parbox:

Some HTML-imposed limitations. Nested minipages are supported. pbox.

Quotations:

copyrightbox, csquotes, epigraph, quoting, verse.

Verbatim:

fancyvrb, moreverb, shortvrb, verbatim.

Frames:

boxedminipage2e, fancybox, framed, mdframed, shadow, vertbars.

Multi-columns:

adjmulticol, multicol, vwcol.

Margins:

fullwidth, hanging, midpage.

Line numbering:

fnlineno, lineno.

Direct formatting:

\emph, \textsuperscript, \textbf, etc are supported. \bfseries, etc. are only supported in some cases. cancel, ellipsis, hyphenat, lettrine, lips, lua-check-hyphen, luacolor, magaz, nowidow, pdfrender, realscripts, relsize, scalefnt, soul, soulpos, soulutf8, textfit, thinsp, trimclip, ulem, underscore, uspace, widows-and-orphans, xellipsis.

Acronyms:

acro, acronym.

Ordinals:

engord, fmtcount, nth.

Text ligatures:

Ligatures for symbols are supported. Ligatures for f, q, t are intentionally turned off because many simpler browsers do not display them correctly. Modern full-featured browsers re-create these ligatures on-the-fly.

Horizontal space:

HTML output for thin-unbreakable, unbreakable, \enskip, \quad, \qquad, \hspace.

Rules:

\rule with width, height, raise, text color.

HTML reserved characters:

\&, \textless, and \textgreater are converted to HTML entities.

Fonts:

Used as-is. Appear in SVG math expressions or embedded image environments.

Symbols:

Native diacriticals, chemgreek, textalpha, textcomp, textgreek, xunicode.

Tested to work as-is: gensymb.

Files:

attachfile, attachfile2, hyperxmp, intopdf, pdfpages, pdfx, xmpincl.

Science and engineering:

algorithm2e, algorithmicx, axodraw2, bitpattern, bytefield, chemfig, chemformula, chemgreek, chemmacros, chemnum, listings, mhchem, phfqit, register.

Tested to work as-is: blochsphere, bodegraph, bohr, circuitikz, elements, engtlc, fast-diagram, hepnicenames, heppennames, linop, pgfgantt, physics, simpler-wick, slashed, structmech, tikzcodeblocks.

Arts and humanities:

forest, musicography, octave, schemata, semantic-markup, vowel, xpiano.

Tested to work as-is: phonrule, piano, tikz-dependency.

Editorial:

changebar, easy-todo, errata, fixme, fixmetodonotes, pdfcomment, pdfmarginpar, todo, todonotes, tram, xechangebar.

Accessibility:

accsupp, axessibility.

Debug:

chkfloat, cmdtrack, dprogress, lua-visual-debug, refcheck, srcltx, srctex, vpe, xbmks.

Working as-is:

Various utility, calculation, file, and text-only packags, such as calc, fileerr, somedefs, trace, xspace. Also, most math-only packages, including specialized typesetting for various fields of science and engineering.