[tex4ht] Too many DVI errors. stack empty at pop command, conficts, bm package, siunitx, dvilualatex
Nasser M. Abbasi
nma at 12000.org
Fri Jan 1 03:21:39 CET 2016
This is follow up on the make4ht errors I was getting,
"max_count exceeded". But since I finally found the conflict
that was causing it, and it is all related to DVI problems,
I thought to start new thread.
Here is a MWE, which shows the issue. What happens is that
DVI creates corrupted DVI file or has an error making the dvi.
This in turn causes make4ht to show the errors. So the source
of the problem is in the dvi.
There are so many conflicts between some packages. It all
happens when using the --lua option with make4ht.
So this might be another bug in dvilualatex but I'll leave the
experts to decide.
Here is MWE
--------------------------
\documentclass[12pt]{report}%
\usepackage[T1]{fontenc}
\usepackage{amsmath,mathtools}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{siunitx}
\usepackage{xfrac}
\usepackage{bm}
\sisetup{
fraction-function = \sfrac ,
load-configurations = abbreviations ,
per-mode = fraction ,
number-unit-product = \text{\, }
}
\begin{document}
\begin{align*}
V_{\infty_a} &= \sqrt{V_A^2 + v_{moon}^2 -
2 V_A v_{moon} \cos{\gamma_A} }\\
&= \SI{1.18226}{\km\per\second}
\end{align*}
$r_{bo}=\SI{1760}{\km}$ \footnote{the same value used in~part~II}.
\end{document}
------------------------
Compile using
make4ht --lua -u -e main.mk4 foo.tex
(the main.mk4 file is the one thanks to Michal he just send,
which I also paste at the end below so this email will be self contained
and has everything to reproduce this)
Here is the output of the above command:
----------------------------------------
...
t4ht.c (2012-07-25-19:28 kpathsea)
t4ht -p
foo.dvi
(/usr/local/texlive/2015/texmf-dist/tex4ht/base/unix/tex4ht.env)
Entering foo.lg
Entering foo.css
Entering foo.tmp
Make4ht: dvisvgm -v1 -n -c 1.15,1.15 -p 1- foo.idv
DVI error: stack empty at pop command <======= !!!
Make4ht: tex4ht -cunihtf -utf8 foo can be executed only 1x
Make4ht: t4ht -p foo.dvi can be executed only 1x
Parse LG
parse_lg process file: foo.html
----------------------------------------------
Here are some variations:
1) removing the bm packages removes the error!
Why does the bm package have anything to do with is?
2) removing the code that does the \sisetup also removes the DVI error.
3) commenting out the \usepackage[T1]{fontenc} now gives
DVI error: invalid DVI file instead of stack empty at pop command.
4)commenting out the \footnote remove the stack empty
at pop command error! i.e. replacing the line
$r_{bo}=\SI{1760}{\km}$\footnote{the same value used in~part~II}.
with
$r_{bo}=\SI{1760}{\km}$
what does \footnote has to do with all of this, I have no idea.
If I keep at this, I can come up with more variations. But
for now, I am able to resolve the issue I had in my main build.
I simply removed the \sisetup code, and now everthing build fine!
no more errors from make4ht and DVI is happy.
I hope someone is able to repduce this also. I am using TL 2015,
fresh update of all packages.
Here is main.mk4 (Michal Hoftich, version 12/31/2015)
----------------------------------------------------------
Make:add("dvisvgm","dvisvgm -v1 -n -c 1.15,1.15 -p 1- ${input}.idv")
Make:htlatex {packages = "\\RequirePackage[dvipdfmx]{graphicx}"}
local max_count = 5
local image_pattern
local function file_exists(fn)
local f = io.open(fn,"r")
if f == nil then return false else f:close() return true end
end
local function search_file(input, ext, count)
local pattern = count > 0 and "%s-%0"..count.."i." or "%s."
pattern = pattern .. ext
local filename = string.format(pattern, input, 1)
if file_exists(filename) then
return pattern
elseif count < 0 then return nil
else
return search_file(input, ext, count - 1)
end
end
local img_count = 0
local function locate_file(par,ext)
if image_pattern then
img_count = img_count + 1
return string.format(image_pattern, par.input, img_count)
else
image_pattern = search_file(par.input, ext, max_count)
if not image_pattern then
print("Cannot locate output svg pattern")
return nil
end
return locate_file(par, ext)
end
end
Make:htlatex{}
Make:htlatex{}
Make:htlatex{}
Make:tex4ht{}
Make:t4ht{}
Make:dvisvgm{}
Make:image("svg$",function(arg)
arg.input = arg.source:gsub(".idv$","")
local fn,msg = locate_file(arg, "svg")
if not fn then
print("Image processing error: "..msg)
else
arg.filename = fn
local cmd = "mv ${filename} ${output}" % arg
print(cmd)
os.execute(cmd)
end
end
)
------------------------------------
--Nasser
More information about the tex4ht
mailing list