Firstly, LyX and a full X server are now part of the standard Cygwin distribution. You might, however, be able to get a newer LyX version here or here.
MathML is the modern way to present Maths in a web browser. Instructions for installing a LaTeX to MathML converter are here. MathML is supported directly in Mozilla. For Internet Explorer, you need the plug-in from MathType. There is a document explaining how to set up MiKTeX to generate MathML.
You don't need to use GIFs any more. Decent support for the PNG alpha channel is in Mozilla and modern Netscape versions. There is a wonderful little trick to get it to work in Internet Explorer for Windows too. The implementation for latex2html is left to the reader...
There is a LaTex2HTML site and some instructions about using LaTeX2HTML with MiKTeX.
You probably want to present graphics as SVG. Again, Mozilla works "out of the box" and Internet Explorer needs the Adobe plugin.
To handle Windows-specific LaTeX, you probably need WMF2EPS to convert the .wmf graphics files to .eps.
Installing xfig on windows.
You can go the other way too: http://html2latex.sourceforge.net.
Yes, you can make it all work. It more or less works "out of the box". Perhaps the most important part is to make sure you are using the right version of Perl and Ghostscript for each job. I installed things in this order:
Ghostscript and GSview from
http://www.cs.wisc.edu/~ghost/.
I'm currently using GSview version 4.3 and Ghostscript 7.04. These fully
support TrueType as well as Postscript fonts, so you might want to invoke
Ghostscript with the -sFONTPATH=C:/WINDOWS/Fonts switch to pick up
all your normal Windows fonts in addition to the Ghostscript ones. Note also
that the Postscript name of the Windows font will have all the spaces
removed and, possibly, -Roman added to the end. So, for example, Humanist
521 BT becomes Humanist521BT-Roman. You can test this font with
something like
gswin32 -sFONTPATH=C:/WINDOWS/Fonts ../lib/prfont.ps
and then typing
/Humanist521BT-Roman DoFont
in the Ghostscript window. You don't have to mess with the Fontmap at all.
Of course, you don't get any intelligent TeX-friendly remapping of these
fonts.
MiKTeX from http://www.miktex.org It's not quite as slick as Cygwin.I loaded "Small MiKTeX". It also works "out of the box". The command latex should now work in a Windows cmd box.
Cygwin, from http://sources.redhat.com/cygwin/. Just click on "Install Cygwin now" and follow the instructions. According to the LyX team, you need to install at least: ash, bash, bzip2, cygwin, diff, fileutils, gettext, grep, gzip, perl, , sed, sh-utils, tar, textutils. As I understand it, the perl installed here gets used by the LyX LaTeX import feature, but not by latex2html.
I use the X server that is now part of the Cygwin distribution. You will certainly want to read the Cygwin/XFree86 User's Guide
You might want to use your existing TrueType fonts under X,
for example to display them in the LyX GUI. There are a few steps here. You
need to build ttmkfdir from
Jörg Pommnitz which in turn
needs FreeType1, an
older version than that included with Cygwin. There is a compiled binary
here for you to put on your PATH.
You run this inside your windows font directory:
cd /cygdrive/c/windows/fonts
You will now be able to see all the TrueType fonts in, say xfontsel. You can
also use them as the Screen Fonts in LyX; Just go to
Edit->Preferences->Screen Fonts and insert a new family, say "-*-comic sans
ms". For our local Visual Identity I use "-*-palatino linotype" (from
Windows XP) for Roman and "-*-humanst521 bt" (from Corel Draw) for Sans
Serif. We have site licenses for both.
ttmkfdir > fonts.scale
mkfontdir -e /usr/X11R6/lib/X11/fonts/encodings # These are standard
parts of Cygwin
xset +fp /cygdrive/c/windows/fonts # As is this
There are some extra notes on TrueType support, including enabling antialiasing, for Linux here.
If you also want to install extra Postscript Type 1 fonts, you can use the perl script type1inst, found in most Linux distributions, to build fonts.scale (and Ghostscript's Fontmap).
Remember to ensure that you export an
appropriate SHELL environment variable
export SHELL=/bin/bash # So the bash prompts look
ok in xterm
Configure bash to accept
8-bit characters by creating a file ~/.inputrc
set output-meta On
set convert-meta Off
If you want the € symbol to work properly in the UK, you need to:
Set some environment variables:
export LC_ALL=en_GB.ISO8859-15 # Should tell the C library we are in the UK and use the € symbol
export LC_CTYPE=en_GB.ISO8859-15 # But actually we have to do this too
# You might need to export LANG LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY
# LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
# and LC_IDENTIFICATION with the same value too.Change the fonts used by xterm to something like
-misc-fixed-medium-r-normal-*-*-120-*-*-c-*-iso8859-15
by, for example, starting it as
xterm -fn-misc-fixed-medium-r-normal-*-*-120-*-*-c-*-iso8859-15
An alternative way to get an extended character set is to use a UTF8 locale. You can export LC_ALL, LC_CTYPE and LANG as en_GB.UTF-8. This sets up use of multi-byte Unicode encodings for input and output. Unfortunately, the locale support in Cygwin is a bit thin. Large parts of the Cygwin system do not understand UTF-8 or require special flags to be passed. xterm, for example, needs to be started as xterm -u8. Shells such as bash miscount characters if you use UTF-8. As a simple example of what does work, try
export LC_CTYPE=en_GB.UTF-8
export LC_ALL=en_GB.UTF-8
export LANG=en_GB.UTF-8
xterm -u8and in the new xterm type
less UTF-8-demo.txt
The demo file can be found here.
Look in /usr/X11R6/lib/X11/app-defaults. If there is a
second app-defaults directory inside, copy everything up one level.
If you use the fvwm X window manager, you will need to
install the contents of fvwm_icons
by hand into /usr/include/X11/pixmaps.
If you are using a non-US keyboard, you'll need a to make a
keyboard configuration. I used xkb to set this up. My installation of Cygwin
had some rather odd soft links in this area, with a circular reference in /usr/X11R6/lib/X11/xkb/compiled.
I sorted it out as follows:
/usr/X11R6/lib/X11/xkb is a symbolic link to
/etc/X11/xkb
/etc/X11/xkb/compiled is a symbolic link to /var/lib/xkb
The README file that you might find in
/etc/X11/xkb goes in /var/lib/xkb
Now create a new file /etc/X11/xkb/symbols/gb_euro which differs from gb by
adding the definitions:
key <AE04> { [ 4 , dollar ],
[ EuroSign, EuroSign ] };
and modify /etc/X11/xkb/keymap/xfree86 to include a new definition for
gb_euro:
xkb_keymap "gb_euro" {
xkb_keycodes { include "xfree86" };
xkb_types { include "default" };
xkb_compatibility { include "default" };
xkb_symbols { include "en_US(pc105)+gb_euro" };
xkb_geometry { include "pc(pc102)" };
};
Then put the command:
xkbcomp -xkm -m gb_euro /usr/X11R6/lib/X11/xkb/keymap/xfree86
:0
in the .xinitrc file in your home
directory (after it starts the window manager).
Instructions can be found at http://gnuwin32.sourceforge.net/packages/netpbm.htm. I simply downloaded the files libjbig-1.2-bin.zip, libjpeg-6b-bin.zip, libpng-1.2.0-bin.zip, librle-3.1.b1-1-bin.zip, librle-3.1.b1-1-bin.zip, netpbm-9.20-bin.zip, netpbm-9.20-doc.zip, netpbm-9.20-lib.zip and zlib-1.1.3-bin.zip into %ProgramFiles%\netpbm\ and created a couple of start menu items. One launches a command shell with %ProgramFiles%\netpbm\ added to the path and the other starts up the HTML help. The two shortcuts are:
Command shell: Target: %SystemRoot%\system32\cmd.exe /K "PATH=%ProgramFiles%\netpbm\bin;%PATH%" Start in: "%HOMEDRIVE%%HOMEPATH%\My Documents\My Pictures" Help File: Target: "%ProgramFiles%\netpbm\man\html\index.html" Start in: "%ProgramFiles%\netpbm\man\html"
I have also modified the root man file so it picks up hyperlinks to the individual man pages. You can find a copy of mine here.
In order to make the NetPBM commands recognise colour names, you should copy this file to /usr/lib/X11/rgb.txt.
NetPBM installed in this way is good for batch image processing. Open the command window and construct a CMD-shell FOR command with pipes "|" and redirection ">" to do what you want. You can get help on FOR by typing FOR/?
Download it from http://www.activestate.com/Products/ActivePerl/. I used the MSI installation and it ran without problems.
Handle this step with care; there is lots to go wrong. There is some good background information here. First, get the distribution from http://saftsack.fs.uni-bayreuth.de/~latex2ht/current/. I got version latex2html-2K.1beta. Unpack it into an empty directory and modify two lines in the file prefs.pm:
$prefs{'EXTRAPATH'} = 'E:\\PROGRA~1\\gs\\gs6.50\\bin;E:\\PROGRA~1\\netpbm\\bin'; $prefs{'PREFIX'} = 'E:\\PROGRA~1\\latex2html';
The Perl scripts are unable to cope with spaces embedded in command paths, so it is important that the paths are "old DOS-style". It is also important that the netpbm and gs binaries not be on you path via a directory tree containing embedded spaces. The configure step will fail if these binaries are found via the wrong path. Now type
config
Hopefully the script will progress to the line
checking dvips version...
and hang. This is because the version of dvips that you are using prompts after printing version information. Type RETURN once. The script should then run to completion. You now need to modify l2hconf.pm:
$LATEX_COLOR = "\\pagecolor[white]{.7}"; @IMAGE_TYPES = qw(gif png); # GIF is now default
The second change makes gif the default format for images. This is unfortunately necessary because of the continuing poor support for png from major browsers. The first change causes the images to be antialiased against a white rather than grey background. You should now test your configuration with
testHopefully, all will be well and you will be able to view the output in your browser. Change the browser background colour and ensure that the background of the images of equations changes. If all is well, type
installGo inside the installed copy of latex2html and comment out line 212, the second line below:
# the next line fails utterly on non-UNIX systems #$LATEX2HTMLSTYLES =~ s/~([^$dd$dd$envkey]+)/L2hos->home($1)/geo;also insert the second line below; it makes the --help option work properly:
my $script = $SCRIPT || $0; $script =~ s/Program Files/PROGRA~1/;There is an odd little problem with dvips finding image files; unless you set the -nosubdir option, it runs in a subdirectory and can't find the .eps files. A crude patch can be made by inserting ".." in the dvips search path. Modify the file \texmf\miktex\config\miktex.inf:
GraphicsPath=.;..;%R\dvips//;%R\tex//Lastly, Click Start->Programs->MiKTeX 2.1->MiKTeX Options, click on the Roots tab and add E:\Program Files\latex2html\texinputs.
There is some of the usual filename confusion:
Windows uses filenames of the form D:\dir\dir\name.ext
MiKTeX expects filenames of the form D:/dir/dir/name.ext
Cygwin, and thus LyX, expects filenames of the form /cygdrive/D/dir/dir/name.ext. Even worse, lyx insists on prepending all paths without a leading "/" with the string ~/.
The upshot of this confusion is that relative file paths usually work fine. You cannot, however, use lyx to enter paths to, say, images that start with a / (because that will typically resolve to C:/cygwin) or include an explicit drive letter.
There is a simple and uniform solution to all these problems. Names of the form
//./d:/dir/dir/name.ext
work correctly everywhere except at the CMD command prompt. They even work there if the "/" are replaced by "\". This rather odd path syntax is a standard Windows feature. You should use it for all absolute paths in LyX, LaTeX and latex2html.
There are sometimes installation problems with paths containing embedded spaces. You can normally use PROGRA~1 whenever you might wish to use "Program Files".
dvips is claimed to respond badly to output paths containing embedded "."s (periods).
To get a simple flat rendering of a document into HTML, try
latex2html -split 0 -nonavigation -noinfo -noaddress FIMENAME.tex
dan@ecs.soton.ac.uk |