[tex4ht] [bug #228] tex4ht does not accept \setcounter{tocdepth} in report class
Michal Hoftich
michal.h21 at gmail.com
Wed Aug 20 15:19:08 CEST 2014
Karl, thank you for explanation, it does make sense. This inspired me
to take a look at log files and I created simple lua script which
parses log file and prints generated .4ht files:
-----------------------------
-- process literate sources TeX file log for generated .4ht files
-- usage:
-- cat literatesourcetexfilename.log | texlua parse4htlog.lua
--
function file_exists(name)
local f=io.open(name,"r")
if f~=nil then io.close(f) return true else return false end
end
for line in io.lines() do
local k = line:match("==> <, ., ([^>]+)>")
if k then
local name = k .. ".4ht"
if file_exists(name) then
print(name)
end
end
end
--------------------------
for command
cat tex4ht-4ht.log | texlua parse4htlog.lua | wc -l
it prints 306 lines. Unfortunately, this script doesn't work on log
files of other files, but I suspect other sources doesn't produce so
big number of files, as all redefinitions of LaTeX packages and
inserting hooks takes place in `tex4ht-4ht.tex`, other files just seed
the hooks.
Best regards,
Michal
2014-08-15 22:58 GMT+02:00 Karl Berry <karl at freefriends.org>:
> Hi Michal,
>
> In the Makefile, wouldn't it be easier to use .dvi files as targets,
> instead of .4ht files? I don't have deep understanding of Make, so
> maybe it has some advantage.
>
> I made the .4ht files be the targets not for any technical reason, but
> for the sake of self-documentation for human consumption. That is, when
> I was first looking at the mass of several thousand tex4ht files, my
> basic question was which were the original source files and which were
> the derived (and where were they derived from). It was (and is) not at
> all obvious. So when I was constructing the Makefile, I did it one file
> at a time, trying to list the derived files for each.
>
> This is why, in our changes, I've tried hard to go through the pain of
> inserting "this file foo was created from this other bar on <date>"
> into the derived files, and also mark the original source files.
> I don't doubt I got some things wrong, and some are obviously
> incomplete (e.g., as you know, tex4ht-4ht.tex creates hundreds of
> derived files -- far from ideal if you ask me, but anyway).
>
> To me, the fact that running the "literate" .tex files through tex
> results in a DVI for "documentation" (often of minimal value, it seems
> to me) is much less important than the runtime files that get created.
> So it never occurred to me to make the dvi files be the primary targets.
>
> For true completeness, it is certainly true that dvi files should *also*
> be targets ...
>
> Hope this helps explain why I did what I did. If you see possible
> improvements to make, by all means let me know.
>
> Thanks for all your work.
>
> Karl
More information about the tex4ht
mailing list