Skip to content

Commit 4fbf305

Browse files
committed
Generate HTML via make4ht
So the patch basically add some script for generating html files. In html.cfg : Add tables of contents Specify the layout of lkmpg.html In Makefile : Add a new target `html` for generating html files and put them in html/ directory. Add a symbolic link `index.html` linked to `lkmpg.html` In lkmpg.tex : Turn off the \tableofcontens section when using make4ht to prevent from errors
1 parent 4639ca1 commit 4fbf305

File tree

4 files changed

+60
-0
lines changed

4 files changed

+60
-0
lines changed

.gitignore

+12
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,15 @@ _minted-lkmpg
1515
*.out
1616
lkmpg.pdf
1717
*.toc
18+
19+
# make4ht
20+
*.html
21+
*.svg
22+
*.tmp
23+
*.css
24+
*.4ct
25+
*.4tc
26+
*.dvi
27+
*.lg
28+
*.idv
29+
*.xref

Makefile

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ all: lkmpg.tex
44
bibtex main >/dev/null || echo
55
pdflatex -shell-escape $< 2>/dev/null >/dev/null
66

7+
html: lkmpg.tex
8+
make4ht --shell-escape --utf8 --format html5 --config html.cfg --output-dir html lkmpg.tex
9+
ln -sf lkmpg.html html/index.html
10+
rm -f lkmpg.xref lkmpg.tmp lkmpg.html lkmpg.css lkmpg.4ct lkmpg.4tc lkmpg.dvi lkmpg.lg lkmpg.idv lkmpg*.svg lkmpg.log lkmpg.aux
11+
712
clean:
813
rm -f *.dvi *.aux *.log *.ps *.pdf *.out lkmpg.bbl lkmpg.blg lkmpg.lof lkmpg.toc
914
rm -rf _minted-lkmpg
15+
rm -rf html
16+
17+
.PHONY: html

html.cfg

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
\Preamble{xhtml}
2+
3+
\Configure{tableofcontents*}{chapter,section,subsection}
4+
5+
\Css{* :not(img) {
6+
max-width: 100\%;
7+
width: 50vw;
8+
height: auto;
9+
margin: 0 auto;
10+
}}
11+
12+
\Css{* {
13+
font-size: 1vw;
14+
}}
15+
16+
\Css{.ecrm-0500 {
17+
font-size: 70\%;
18+
font-style: italic;
19+
color: gray;
20+
-webkit-user-select: none;
21+
-moz-user-select: none;
22+
-o-user-select: none;
23+
user-select: none;
24+
}}
25+
26+
\Css{.ecrm-0500:after {
27+
content:" ";
28+
white-space: pre;
29+
-webkit-user-select: none;
30+
-moz-user-select: none;
31+
-o-user-select: none;
32+
user-select: none;
33+
}}
34+
35+
\begin{document}
36+
\EndPreamble

lkmpg.tex

+4
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@
3939
\begin{document}
4040

4141
\maketitle
42+
\ifdefined\HCode
43+
% turn off TOC
44+
\else
4245
\tableofcontents
46+
\fi
4347

4448
\section{Introduction}
4549
\label{sec:introduction}

0 commit comments

Comments
 (0)