a guide to using tex4ht as a tool for publish-
ing latex-documents on the web simen kvaal
research report
www simula no
visiting address martin linges vei 17 fornebu
p o box 134
no-1325 lysaker norway
telephone 47 67 82 82 00
telefax 47 67 82 82 01
a guide to using tex4ht as a tool for publishing
latex-documents on the web simen kvaal
june 10 2003
contents
1 introduction 3
2 the basics of tex4ht 4
2 1 tex4ht in general 4
2 2 how to invoke tex4ht 4
2 3 hello world 5
2 4 parameters to the tex4ht package 6
3 the image-generating process 6
3 1 strategy for creating bitmaps 6
3 2 all the bad things tex4ht env 7
3 3 making amends with cscript sh 7
4 a recipe for tex4ht conversion of tex documents 8
4 1 step 0 prerequisites 8
4 2 step 1 creating the scripts 9
4 3 step 2 preparing your latex source 9
4 4 step 3 compiling and error checking 10
4 5 step 4 the web page 10
5 short version of the recipe 11
6 linking slides from prosper to tex4ht 12
6 1 the hyperref package 12
6 2 the missing links inside tex4ht 13
6 3 an example 14
7 making a simula report from your latex document 14
1
8 listings 15
8 1 cscript sh 15
8 2 customlinks tex 17
8 3 tex4ht env 17
2
1 introduction
latex is a very powerful and flexible typesetting package which in addition to
being freely available also is widely supported although the print quality of
the output may be outstanding and despite the fact that high quality pdf ver-
sions of your document may be published latex unfortunately lacks any direct
support for creating documents readily published on the web compatible with
any graphical web-browser and we cannot really blame the authors of tex
and latex it would be like blaming green-grocer for not selling automobiles in this document we will go through the usage of tex4ht to publish large
documents on the web tex4ht is a flexible extension to latex making the web
publishing of complex latex documents relatively easy it is a combination of
a standard latex package and accompanying post-processing utilities we will develop a recipe” for post-processing latex documents with nav-
igation through sections consistent layout and robust graphics conversion on
our way there are some obstacles but once overwon html versions of your
documents are readily created the reader is not assumed to go into detail in all the covered problems and
topics but is encouraged to spend some amount of time reading the different
sections for creating html versions of latex documents however only knowl-
edge of the step-by-step recipe is needed the really enthusiastic and impatient
reader may skip directly to section five we will also discuss some aspects of the powerful prosper latex package for
creating delicate slides for presentations more specifically we want to be able
to intertwine the web pages created with tex4ht with the presentations making
it possible to refer to written material in an elegant manner on-screen immediately after this introduction we proceed with the basics of tex4ht in
section 2 the whole of section 3 1 is devoted to the process of converting special
content to graphical material in the web pages since this is the main chore with
tex4ht in section 4 we state the long version of the recipe” for creating good-
looking html documents from latex documents section 5 is the short version
for the impatient reader with short and concise instructions as mentioned
above the reader may skip directly to this understanding the other material
is not absolutely necessary the section describes among other things how to
obtain a package with all needed files for performing the wizardry section 6 deals with the aforementioned linking of prosper documents to
documents published with tex4ht we also include section 7 describing how to add the official simula cover to
your latex document it is included because one often needs to publish the
report on the web at the same time as one creates the official report it is
therefore convenient to have the recipes for both processes at the same place in the 8th and last section i have included listings of important files although
one can download them from 6 see also the short version of the recipe in
section 5 we will assume of course that tex4ht and prosper are installed
alongside latex on your system 3
2 the basics of tex4ht
2 1 tex4ht in general we will here talk about tex4ht in general terms for reference i strongly
recommend reading the latex web companion” 1 as the documentation
in this book is very informative it is a very handy book on other matters as
well see also the official web site 2 for tex4ht however we will touch the
important basics here and everything needed to get a working knowledge of the
system will be covered there are several other alternatives besides tex4ht for creating html out
of latex but tex4ht is definitely the most elaborate and gives the best results
after some work the main drawback is this amount of work on the other hand the benefits are much more important because tex4ht works on a low level tex and latex works on top of this complex structures are easily handled
and may be tailored to get the results one want to compare latex2html is
merely a perl script parsing latex code and staggers when the author does tricks ” as is the case in all projects bigger than your average hello world ”-
project 1
how does tex4ht work it is basically a combination of a latex package
and a set of post-processing utilities the latex package modifies the dvi out-
put2 from the compilation process adding information for the post-processing
utilities to digest these utilities generate the html code and the pictorial rep-
resentation of content such as included figures and mathematical formulae we
will have more to say on this later 2 2 how to invoke tex4ht
to invoke tex4ht inside the latex document one simply issues a usepackage- tex4ht command in the preamble immediately after the documentclass
statement there are several optional arguments but we won’t worry about
them now this makes the dvi-output all messed up probably making it
incompatible with your favorite dvi-driver eg dvips this is because the dvi-
file now is tailored to create html files making the dvi device dependent this
is done with the external post-processing commands tex4ht and t4ht the tex4ht command takes the dvi and some other input files created by the
tex4ht package and creates html-files and an idv-file try looking at this with
e g xdvi and you’ll discover that it really is a dvi each page holds one item of
some kind these are items that tex4ht cannot convert into html directly so the program t4ht is used to create bitmap versions of each item this process
relies on external utilities as explained below thus t4ht might seem rather
1indeed if you go through the simple hello world” tex4ht example outlined below and
study the html code you can see how latex commands such as latex are constructed
internally because tex4ht works on such a low level 2dvi means device independent ” latex generates a dvi file that can be converted to other
device dependent media such as pdf postscript and you guessed it html 4
fragile but on the other hand it is highly customizable take a look at figure 1
as this illustrates the concept -
-
document tex document dvi html
document idv css
tex4ht
t4ht
document lg
latex gif png css
figure 1 flow of files and information when using tex4ht
note if you want to create an ordinary non-html dvi after you have used
tex4ht that is if you remove the proper usepackage command you
must delete the aux-file created when you were using tex4ht the actual commands to use when creating your html version is latex document
latex document
latex document
tex4ht document
t4ht document
note the several invocations of latex this is because tex4ht needs to get
html tables cross references and so on correct sometimes even more runs of
latex are needed the above process can be run with the single command ht
latex document and is usually all right for a start if your document is very
complex and your html-document turns out to lack some references for instance then maybe you need one or two more latex runs before post-processing with
tex4ht and if you are using for example bibtex you almost certainly need
to make your own sequence of commands 2 3 hello world let us see a small example using tex4ht this shows the default behaviour
of the system and is not particulary convincing let this be the input latex
document hello tex documentclass article 5 usepackage tex4ht begin document section hello world this is a simple latex document section ars magna this is easy a^2 b^2 = c^2 but what about alpha^3 beta^3 = gamma^3 end document run ht latex hello and watch note how slow the process of generating
bitmaps from the mathematical formulae is and how bad the maths look when
hello html is viewed with for example mozilla the actual code is rather
complicated so we won’t display it here apart from this the document is
quite nice but with some simple adjustments to the configuration we will be
able to produce both quicker and better results this is the topic of section 3 1 2 4 parameters to the tex4ht package
when our recipe for creating web documents is finished we won’t need to worry
about the parameters for the tex4ht package let us mention some of the pa-
rameters anyway for completeness if parameters are supplied at all the first one must either be the name of a
configuration file see 1 or html we will always use the latter a common
mistake is to forget that the first paramteter to tex4ht is special 3
other parameters include png or something similar to indicate the planned” extension of images in
the html document this is a rather confusing matter since this only
applies to some of the images generated we will always use png here all our images will be of this type when we follow the recipe to be created 1 through 4 to invoke certain pre-defined setups concerning spreading the
html document over several files higher numbers produce a deeper nest-
ing of documents 1 divides at part 2 at chapter et c in addition tex4ht supplies navigation buttons on each page the layout of these can
be customized see 1 3 the image-generating process
3 1 strategy for creating bitmaps
as explained in section 2 tex4ht needs external utilities for creating the
bitmaps used in the web-documents the default set up is a combination of
3 common mistake” of course means that i’ve been confused about it a lot 6
dvips gs ghostscript and imagemagick’s convert utility 4 unfortunately this
is a rather slow process and not a very good one when it comes to antialiasing and it’s definetely not suited for typesetting uses however the dvi2bitmap tool
available freely from 3 is efficient and converts dvi files directly to png or gif
files dvi2bitmap works almost like a normal dvi-driver but has no support for
so-called dvi-specials such as included eps-figures et c thus a combination
of the two is required we use dvi2bitmap whenever we encounter maths and
special symbols as this is efficient and produce good results but use the afore-
mentioned dvips gs convert-process for items that dvi2bitmap cannot handle such as included postscript figures note in the trouble-shooting section on the official web page for tex4ht 2 it
is mentioned that you can directly configure tex4ht inside your document
to process e g includegraphics in a special way i have not been able
to use the method successfully myself though you might give it a try if
you are not satisfied with the results 3 2 all the bad things tex4ht env
the converting process is initiated in the tex4ht configuration file tex4ht env from the man pages of tex4ht one can locate this it is useful to have a copy
in your working directory and edit it when needed tex4ht will use whatever
configuration file it finds first and the current working directory is the first place
it looks you may also get the configuration file in the package from section 5 the converting process is the lines in tex4ht env starting with g i have
simply replaced those lines with a call to a small script thus the converting-
process in my tex4ht env file looks like g cscript sh 1 2 3 2
the configuration file format is ugly and crammy and it takes some effort to
get into it and to make things worse blank lines are actually harmful as the
documentations so nicely puts it for the image-generating process however all that is needed is to replace the few lines that begin with a g 3 3 making amends with cscript sh
the bash script cscript sh c” for conversion obviously takes four parame-
ters we pass the parameters 1 3 on the command line in tex4ht env the
three parameters are the name of the dvi file the page number and the name
of the desired output file respectively this is a good thing with tex4ht env an external utility may get all the information it needs from it as the fourth
parameter the script takes an integer between 0 and 3 indicating the desired
output quality of the bitmaps 0 is quick-and-very-dirty 1 has no antialiasing
while 2 and 3 employ antialiasing with 3 the best and by all means the slowest 4
4it is not a true antialiasing-method we simply create a huge bitmap and scale it down this is not suitable for text we really need a method that employs an adaptive sampling
method quality setting 0 is the reverse blowing up a way too small bitmap 7
the quality settings only apply to the dvips-gs-convert-process as dvi2bitmap’s
quality is always quite good for example the following call to cscript sh
reads page 42 of mydvi dvi and creates the bitmap outfilename png with the
lowest quality cscript sh mydvi 42 outfilename png 0
several minor problems were encountered while investigating the conversion
process and all of them are fixed in the script for example the default for
dvi2bitmap is to employ an alpha-channel for semi-transparent pixels when
outputting png files this is not compatible with microsoft’s internet explorer
browser and many imaging applications the fix is to employ a white back-
ground instead but this means that when choosing background colors in the
html document one needs to adjust cscript sh directly tex4ht is defining a lot of strings and macros and really puts a strain on
tex’ capacity if this is the case be a wizard and increase it in your texmf cnf
file the program dvi2bitmap relies on the kpathsea library for finding fonts but
not all tex distributions install this if this is the case then dvi2bitmap must
use other means for locating the font files this may turn out to be complicated luckily the newest version as of time of writing can also employ the standalone
version kpsewhich and this works fine note however that the presence of either
the library or the standalone is needed for the current script to work 4 a recipe for tex4ht conversion of tex docu-
ments
now we have come to the point of stating a working recipe for creating html ver-
sions of latex documents with tex4ht we will first summarize the needed
programs and files and then state a development procedure the recipe should
be more than adequate for most projects but when converting huge projects
such as books with hundreds of pages one might encounter bugs in tex4ht if
this is the case report the bug to the author of tex4ht and or work around
the problem 5
4 1 step 0 prerequisites
besides latex with tex4ht installed you will also need dvi2bitmap available for free from 3 ghostscript which usually is installed alongside latex imagemagick’s convert utility available from 4 5this guide is based on the work done converting a huge book written by several authors
over a long time this implied strange latex vs tex4ht problems but only minor thus serious problems should be rare 8 a good web browser like mozilla is really useful the latest bug-fixes for tex4ht available from 2 locate the tex4ht env configuration file and store it in a convenient place
for editing as explained below you can also use the one supplied in the file
package mentioned in section 5 also locate your default texmf cnf file and copy it into a convenient place e g your working directory during large projects tex will almost certainly
run out of capacity when this happens locate the appropriate variable in the
configuration file and modify it 4 2 step 1 creating the scripts
fetch the tex4ht configuration file tex4ht env edit the lines starting with a
g they should look like this g cscript sh 1 2 3 2
you will need the aforementioned cscript h of course either get it from 6 or copy the listing at the end of this guide note that you may need to
change the location of the bash binary at the beginning 4 3 step 2 preparing your latex source
most of the time tex4ht will accept every bit of latex code you have written this is because tex4ht works on a level just between tex and latex so that
every macro gets special treatment there is one difference however and it is an important one always place
your macro definitions after the begin document -command this has subtle
reasons and i recommend that you look it up in 1 if you are curious it might happen that one or two of your macros won’t compile in that case it is a bug in tex4ht either find a workaround or report the bug if it is serious although it is unlikely 6
you might also get strange errors seemingly not related to a macro but
it probably is let’s say you have encountered an error at line 2651 in your
document it still might be your macro that isn’t working correctly just pay
attention to exactly where in the line the error occurs now i have said a lot about errors and you might get the impression that
errors is something you’ll have to deal with a lot this is not so but it is good
to be prepared and not to have to spend hours at errors with an easy solution now for the preamble you’ll need to invoke the tex4ht package use this
snippet usepackage html png tex4ht 6in my work with very complex documents i’ve encountered four small bugs which required
only tiny modifications of the macro code not the actual document code 9
if you want to split your document into several html files add an inte-
gral parameter after png and a comma see the above part on parameters to
tex4ht for a big book project 3 is typically a good value this is probably everything that is needed one line of code in addition to
moving your macros to after begin document you may also want to set an option that forces every tiny inline equation
to become a bitmap by default tex4ht creates html code for as many inline
equations as possible with varying degree of success this option is described
in 2 in detail configure $ picmath endpicmath place the option after begin document similar settings exist also for other
math environments 4 4 step 3 compiling and error checking
you are now ready to compile you can for example run the command
ht latex basefilename
as described previously you may also compose your own arrangement of latex tex4ht and t4ht commands if the previous doesn’t fix all the tables et c this
is typical in a big project note that in csript sh you specify the bitmap quality due to the long
conversion times for included postscript figures i reccomend that you start
with a quality setting of 0 until you are happy with the look of the rest of the
html document the quality setting will not affect the rest of the html gen-
erating process you can of course preview your html pages in a web browser the base file
has the same name as your document 4 5 step 4 the web page
after you are satisfied with the results copy all the html and png files to your
published web area note when the surfer enters your directory and if you do not have an index -
html he she will see all the files in the directory if you don’t want that create an index html to prevent this note also note that all the files created resides in your working directory and
should be placed in the same published directory you can specify options
to place the html-files in a special place but you must modify csript sh
yourself to place the images there as well 10
5 short version of the recipe
in this section we present a condensed version of the previous recipe without all
the gory details assuming that latex tex4ht imagemagick and ghostscript
are installed you may download a file package from 6 containing the other
essentials these include a precompiled binary for dvi2bitmap the cscript sh script a version of tex4ht env adapted to use cscript sh the customlinks tex macros for customized html links if you have skipped directly to this section without reading about the back-
ground for these components you will not necessarily understand what they do
or what they are needed for consult the other sections if you are bewildered now for the recipe for converting your latex document into html 1 download the file package tex4ht-files tar gz and decompress it into
your working directory that is the directory from where you run the
latex-commands 2 modify your source code add usepackage html png tex4ht to your preamble that is be-
fore the begin document command move all macro definitions for example newcommand and new-
environment definitions to after the begin document command 3 compile your document you may run ht latex document where document is the file name
of your latex document without extension you may also run your own set of commands if the above does not
seem to cope with all your tables or similar latex document
latex document
latex document
tex4ht document
t4ht document
this is the sequence actually run with ht latex document run
additional latex commands bibtex commands or whatever before
the tex4ht and t4ht commands 4 if compilation succeeded your html version is stored in document html
and the graphic content is stored in document png additional cascading
style sheet-specifications recides in document css all these files must
be published in the same directory on the web for the document to be
displayed correctly 11
6 linking slides from prosper to tex4ht
this section deals with the issue of creating hypertext links when using the
package prosper 5 and more specifically hypertext links to html documents
created with tex4ht this is not meant as a guide to prosper as the docu-
mentation that comes with the package is a good guide in itself and since it
is not very difficult to learn anyway but we mention that prosper allows you as a latex user to create high-quality presentation slides merely with simple
latex code the pdf file that results from this process is comparable to those
created with microsoft’s powerpoint the most important advantages of using
prosper is that it is free and that it supports all typical latex structures such
as mathematics we all know that powerpoint is bad at this why bother with these hyperlinks imagine yourself at a conference meeting or whatever displaying your slides
for the audience maybe you are presenting your latest findings in time-travel
technology or mind transfer serums then at some point you refer to some of
your articles showing detailed calculations or witty quotes with the hyperlinks
inside your slides you may click on this anchor and behold the web browser
pops up displaying the exact contents of your article neat moreover with the knowledge of how to put hyperlinks into prosper you
may also link to regular web pages with relevant content this might also be
valuable but then you don’t need most of the material in this section 6 1 the hyperref package
the hyperref package provides a flexible interface to hypertext links it is in-
cluded when you include prosper this means that most of the options offered
by hyperref is set behind the curtains ” but for most uses this should not be a
hindrance a thorough description of hyperref is found in 1 and we will only
deal with the basics here a plain vanilla hypertext link is inserted with the href command href url text here url is the fully expanded url to the desired page and text is the anchor
shown visually note that characters such as and should not be escaped note also that the link must be fully expanded if not the link wil typically
get a file in front this unfortunately makes the document less portable to
overcome this problem a bit a command hyperbaseurl is provided 7 set this
to e g http www something com user and you can omit the full expansion
of the hyperlinks you may still expand external links of course because of the colorizing parameters being obscured by the early inclusion
of hyperref one has to use other means for creating colored links one way is
7due to a minor bug inserting a tilde in the adress results in an error try to work
around this in some way e g by using string to insert a tilde 12 newcommand myhref 2 href 1 begin blue underline 2 end blue whose usage is the same as the original href command 6 2 the missing links inside tex4ht
now we turn to the creation of human readable anchors inside the html files
generated with tex4ht we wish to be able to direct our hypertext links inside
the prosper presentation to a given chapter section or page in html this is
done with a name=’whatnot’ tags anchor tags tex4ht creates such tags by
default for internal cross linking between equation references figure references
and so on unfortunately the format of these are not known a priori and we
must supply reliable tags ourselves this might seem clumsy at first why not use the tags already present the
simple implementation we choose and the usage proves the method to be fine though analyzing tex4ht’s behaviour may be a tedious task and that’s why
we decide on the presented technique the main ingredients of the implementation is to exploit tex4ht’s hooks ”
when the author issues e g a sectioning command configurable hooks generate
html material in the tex4ht post-processing stage this allows us to create
anchors with literal description of the section the needed configurations and
macros are collected in customlinks tex whose usage is described next to invoke the custom hooks simply input the macro file immediately after
the begin document command on every chapter section and subsection a
html anchor is created one can also issue custom-made anchors with the
commands customlink and pagelink pagelink creates an anchor to the current page on the form pnnn where
nnn is the page this feature seems rather silly but it might prove useful customlink name creates an anchor named name at the current position
in the web document note when using these commands do not insert empty lines on both sides of
them if you do it will result in an empty but visible paragraph in the
document the ancors still work of course whether you remember this
or not whenever a custom hook is encountered the macros issue a message to the
log to extract the interesting messages issue the command
cat doc log grep customlink links txt
to generate a file containing a description of the links typically a line reads --- customlinks says link to section 2 1 doc html sec2-1
13
so when one needs to link to section 2 1 use this link the customlinks tex contains only basic latex programming so extending
it to ones own need should be no difficult task as for now starred sections are
not implemented for example the file customlinks tex is available alongside this document from 6 in
addition it is included in the file package described in section 5 6 3 an example
on the web page 6 you may view an example showing how to link prosper
documents to html documents and html documents created with tex4ht in
particular the example consists of several files dracula tex this is the document that is being converted with tex4ht dracula html this is the document after conversion with tex4ht customlinks tex the previously mentioned file that defines tex4ht
hooks for customized anchors inside the latex document slides tex prosper slides utilizing the anchors genereated during com-
pilation of dracula tex slides pdf the compiled prosper presentation clickable and all take a look at the source codes hopefully this will in conjunction with the
above paragraphs be informative 7 making a simula report from your latex doc-
ument
in this section we state the procedure for adding the official simula report cover
to your latex document we include this description inside this document because usually when creating simula reports one also publish it on the web in
html format thus having the recipes all in one place might be a good idea adding the simula cover is really simple but remember that some latex
packages that you use might turn out to be incompatible with the simula cover
style we will return to this issue later for more information on the usage and bug reporting see the simula intranet 7 to add a simula-cover three simple steps are needed 1 include the simulacover package just after the documentclass declara-
tion usepackage simulacover 14
2 if you need or want another way to display author names etc on the
cover add one or more of the following commands simdoctitle alternate title simdocauthor alternate author description simdoctype for example ‘‘memo’’ simdoctext this goes on the front cover as well simdocnumber report number 3 add the command makesimulacover
just before the maketitle command this will create the cover with the
author names the title of the document and so on the simulacover package is installed on simula and is available on all local
machines if you want to compile your document on a laptop or another machine
running latex get a copy of the latest8 version of the package and put it into
the same directory as your document latex will then find the package and
include it properly there is no need for actually installing it to your latex
system if it turns out that for some reason your document does not compile correctly
or does not compile at all the problem is probably that inclusion of some package
interfers with simulacover currently the fancybox package is known to exhibit
this behaviour a simple solution to this problem is to create a new document containing
only the simula cover and no text create a postscript version of this and add
the two first pages to the postscript version of your original document alternatively work around the incompatibilities in some other way using
different packages or similar 8 listings
here are the listings for various files mentioned they can also be downloaded
from 6 8 1 cscript sh bin bash
echo ’cscriph sh convert dvi to bitmap ’
8note the version on the simula intranet web site is at the time of writing outdated we
suggest that one locates the package on one of simula’s linux stations and copies this to ones
own computer 15 verison 1 5 exit statii and their meanings 0 success 1 bad command line proper invocation cscript sh thedvifile thepage theoutputfile quality quality is a parameter describing the quality of the converting process when using the horribly slow plan-b-method 0-dirty 1-low 2-medium 3-high check if command line arguments exists
if $1 $2 $3 $4 then
echo cscript sh error bad command line echo proper invocation cscript sh thedvifile thepagenumber theoutputfile quality exit 1
fi check quality settings quality=$4
if $quality lt 0 then
quality=0
fi
if $quality gt 3 then
quality=3
fi
echo cscript sh quality set to $quality try to convert with dvi2bitmap rm f $3
success=0
if dvi2bitmap font-mode=ibmvga page-range=$2 magnification=4 s 4 output-type=png resolution=110 process=transparent=false output=$3 $1
then success=1
fi dvi2bitmap fp var spool texmf pk ibmvga public cm var spool texmf pk ibmvga public latex var spool texmf pk ibmvga ams cmextra fm ibmvga pt pp $2 m 4 s 4 t png r 110 o $3 $1 check if the outputfile was generated if not create image with dvips gs convert if e $3 if success = 1 then
echo cscript sh dvi2bitmap made it enhance the bitmap convert unsharp 1 0x0 5 $3 fisk_og_slips gif convert fisk_og_slips gif $3
else
echo cscript sh dvi2bitmap failed running the dvips gs convert-process dvips pcmz pamz mode ibmvga d 220 f $1 pp $2 temporary ps
if $quality = 0 then
res_str=’-r25x25’
scale_str=’440 ’
fi
if $quality = 1 then
res_str=’-r110x110’
scale_str=’100 ’
fi
if $quality = 2 then
res_str=’-r160x160’
scale_str=’68 75 ’
fi
if $quality = 3 then
res_str=’-r220x220’
scale_str=’50 ’
fi
16
gs sdevice=ppm soutputfile=temporary ppm $res_str q dbatch dnopause temporary ps c quit
convert crop 0x0 density 110x110 antialias scale $scale_str transparent ’ ffffff’ temporary ppm $3
rm temporary ps
rm temporary ppm
fi
echo cscript sh finished 8 2 customlinks tex these are commands that configure tex4ht to produce internal human readable links into the html code newcommand logcomment customlinks says newcommand chapterlink hcode a name=’ch arabic chapter ’ a newcommand sectionlink hcode a name=’sec arabic chapter - arabic section ’ a newcommand subsectionlink hcode a name=’subsec arabic chapter - arabic section - arabic subsection ’ a newcommand subsubsectionlink hcode a name=’subsubsec arabic chapter - arabic section - arabic subsection - arabic subsubsection ’ a newcommand reportchapterlink typeout logcomment link to
chapter thechapter filename ch arabic chapter newcommand reportsectionlink typeout logcomment link to
section thesection filename sec arabic chapter - arabic section newcommand reportsubsectionlink typeout logcomment link to
subsection thesubsection filename subsec arabic chapter - arabic section - arabic subsection newcommand reportsubsubsectionlink typeout logcomment link to
subsubsection thesubsubsection filename subsubsec arabic chapter - arabic section - arabic subsection - arabic subsubsection newcommand reportcustomlink 1 typeout logcomment custom link named ’ 1’ filename 1 newcommand customlink 1 hcode a name=’ 1’ a reportcustomlink 1 newcommand thispage arabic page newcommand reportpagelink typeout logcomment page-link at page thispage filename p thispage newcommand pagelink hcode a name=’p thispage’ a reportpagelink configure chapter chapterlink reportchapterlink configure section sectionlink reportsectionlink configure subsection subsectionlink reportsubsectionlink configure subsubsection subsubsectionlink reportsubsubsectionlink end of internal link code to generate a report of links generated cat bok log grep customlinks links txt note that when inserting ‘‘custom links ’’ don’t insert blank lines after the customlink-command this will generate an extra empty but visible paragraph 8 3 tex4ht env tex4ht env tex4ht notes 1 empty lines are harmful 2 place this file in your work directory and or root directory and or in directory ‘xxx’ of your choice in the latest case compile tex4ht c with ‘ define htfdir xxx’ 17 or provide the address of the file to tex4ht throught the e switch replace ‘path’ and ‘tfmpath ’ a requests recursive search into subdirectories multiple entries of each type are allowed ttfmpath tex texmf fonts tfm ipath tex4ht dir ht-fonts iso8859 ipath tex4ht dir ht-fonts alias replace ‘path’ bookkeeping for searched files lpath tex4ht dir tex4ht fls default scripts s--- needs 1 idv 2 == 3 b--- characters g png remove protection
s invoke cscript sh a script to convert from dvi to bitmap g cscript sh 1 2 3 2 t4ht d 2
mmv 1 2
ccp 1 2 t4ht d 2 m 1
achmod 1 2 3 empty gifs
ecp empty pic 1 2 validations xstl tranformations xmake f nsgmls name= 1 ext= 2 end of file
18
references 1 goossens m rahtz s et al the latex web companion addison-wesley
1999 2 official web site for tex4ht http www cis ohio-state edu gurari tex4ht and
http www cis ohio-state edu gurari tex4ht mn2 html 3 official web site for dvi2bitmap http www astro gla ac uk users norman star dvi2bitmap 4 official web site for imagemagick http www imagemagick org 5 official web site for prosper http prosper sourceforge net 6 the author of this document’s personal web site http www simula no simek link to file package in section 5 http www simula no simek tex4ht-files tgz 7 simula cover latex style at the simula research lab intranet https www simula no intranet support unix software pages latex shtml
19