Some notes for Beamer-HTML-manual
Introduction
I have completed a project called Beamer-HTML-manual recently. The corresponding web address is https://www.beamer.plus. Here are some notes that I would like to take for it.
The Basic Procedure
- Find the corresponding
.texfile(s). Usually, for a large project there is a main file and many other subfiles. We need to insertlwarppackage into the preamble of the main file and make some settings according to thelwarpdocumentation. -
Compile the main file using
pdf/xe/lualatexfor the first time to produce the configuration file and then use thelwarpmktool provided bylwarp. For more details, see the package documentation.There are usually some special environments and macros defined for special output effect in the PDF documentation. You have to inject
\BlockClassand\InlineBlockprovided bylwarpinto the definition code of these environments and macros, in this way, the corresponding HTML parts will be enclosed by specificdivandspantags which are necessary for style customization.Note: There may have some compilation errors when you start your first compilation journey. For example, one have to set
doc2option toltxdocdocument class, otherwise you can not compile successfully.Note: If you try to compile the source code of beamer documentation using the traditional tool
pdflatex, you will fail. In fact, the beamer PDF manual is produced usingl3buildsince it has to generate lots of inner/outer/font/color theme demos first. So I analyze the source code and write a Python script to generate the demo PDFs in a separate directory and usepdfcairotool to convert them intosvgformat. - After step 2, I get the raw HTML files. Now it’s time to refine them using the BeautifulSoup module. Several important goals are:
- Create table of contents, including global TOC for the whole project and local TOC for every HTML page
- Delete unnecessary tags
- Add header and footer
- Customize the home page
-
Create
cssfile and control every detail of the HTML page by this. It’s vital to achieve the responsive design to make the web page readable on most digital devices.Note: The TOC pop up function on mobile phone devices is accomplished with the help of JavaScript.