This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gv: Unable to open the display


On Mon, 27 Sep 2004, Alex Vinokur wrote:

> "Igor Pechtchanski" wrote:
> > On Mon, 27 Sep 2004, Alex Vinokur wrote:
> >
> > > "Igor Pechtchanski" wrote:
> > > > On Mon, 27 Sep 2004, Dr. Volker Zell wrote:
> > > >
> > > > > >>>>> Alex Vinokur writes:
> > > > >
> > > > >     > $ gv -v
> > > > >     > gv: Unable to open the display
> > > >
> > > > That's because the DISPLAY variable is not set correctly.  For a default X
> > > > invocation (no display number on the command line), DISPLAY should be
> > > > ":0.0".
> > > >
> > > > >     > $ cygcheck -sr | grep ghost
> > > > >     > ghostscript-base     7.05-2
> > > > >     > ghostscript-x11      7.05-2
> > > > >
> > > > >     > Also:
> > > > >     > $ which -a gs
> > > > >     > /usr/local/bin/gs
> > > > >     > /usr/bin/gs
> > > > >     > /bin/gs
> > > > >     > /usr/bin/gs
> > > > >     > /usr/X11R6/bin/gs
> > > > >
> > > > > Make sure /usr/X11R6/bin/gs is first in your path.
> > > >
> > > > Good advice in any case.
> > > > Igor
> > > [snip]
> > >
> > > Some changes have be done.
> > >
> > > $ which gs
> > > /usr/X11R6/bin/gs
> > >
> > > $ set | grep DISP
> > > DISPLAY=:0.0
> > >
> > > $ gs zzz.tex
> > > GNU Ghostscript 7.05 (2002-04-22)
> > > Copyright (C) 2002 artofcode LLC, Benicia, CA.  All rights reserved.
> > > This software comes with NO WARRANTY: see the file PUBLIC for details.
> > > GNU Ghostscript 7.05: Cannot open X display `:0.0'.
> > > **** Unable to open the initial device, quitting.
> > >
> > > Something else?
> >
> > Yeah.  Run X? ;-)
>
> Indeed. Thanks.
>
> --- xterm ---
> $ gv foo.ps   // works fine.
> $ gs foo.ps   // works fine.
>
> However
> $ gs foo.tex
> [legitimate Ghostscript error snipped]
> GNU Ghostscript 7.05: Unrecoverable error, exit code 1

Now, why would ever you do something silly like this?

.tex files aren't .ps files, so *obviously* gs won't understand them.
It's like expecting gs to understand the following C program:

#include <stdio.h>
int main(int ac, char *av[]) {
  printf("%s",
	 "%!PS-Adobe-2.0\n"
	 "%%Pages: 1\n"
	 "%%PageOrder: Ascend\n"
	 "%%BoundingBox: 0 0 596 842\n"
	 "%%EndComments\n"
	 "%%Page: 1 1\n"
	 "showpage\n"
	 "%%EOF\n");
}

(which, BTW, will produce one possible empty PostScript file).

A .tex file is essentially a *program* (well, a set of Turing-complete
markup macros) that you need to run through a compiler to get a document
out.  The "tex" executable is such a compiler (or the "latex" executable
if you use the LaTeX set of macros).  Either of those will produce a .dvi
file, which you need to convert to .ps with the help of the "dvips"
executable.  Only when this conversion is done can you view the resulting
.ps file.

All of the above, BTW, is right there in black and white in the TeX FAQ:
<http://www.tex.ac.uk/cgi-bin/texfaq2html?label=readtex>.  Furthermore,
the Cygwin/X list is definitely the wrong place to discuss this (and so is
the main Cygwin list, as this is in no way whatsoever related to Cygwin).
The correct, if terse, response to the error above would be "this is
expected behavior, period".

If you have further questions about TeX/LaTeX, please see
<http://www.tex.ac.uk/cgi-bin/texfaq2html?label=maillists>.  If you have
specific problems with the Cygwin version of TeX/LaTeX (i.e., problems
that you can't reproduce on a Linux system, or using a MiKTeX
distribution), please feel free to ask on the main Cygwin list.
HTH,
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Happiness lies in being privileged to work hard for long hours in doing
whatever you think is worth doing."  -- Dr. Jubal Harshaw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]