Discussion:
Bug#561785: texlive-base: texdoc does not use standard pdf-viewer defined in KDE
(too old to reply)
Johannes Fichtinger
2009-12-20 11:00:02 UTC
Permalink
Package: texlive-base
Version: 2009-4
Severity: normal

Hallo!

When calling texdoc PACKAGENAME in KDE, the pdf description of the package is actually opened with GIMP, instead of using the KDE system-wide setting for the default pdf viewer, e.g. okular.

The problem arises due to a wrong selection of the application based on the existance of certain commands in /usr/share/texmf-texlive/scripts/texdoc/texdoc.tlu (starting from line 747):

viewer_pdf = first_in_path {
{'gnome-open', '(gnome-open %s) &'}, -- gnome
{'kde-open', '(kde-open %s) &'}, -- kde 4
{'kfmclient', '(kfmclient exec %s) &'}, -- older kde
{'exo-open', '(exo-open %s) &'}, -- xfce
{'xdg-open', '(xdg-open %s) &'}, -- freedesktop.org
{'evince', '(evince %s) &'},
{'okular', '(okular %s) &'},
[...]

Selecting the pdf-viewer based on the existence of eg. gnome-open in the path is incorrect since being in a KDE session still gnome-open might be found in the path. It would be better to base the selection instead on some environment variables. KDE provides eg.
declare -x KDE_FULL_SESSION="true"
which can be used to detect if we are in a running KDE session. Gnome might provide similar variables.

Johannes


-- Package-specific info:
If you report an error when running one of the TeX-related binaries
(latex, pdftex, metafont,...), or if the bug is related to bad or wrong
output, please include a MINIMAL example input file that produces the
error in your report. Don't forget to also include minimal examples of
other files that are needed, e.g. bibtex databases. Often it also helps
to include the logfile. Please, never send included pictures!

If your example file isn't short or produces more than one page of
output (except when multiple pages are needed to show the problem),
you can probably minimize it further. Instructions on how to do that
can be found at

http://www.latex-einfuehrung.de/mini-en.html (english)

or

http://www.latex-einfuehrung.de/mini.html (german)

##################################
minimal input file


##################################
other files

######################################
List of ls-R files

-rwxr-xr-x 1 jo jo 1711 Sep 17 16:24 /home/jo/texmf/ls-R
-rw-r--r-- 1 root root 1099 Dec 16 09:24 /var/lib/texmf/ls-R
-rw-rw-r-- 1 root staff 80 Dec 16 09:24 /usr/local/share/texmf/ls-R
lrwxrwxrwx 1 root root 29 Dec 15 11:15 /usr/share/texmf/ls-R -> /var/lib/texmf/ls-R-TEXMFMAIN
lrwxrwxrwx 1 root root 27 Dec 15 11:15 /usr/share/texmf-texlive/ls-R -> /var/lib/texmf/ls-R-TEXLIVE
lrwxrwxrwx 1 root root 27 Dec 15 11:15 /usr/share/texmf-texlive/ls-R -> /var/lib/texmf/ls-R-TEXLIVE
######################################
Config files
lrwxrwxrwx 1 root root 20 Dec 15 11:15 /usr/share/texmf/web2c/texmf.cnf -> /etc/texmf/texmf.cnf
-rw-r--r-- 1 root root 4634 Dec 15 11:17 /var/lib/texmf/web2c/fmtutil.cnf
-rw-r--r-- 1 root root 10219 Dec 15 11:17 /var/lib/texmf/web2c/updmap.cfg
-rw-r--r-- 1 root root 3709 Dec 15 11:17 /var/lib/texmf/tex/generic/config/language.dat
######################################
Files in /etc/texmf/web2c/
total 4
-rw-r--r-- 1 root root 283 Dec 12 23:51 mktex.cnf
######################################
md5sums of texmf.d
3875bf0f4a53a29b7f247399dc9833e2 /etc/texmf/texmf.d/05TeXMF.cnf
6e82a3d4c00ae7e4f86aa8dcf9438cf3 /etc/texmf/texmf.d/15Plain.cnf
c60a084820a0b73e3bfbf2e90bda437c /etc/texmf/texmf.d/45TeXinputs.cnf
ea33127256c6a9f37145ae5b16fdb80c /etc/texmf/texmf.d/55Fonts.cnf
afccf1d3f87057411166a77c58e00bd1 /etc/texmf/texmf.d/65BibTeX.cnf
9da7c1c7b1eaf06f941af91f48a23068 /etc/texmf/texmf.d/75DviPS.cnf
37329819f1109e8a457e64b8b58fecdb /etc/texmf/texmf.d/85Misc.cnf
a8952d594677235951d447665ec46e9c /etc/texmf/texmf.d/90TeXDoc.cnf
bab3b7e578107f999fa1b0768994f6f8 /etc/texmf/texmf.d/95NonPath.cnf

-- System Information:
Debian Release: squeeze/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-trunk-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_AT.UTF-8, LC_CTYPE=de_AT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages texlive-base depends on:
ii dpkg 1.15.5.4 Debian package management system
ii install-info 4.13a.dfsg.1-5 Manage installed documentation in
ii luatex 0.46.0-7 next generation TeX engine
ii mime-support 3.48-1 MIME files 'mime.types' & 'mailcap
ii tex-common 2.03 common infrastructure for building
ii texlive-binaries 2009-3 Binaries for TeX Live
ii texlive-common 2009-4 TeX Live: Base component
ii texlive-doc-base 2009-2 TeX Live: TeX Live documentation

Versions of packages texlive-base recommends:
ii lmodern 2.004.1-3 scalable PostScript and OpenType f

Versions of packages texlive-base suggests:
ii ghostscript [postscript-v 8.70~dfsg-2+b1 The GPL Ghostscript PostScript/PDF
ii gv [postscript-viewer] 1:3.6.7-1 PostScript and PDF viewer for X
ii okular [postscript-viewer 4:4.3.4-1 document viewer for KDE 4
ii perl-tk 1:804.028-6 Perl module providing the Tk graph
pn xpdf-reader | pdf-viewer <none> (no description available)

Versions of packages tex-common depends on:
ii debconf [debconf-2.0] 1.5.28 Debian configuration management sy
ii dpkg 1.15.5.4 Debian package management system
ii ucf 3.0025 Update Configuration File: preserv

Versions of packages texlive-base is related to:
pn tetex-base <none> (no description available)
pn tetex-bin <none> (no description available)
pn tetex-extra <none> (no description available)
ii tex-common 2.03 common infrastructure for building

-- debconf information:
tex-common/check_texmf_wrong:
tex-common/check_texmf_missing:
--
To UNSUBSCRIBE, email to debian-bugs-dist-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Norbert Preining
2009-12-20 22:30:02 UTC
Permalink
Hi Manuel,

here is a bug report from Debian that suggests something regarding
viewer selection. Can you please comment on it?
Post by Johannes Fichtinger
Hallo!
When calling texdoc PACKAGENAME in KDE, the pdf description of the package is actually opened with GIMP, instead of using the KDE system-wide setting for the default pdf viewer, e.g. okular.
viewer_pdf = first_in_path {
{'gnome-open', '(gnome-open %s) &'}, -- gnome
{'kde-open', '(kde-open %s) &'}, -- kde 4
{'kfmclient', '(kfmclient exec %s) &'}, -- older kde
{'exo-open', '(exo-open %s) &'}, -- xfce
{'xdg-open', '(xdg-open %s) &'}, -- freedesktop.org
{'evince', '(evince %s) &'},
{'okular', '(okular %s) &'},
[...]
Selecting the pdf-viewer based on the existence of eg. gnome-open in the path is incorrect since being in a KDE session still gnome-open might be found in the path. It would be better to base the selection instead on some environment variables. KDE provides eg.
declare -x KDE_FULL_SESSION="true"
which can be used to detect if we are in a running KDE session. Gnome might provide similar variables.
Johannes
For Manuel: This is the texdoc version as shipped on the DVD, not that
fixes you put it after release.

Best wishes

Norbert

----------------------------------------------------------------------------
Norbert Preining preining@{jaist.ac.jp, logic.at, debian.org}
JAIST, Japan TU Wien, Austria Debian TeX Task Force
gpg DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094
----------------------------------------------------------------------------
NYBSTER (n.)
Sort of person who takes the lift to travel one floor.
--- Douglas Adams, The Meaning of Liff
--
To UNSUBSCRIBE, email to debian-bugs-dist-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Manuel Pégourié-Gonnard
2009-12-20 23:50:02 UTC
Permalink
Hi Norbert, hi all,
Post by Norbert Preining
here is a bug report from Debian that suggests something regarding
viewer selection. Can you please comment on it?
Sure.
Post by Norbert Preining
Post by Johannes Fichtinger
When calling texdoc PACKAGENAME in KDE, the pdf description of the package
is actually opened with GIMP, instead of using the KDE system-wide setting
for the default pdf viewer, e.g. okular.
It was already reported upstream, so I "fixed" it by putting gnome-open
etc at the end of the list in a later texdoc version. This should make
the viewer selection no worse than it was before I added those, but
won't recognize kde/gnome/whatever properly.

However, see below.
Post by Norbert Preining
Post by Johannes Fichtinger
Selecting the pdf-viewer based on the existence of eg. gnome-open in
the path is incorrect since being in a KDE session still gnome-open
might be found in the path. It would be better to base the selection
instead on some environment variables. KDE provides eg.
declare -x KDE_FULL_SESSION="true"
which can be used to detect if we are in a running KDE session. Gnome
might provide similar variables.
This is a good suggestion. I may try to enhance the viewer selection in
future versions by looking at those variables also. Do you have a
pointer to this in the KDE documentation?

In the meanwhile, you can still select your prefered viewer in your
local configuration file.
Post by Norbert Preining
For Manuel: This is the texdoc version as shipped on the DVD, not that
fixes you put it after release.
Ok. I can provide you with a patch against 0.47 so that gnome-open etc
come at the end of the list, which is done in current versions of texdoc.
Or you can update texdoc from current TL. Or whatever you suggest.

Manuel.
--
To UNSUBSCRIBE, email to debian-bugs-dist-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Frank Küster
2009-12-22 22:30:02 UTC
Permalink
Post by Norbert Preining
Hi Manuel,
here is a bug report from Debian that suggests something regarding
viewer selection. Can you please comment on it?
Just my 2 cents: I suggest that we use "see" wherever possible. I
don't care about KDE defaults, but "see" is the Debian way to say "give
me the viewer for this file type that is configured on this system".

I'm not familiar with the current version of texdoc, so I cannot comment
whether this is easy or not. Wasn't there a configuration file, which
also defines viewer applications?

Regards, Frank
--
Dr. Frank Küster
Debian Developer (TeXLive)
VCD Aschaffenburg-Miltenberg, ADFC Miltenberg
B90/Grüne KV Miltenberg
--
To UNSUBSCRIBE, email to debian-bugs-dist-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Manuel Pégourié-Gonnard
2009-12-24 12:10:02 UTC
Permalink
Hi Frank,
Post by Frank Küster
Just my 2 cents: I suggest that we use "see" wherever possible. I
don't care about KDE defaults, but "see" is the Debian way to say "give
me the viewer for this file type that is configured on this system".
IIRC, 'see' is in the list of default viewers, but quite at the end.
Post by Frank Küster
I'm not familiar with the current version of texdoc, so I cannot comment
whether this is easy or not. Wasn't there a configuration file, which
also defines viewer applications?
Yes, there is a configuration file which can be used for this purpose.
It is TEXMFMAIN/texdoc/texdoc.cnf (installed as
/usr/share/texmf-texlive/texdoc/texdoc.cnf in Debian). The comments in the
file
should be clear enough about how to do this (I hope).

I agree that using 'see' as the default viewer on Debian makes a lot of
sense
in theory, but as a user, I never configured it myself, so it most probably

doesn't reflect my real preferences. Anyway...

Manuel.
--
To UNSUBSCRIBE, email to debian-bugs-dist-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Norbert Preining
2009-12-24 12:50:02 UTC
Permalink
Post by Manuel Pégourié-Gonnard
Yes, there is a configuration file which can be used for this purpose.
It is TEXMFMAIN/texdoc/texdoc.cnf (installed as
/usr/share/texmf-texlive/texdoc/texdoc.cnf in Debian). The comments in the
file
should be clear enough about how to do this (I hope).
We wil use that for moving see to the top of the list, no need for
changes on the upstream texdoc side itself.

Thanks

Norbert
------------------------------------------------------------------------
Norbert Preining preining@{jaist.ac.jp, logic.at, debian.org}
JAIST, Japan TU Wien, Austria Debian TeX Task Force
DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094
------------------------------------------------------------------------
SCRAMOGE (vb.)
To cut oneself whilst licking envelopes.
--- Douglas Adams, The Meaning of Liff
--
To UNSUBSCRIBE, email to debian-bugs-dist-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Loading...