Hi, Geoffrey. I'm unsure how to go about getting some fixes to http://ctan.tug.org/tex-archive/dviware/dtl/ into CTAN. As you're the author and as you have a pointer to LyX on your TeX page, perhaps you're interested?
The attached patch does a number of things: * it enables the Makefile to work out of the box on both *nix and on Windows under either the MSys or Cygwin environments. * it fixes the man2ps Makefile target * it fixes man2ps itself to not use hard-coded paths to groff or dpost * it enables dt2dv.c to handle .dvi files containing strings longer than 1024 chars. Such files are commonly generated by the PSTricks package. In addition, note that you have some spurious whitespace at the end of lines in the .doc files ;-) We've been using the dtl package in the Windows build of LyX for a year or so now without any problems. It enables us to manipulate the file name strings output by graphix.sty so that file names containing spaces can be understood by Yap. See http://www.lyx.org/trac/browser/lyx-devel/trunk/lib/scripts/clean_dvi.py Sure this is a kludge around a broken graphix.sty, but the whole "file name with spaces" thing is a mess in TeX ATM and dtl has enabled us to create an engineering solution to the problem. It's been just great! ;-) Kind regards, Angus
diff -r -u dtl_orig/dt2dv.c dtl/dt2dv.c --- dtl_orig/dt2dv.c 1995-03-08 01:00:00.000000000 +0000 +++ dtl/dt2dv.c 2006-03-02 19:05:02.000000000 +0000 @@ -1,9 +1,11 @@ /* dt2dv - convert human-readable "DTL" file to DVI format - this is intended to invert dv2dt version 0.6.0 - - version 0.6.1 - 14:38 GMT +11 Thu 9 March 1995 + - version 0.6.2 - 27 July 2005 - Geoffrey Tobin [EMAIL PROTECTED] - fixes: Michal Tomczak-Jaegermann [EMAIL PROTECTED] Nelson H. F. Beebe [EMAIL PROTECTED] + Angus Leeming [EMAIL PROTECTED]: Enable dt2dv to handle + .dvi files containing strings longer than 1024 chars. - Reference: "The DVI Driver Standard, Level 0", by The TUG DVI Driver Standards Committee. Appendix A, "Device-Independent File Format". @@ -2223,7 +2225,7 @@ /* transfer (length and) quoted string from dtl to dvi file, */ /* return number of bytes written to dvi file. */ { - U4 k, k2; + U4 k, k2, lstr_maxsize; Lstring lstr; if (debug) @@ -2232,12 +2234,13 @@ fprintf (stderr, "(xfer_len_string) : entering xfer_len_string.\n"); } - init_Lstring (&lstr, LSIZE); - /* k[n] : length of special string */ k = get_unsigned (dtl); + lstr_maxsize = (k > LSIZE) ? k : LSIZE; + init_Lstring (&lstr, lstr_maxsize); + if (debug) { PRINT_PROGNAME; @@ -2567,7 +2570,7 @@ #ifdef HEX_CHECKSUM /* c[4] : (hexadecimal) checksum : I (gt) would prefer this */ xfer_hex (4, dtl, dvi); -#else /NOT HEX_CHECKSUM */ +#else /*NOT HEX_CHECKSUM */ /* c[4] : checksum (octal, for comparison with tftopl's .pl file) */ xfer_oct (4, dtl, dvi); #endif diff -r -u dtl_orig/Makefile dtl/Makefile --- dtl_orig/Makefile 1995-03-08 01:00:00.000000000 +0000 +++ dtl/Makefile 2006-07-07 14:56:12.000000000 +0100 @@ -3,6 +3,14 @@ # Thu 9 March 1995 # Geoffrey Tobin # Nelson H. F. Beebe +# +# Changes 27 July 2005 by Angus Leeming to enable the Makefile to +# work out of the box on both *nix and Windows machines under +# the MinSYS environment. +# +# The Makefile can also be used unaltered to build a Windows executable +# from a Linux box if make is invoked as: +# $ make EXEEXT='.exe' CC='i386-mingw32-gcc' #======================================================================= BINDIR = /usr/local/bin @@ -16,10 +24,22 @@ CP = /bin/cp DITROFF = ditroff DITROFF = groff -EXES = dt2dv dv2dt + +# This is a GNU make extension. +# If you're flavour of make refuses to accept it, +# then simply hardcode EXEEXT. +ifeq ($(WINDIR),) + EXEEXT = +else + EXEEXT = .exe +endif + +DT2DV = dt2dv$(EXEEXT) +DV2DT = dv2dt$(EXEEXT) +EXES = $(DT2DV) $(DV2DT) LDFLAGS = -s LDFLAGS = -MAN2PS = ./man2ps +MAN2PS = sh ./man2ps MANDIR = /usr/local/man/man$(MANEXT) MANEXT = 1 OBJS = dt2dv.o dv2dt.o @@ -40,7 +60,7 @@ $(DITROFF) -man -Tascii $< | $(COL) >$@ .man.ps: - $(MAN2PS) < $< > $@ + $(MAN2PS) $< > $@ #======================================================================= @@ -48,19 +68,19 @@ doc: dt2dv.hlp dv2dt.hlp dt2dv.ps dv2dt.ps -dtl: $(EXES) +dtl: dv2dt dt2dv check tests: hello example tripvdu edited dv2dt: dv2dt.o dtl.h - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ [EMAIL PROTECTED] + $(CC) $(CFLAGS) $(LDFLAGS) -o $(DV2DT) dv2dt.o dt2dv: dt2dv.o dtl.h - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ [EMAIL PROTECTED] + $(CC) $(CFLAGS) $(LDFLAGS) -o $(DT2DV) dt2dv.o -hello: hello.dtl $(EXES) - dt2dv hello.dtl hello2.dvi - dv2dt hello2.dvi hello2.dtl +hello: hello.dtl dv2dt dt2dv + ./$(DT2DV) hello.dtl hello2.dvi + ./$(DV2DT) hello2.dvi hello2.dtl [EMAIL PROTECTED] hello.dtl hello2.dtl > hello.dif @if [ -s hello.dif ] ; \ then echo ERROR: differences in hello.dif ; \ @@ -69,11 +89,11 @@ hello.dtl: hello.tex tex hello - dv2dt hello.dvi hello.dtl + ./$(DV2DT) hello.dvi hello.dtl -example: example.dtl $(EXES) - dt2dv example.dtl example2.dvi - dv2dt example2.dvi example2.dtl +example: example.dtl dv2dt dt2dv + ./$(DT2DV) example.dtl example2.dvi + ./$(DV2DT) example2.dvi example2.dtl [EMAIL PROTECTED] example.dtl example2.dtl > example.dif @if [ -s example.dif ] ; \ then echo ERROR: differences in example.dif ; \ @@ -82,11 +102,11 @@ example.dtl: example.tex tex example - dv2dt example.dvi example.dtl + ./$(DV2DT) example.dvi example.dtl -tripvdu: tripvdu.dtl $(EXES) - dt2dv tripvdu.dtl tripvdu2.dvi - dv2dt tripvdu2.dvi tripvdu2.dtl +tripvdu: tripvdu.dtl dv2dt dt2dv + ./$(DT2DV) tripvdu.dtl tripvdu2.dvi + ./$(DV2DT) tripvdu2.dvi tripvdu2.dtl [EMAIL PROTECTED] tripvdu.dtl tripvdu2.dtl > tripvdu.dif @if [ -s tripvdu.dif ] ; \ then echo ERROR: differences in tripvdu.dif ; \ @@ -95,15 +115,15 @@ tripvdu.dtl: tripvdu.tex tex tripvdu - dv2dt tripvdu.dvi tripvdu.dtl + ./$(DV2DT) tripvdu.dvi tripvdu.dtl # edited.txt is already a dtl file. -edited: edited.txt $(EXES) - dt2dv edited.txt edited.dvi - dv2dt edited.dvi edited2.dtl - dt2dv edited2.dtl edited2.dvi - dv2dt edited2.dvi edited3.dtl +edited: edited.txt dv2dt dt2dv + ./$(DT2DV) edited.txt edited.dvi + ./$(DV2DT) edited.dvi edited2.dtl + ./$(DT2DV) edited2.dtl edited2.dvi + ./$(DV2DT) edited2.dvi edited3.dtl @if [ -s edited.dif ] ; \ then echo ERROR : differences in edited.dif ; \ else $(RM) edited.dif ; \ diff -r -u dtl_orig/man2ps dtl/man2ps --- dtl_orig/man2ps 1993-05-10 02:00:00.000000000 +0100 +++ dtl/man2ps 2006-07-07 15:03:12.000000000 +0100 @@ -20,16 +20,16 @@ esac # We can use either GNU groff or Sun Solaris troff + dpost -if [ -x /usr/local/bin/groff ] +if [ which groff > /dev/null ] then # GNU groff TROFF="groff $FORMAT" TROFF2PS="cat" -elif [ -x /usr/lib/lp/postscript/dpost ] +elif [ which dpost > /dev/null ] then # Solaris 2.1 TROFF="troff $FORMAT" TROFF2PS="/usr/lib/lp/postscript/dpost" else - echo "Cannot find troff-to-PostScript filter" + echo "Cannot find troff-to-PostScript filter" >&2 exit 1 fi Only in dtl: .svn