[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Debian]: Re: Xdvi meckert bei gzipten Dokumenten



Markus Mueller schrieb am Donnerstag, den 08. Juli 1999:

> markus@eris[/usr/doc/texmf/latex/general]$ xdvi guide.dvi.gz 
> xdvi.bin: Not a DVI file
> 
> Ungepackte Dokumente lassen sich einwandfrei ansehen.

Dann mußt Du die DVI-Files erst auspacken bevor Du xdvi aufrufst :-)

> In der Manpage von xdvi wird zum Thema gzip folgendes erwaehnt:
> 
>        If a file name is given (as opposed to a  shell  command),
>        if  that  file  name ends in `.Z'' or `.gz'', and if the
>        first two bytes of the file  indicate  that  it  was  com­
>        pressed  with  compress(1)  or gzip(1), respectively, then
>        the file is first uncompressed with uncompress -c or  gun­
>        zip  -c,  respectively.   This  is  preferred over using a
>        backtick to call the command directly, since  you  do  not
>        have  to  specify -allowshell and since it allows for path
>        searching.

> Das soll doch wohl heissen, dass auch gzipte DVIs dargestellt
> werden, oder ?

Nicht, wenn man sich die Kapitelüberschrift ansieht, auf die sich
obiges bezieht: "HANDLING OF POSTSCRIPT FIGURES". Anscheinend kann
xdvi also nur Postscript-Files innerhalb von DVI-Files entpacken, aber 
nicht die DVI-Files selber.

> Kann mir von euch vielleicht jemand einen Tip geben oder einen
> Alternativ- vorschlag zum xdvi machen ?

Wie wäre es mit dem angehängten Skript, welches (wenn es als zxdvi
aufgerufen wird) ein oder mehrere mit gzip, bzip, bzip2, freeze oder
compress gepackte DVI-Files anhand der Dateiendung erkennt, in
temporäre Dateien entpackt und diese dann mittels xdvi anzeigt.

Tschoeeee

        Roland

-- 
 * roland@spinnaker.de * http://www.spinnaker.de/ *
 PGP: 1024/DD08DD6D   2D E7 CC DE D5 8D 78 BE  3C A0 A4 F1 4B 09 CE AF
#! /bin/sh
#
# $Id: zxdvi,v 1.3 1998/10/26 16:25:43 roland Exp $
#
# zxdvi      - display gzipped DVI-files.
# zghostview - display gzipped PostScript-files.
# zgv        - display gzipped PostScript-/PDF-files.
# zdvi2tty   - display gzipped DVI-files.
# zxpdf      - display gzipped PDF-files.
#
##########################################################################
#
#   Copyright (C) 1995-1998  Roland Rosenfeld <roland@spinnaker.rhein.de>
#
#   This program is free software; you can redistribute it and/or
#   modify it under the terms of the GNU General Public License as
#   published by the Free Software Foundation; either version 2 of
#   the License, or (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
#   General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program; if not, write to the Free Software
#   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
##########################################################################

umask 077

tmpdir=${TMPDIR:-/tmp}/zxdvi.$$
mkdir $tmpdir || exit 1
trap "rm -rf $tmpdir; exit" 0 1 2 3 15

ZPROG=`basename $0`
PROG=`echo "$ZPROG" | sed -e 's/^z//'`

#if [ PROG = 'xpdf' ]
#then
#    PROG='xpdf -rgb 3'
#fi

for file do
    case "$file" in
	*.Z|*.gz|*.z) TMPFILE=$tmpdir/`basename $file .gz`
	    gzip -dc $file > $TMPFILE
	    ;;
	*.bz) TMPFILE=$tmpdir/`basename $file .bz`
	    bzip -dc $file > $TMPFILE
	    ;;
	*.bz2) TMPFILE=$tmpdir/`basename $file .bz2`
	    bzip2 -dc $file > $TMPFILE
	    ;;
    	*.F) TMPFILE=$tmpdir/`basename $file .F`
	    freeze -dc $file > $TMPFILE
	    ;;
    esac
    $PROG $TMPFILE
    rm -f $TMPFILE
done

Reply to: