Skip to content

Commit f29400e

Browse files
committed
feat: first attempt to use latexmlc
1 parent abda5d4 commit f29400e

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

Makefile

+16-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Targets
4343
all-recursive:
4444
Build all documents in the source tree.
4545

46-
dvi, eps, jpg, pdf, png, ps, svg:
46+
dvi, eps, html, jpg, pdf, png, ps, svg:
4747
Build all documents with the specified file format in the current directory.
4848

4949
help:
@@ -179,6 +179,7 @@ LATEX =
179179
DVIPS =
180180
DVIPDF =
181181
PS2PDF =
182+
LATEXMLC =
182183
DVISVGM =
183184
PDFTOPPM =
184185
GS =
@@ -212,6 +213,7 @@ PDFLATEX_DVI_OPT = -output-format=dvi
212213
DVIPS_OPT = -Ppdf -z
213214
DVIPDF_OPT =
214215
PS2PDF_OPT = -dPDFSETTINGS=/prepress -dEmbedAllFonts=true
216+
LATEXMLC_OPT =
215217
DVISVGM_OPT = -n
216218
PDFTOPPM_OPT = -singlefile
217219
PDFTOPPM_JPG_OPT = -jpeg
@@ -248,7 +250,7 @@ CL_WARN = [35m
248250
CL_ERROR = [31m
249251

250252
.SUFFIXES:
251-
.SUFFIXES: .log .bb .xbb .jpg .png .pdf .odt .eps .ps .svg .dvi .fmt .cls .sty .tex .dtx .ltx
253+
.SUFFIXES: .log .bb .xbb .jpg .png .pdf .odt .eps .html .ps .svg .dvi .fmt .cls .sty .tex .dtx .ltx
252254

253255
DEPDIR = .dep
254256
DIFFDIR = .diff
@@ -592,6 +594,11 @@ ps2pdf = $(call cache,ps2pdf_impl) $(PS2PDF_OPT)
592594

593595
ps2pdf_impl = $(call pathsearch2,ps2pdf,PS2PDF,ps2pdf)
594596

597+
# $(latexmlc)
598+
latexmlc = $(call cache,latexmlc_impl) $(LATEXMLC_OPT)
599+
600+
latexmlc_impl = $(call pathsearch2,latexmlc,LATEXMLC,latexmlc)
601+
595602
# $(dvisvgm)
596603
dvisvgm = $(call cache,dvisvgm_impl) $(DVISVGM_OPT)
597604

@@ -864,6 +871,7 @@ cleanfiles_impl = $(wildcard $(strip \
864871
$(srcltxfiles:.ltx=.fmt) \
865872
$(srctexfiles:.tex=.dvi) \
866873
$(srctexfiles:.tex=.eps) \
874+
$(srctexfiles:.tex=.html) \
867875
$(srctexfiles:.tex=.jpg) \
868876
$(srctexfiles:.tex=.pdf) \
869877
$(srctexfiles:.tex=.png) \
@@ -1116,6 +1124,8 @@ dvi: $(target_basename:=.dvi)
11161124

11171125
eps: $(target_basename:=.eps)
11181126

1127+
html: $(target_basename:=.html)
1128+
11191129
jpg: $(target_basename:=.jpg)
11201130

11211131
pdf: $(target_basename:=.pdf)
@@ -2007,6 +2017,10 @@ check_rerun = grep 'Rerun\|Please rerun LaTeX' '$(build_prefix)$*.log' | grep -v
20072017
$(mv_epstopdf), \
20082018
)
20092019
2020+
.tex.html:
2021+
@$(init_toolchain)
2022+
@$(call exec,$(latexmlc) --destination=$*.html $<)
2023+
20102024
# This always updates the timestamp of the target (.log).
20112025
$(build_prefix)%.log : %.tex
20122026
@$(MAKE) -s $*.$(default_target)

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Targets
6868
Build all documents in the current directory.
6969
- `all-recursive`:
7070
Build all documents in the source tree.
71-
- `dvi`, `eps`, `jpg`, `pdf`, `png`, `ps`, `svg`:
71+
- `dvi`, `eps`, `html`, `jpg`, `pdf`, `png`, `ps`, `svg`:
7272
Build all documents with the specified file format in the current directory.
7373
- `help`:
7474
Show help message.

0 commit comments

Comments
 (0)