Report forwarded to teTeX maintainers <debian-tetex-maint@lists.debian.org>:
Bug#105830; Package tetex-bin.
teTeX maintainers
Subject: Bug#105830: texdoc should make all Debian TeX documentation available
Reply-To: Matthew Swift , 105830-maintonly@bugs.debian.org
Resent-From: Matthew Swift
Resent-To: teTeX maintainers
Resent-Date: Thu, 19 Jul 2001 04:33:18 GMT
Resent-Message-ID:
Resent-Sender: owner@bugs.debian.org
X-Debian-PR-Message: report 105830
X-Debian-PR-Package: tetex-bin
X-Debian-PR-Keywords:
X-Loop: owner@bugs.debian.org
Received: via spool by maintonly@bugs.debian.org id=M.9955167501568
(code M ref -1); Thu, 19 Jul 2001 04:33:18 GMT
Message-Id: <200107190341.f6J3fD96018231@beth.swift.xxx>
From: Matthew Swift
To: Debian Bug Tracking System
X-Reportbug-Version: 1.21
X-Mailer: reportbug 1.21
Date: Wed, 18 Jul 2001 23:41:13 -0400
Delivered-To: maintonly@bugs.debian.org
Package: tetex-bin
Version: 1.0.7+20001218-4
Severity: wishlist
TeTeX's texdoc program in tetex-bin and its TCL front end in the package
tktexdoc are useful programs, but their usefulness is severely compromised by
working only on documentation included with teTeX. TeTeX (the web2c
underneath, actually) is designed to function well as the core of a larger TeX
installation, for example a full Debian TeX installation that includes other
TeX packages besides teTeX. So the suggestion to make texdoc aware of all
Debian TeX documentation is not a misuse of texdoc.
Let me take the Debian bibtool package as an example. It is very inconvenient
that "texdoc bibtool" (or perusing the menus of tktexdoc) does not give me
bibtool's documentation, which is available on my system. I have to go look in
/usr/share/doc/bibtool to find that, and before that, I have to type dpkg -S
bibtool to find out where to look. A naive user has no reason to distinguish
between programs in teTeX proper and those outside it. An experienced user or
developer wants to use his brain to store more relevant information.
I have one suggestion on how to accomplish it, but I am by no means an expert
on Debian development, so there may be better solutions. If each TeX-related
package self-identified or registered its documentation files somehow, these
files could be linked into a directory indexed by texdoc, i.e., referenced by
the default value of $TEXDOCS in teTeX's texmf.cnf. I imagine this would be
done by having the .postinst of each TeX package invoke a common script to
which it provides a list of documentation files.
In the Debian tradition, such a facility for registration could even be
independent of its intended first application to texdoc, by which I mean the
tetex-doc package itself would register, with the idea that one day perhaps
some other program besides texdoc would take advantage of the list of Debian
TeX documentation files to provide convenienet user access to them.
I've made this suggestion sound complicated because I have described it
abstractly, but following it might be as simple as having each TeX package call
the following script its postinst while sending a space-separated list of files
on stdin (though some complementary action would need to be taken in .postrm):
register-dox /usr/share/doc/pkg/foo.dvi /usr/share/doc/pkg/bar.dvi
... register-dox is:
#!/bin/sh
tetex-doc-dir=/usr/doc/texmf/alien-to-tetex
mkdir -p $tetex-doc-dir
for f; do
fn=$(echo $f | tr / _) # uniquify the filename
ln -s $f $tetex-doc-dir/$fn
done
texhash # or, better, use install-lsr in the loop
The corresponding action in .postrm (or wherever) would be something like:
rm $tetex-doc-dir/_usr_share_doc_pkg_*
texhash
-- System Information
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux beth 2.4.2 #1 Fri Apr 6 10:19:26 EDT 2001 i686
Locale: LANG=C, LC_CTYPE=C
Versions of packages tetex-bin depends on:
ii debianutils 1.15 Miscellaneous utilities specific t
ii dpkg 1.9.6 Package maintenance system for Deb
ii ed 0.2-19 The classic unix line editor
ii libc6 2.2.3-5 GNU C Library: Shared libraries an
ii libkpathsea3 1.0.7+20001218-4 shared libkpathsea for teTeX
ii libpng2 1.0.11-1 PNG library - runtime
ii libstdc++2.10-glibc2.2 1:2.95.4-0.010424 The GNU stdc++ library
ii libtiff3g 3.5.5-4 Tag Image File Format library
ii libwww0 5.3.2-5 The W3C-WWW library.
ii libxaw7 4.0.3-4 X Athena widget set library
ii perl-base [perl5-base] 5.6.1-5 The Pathologically Eclectic Rubbis
ii tetex-base 1.0.2+20000804-8 basic teTeX library files
ii xlibs 4.0.3-4 X Window System client libraries
ii zlib1g 1:1.1.3-15 compression library - runtime
Acknowledgement sent to Matthew Swift <swift@alum.mit.edu>:
New Bug report received and forwarded. Copy sent to teTeX maintainers <debian-tetex-maint@lists.debian.org>.
-t
From: owner@bugs.debian.org (Debian Bug Tracking System)
To: Matthew Swift
Subject: Bug#105830: Acknowledgement of maintainer-only report
(texdoc should make all Debian TeX documentation available)
Message-ID:
In-Reply-To: <200107190341.f6J3fD96018231@beth.swift.xxx>
References: <200107190341.f6J3fD96018231@beth.swift.xxx>
X-Debian-PR-Message: ack-maintonly 105830
Thank you for the problem report you have sent regarding Debian.
This is an automatically generated reply, to let you know your message has
been received. It is being forwarded to the developers (but not the mailing
list, as you requested) for their attention; they will reply in due course.
Your message has been sent to the package maintainer(s):
teTeX maintainers
If you wish to submit further information on your problem, please send
it to 105830-maintonly@bugs.debian.org (and *not*
to maintonly@bugs.debian.org).
Please do not reply to the address at the top of this message,
unless you wish to report a problem with the Bug-tracking system.
Darren Benham
(administrator, Debian Bugs database)
Received: (at maintonly) by bugs.debian.org; 19 Jul 2001 04:25:50 +0000
From swift@alum.mit.edu Wed Jul 18 23:25:50 2001
Return-path:
Received: from poseidon.shore.net [::ffff:207.244.124.88]
by master.debian.org with esmtp (Exim 3.12 1 (Debian))
id 15N5Nm-0000PD-00; Wed, 18 Jul 2001 23:25:50 -0500
Received: from swift.shore.net [206.243.167.24]
by poseidon.shore.net with esmtp (Exim)
for maintonly@bugs.debian.org
id 15N5NW-0005Y9-00; Thu, 19 Jul 2001 00:25:35 -0400
Received: from beth.swift.xxx (localhost [127.0.0.1])
by localhost (8.12.0.Beta7/8.12.0.Beta7/Debian 8.12.0.Beta7-1) with ESMTP id f6J3o1Da019506
for ; Wed, 18 Jul 2001 23:50:01 -0400
Received: (from swift@localhost)
by beth.swift.xxx (8.12.0.Beta7/8.12.0.Beta7/Debian 8.12.0.Beta7-1) id f6J3fD96018231;
Wed, 18 Jul 2001 23:41:13 -0400
Message-Id: <200107190341.f6J3fD96018231@beth.swift.xxx>
From: Matthew Swift
To: Debian Bug Tracking System
Subject: texdoc should make all Debian TeX documentation available
X-Reportbug-Version: 1.21
X-Mailer: reportbug 1.21
Date: Wed, 18 Jul 2001 23:41:13 -0400
Delivered-To: maintonly@bugs.debian.org
Package: tetex-bin
Version: 1.0.7+20001218-4
Severity: wishlist
TeTeX's texdoc program in tetex-bin and its TCL front end in the package
tktexdoc are useful programs, but their usefulness is severely compromised by
working only on documentation included with teTeX. TeTeX (the web2c
underneath, actually) is designed to function well as the core of a larger TeX
installation, for example a full Debian TeX installation that includes other
TeX packages besides teTeX. So the suggestion to make texdoc aware of all
Debian TeX documentation is not a misuse of texdoc.
Let me take the Debian bibtool package as an example. It is very inconvenient
that "texdoc bibtool" (or perusing the menus of tktexdoc) does not give me
bibtool's documentation, which is available on my system. I have to go look in
/usr/share/doc/bibtool to find that, and before that, I have to type dpkg -S
bibtool to find out where to look. A naive user has no reason to distinguish
between programs in teTeX proper and those outside it. An experienced user or
developer wants to use his brain to store more relevant information.
I have one suggestion on how to accomplish it, but I am by no means an expert
on Debian development, so there may be better solutions. If each TeX-related
package self-identified or registered its documentation files somehow, these
files could be linked into a directory indexed by texdoc, i.e., referenced by
the default value of $TEXDOCS in teTeX's texmf.cnf. I imagine this would be
done by having the .postinst of each TeX package invoke a common script to
which it provides a list of documentation files.
In the Debian tradition, such a facility for registration could even be
independent of its intended first application to texdoc, by which I mean the
tetex-doc package itself would register, with the idea that one day perhaps
some other program besides texdoc would take advantage of the list of Debian
TeX documentation files to provide convenienet user access to them.
I've made this suggestion sound complicated because I have described it
abstractly, but following it might be as simple as having each TeX package call
the following script its postinst while sending a space-separated list of files
on stdin (though some complementary action would need to be taken in .postrm):
register-dox /usr/share/doc/pkg/foo.dvi /usr/share/doc/pkg/bar.dvi
... register-dox is:
#!/bin/sh
tetex-doc-dir=/usr/doc/texmf/alien-to-tetex
mkdir -p $tetex-doc-dir
for f; do
fn=$(echo $f | tr / _) # uniquify the filename
ln -s $f $tetex-doc-dir/$fn
done
texhash # or, better, use install-lsr in the loop
The corresponding action in .postrm (or wherever) would be something like:
rm $tetex-doc-dir/_usr_share_doc_pkg_*
texhash
-- System Information
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux beth 2.4.2 #1 Fri Apr 6 10:19:26 EDT 2001 i686
Locale: LANG=C, LC_CTYPE=C
Versions of packages tetex-bin depends on:
ii debianutils 1.15 Miscellaneous utilities specific t
ii dpkg 1.9.6 Package maintenance system for Deb
ii ed 0.2-19 The classic unix line editor
ii libc6 2.2.3-5 GNU C Library: Shared libraries an
ii libkpathsea3 1.0.7+20001218-4 shared libkpathsea for teTeX
ii libpng2 1.0.11-1 PNG library - runtime
ii libstdc++2.10-glibc2.2 1:2.95.4-0.010424 The GNU stdc++ library
ii libtiff3g 3.5.5-4 Tag Image File Format library
ii libwww0 5.3.2-5 The W3C-WWW library.
ii libxaw7 4.0.3-4 X Athena widget set library
ii perl-base [perl5-base] 5.6.1-5 The Pathologically Eclectic Rubbis
ii tetex-base 1.0.2+20000804-8 basic teTeX library files
ii xlibs 4.0.3-4 X Window System client libraries
ii zlib1g 1:1.1.3-15 compression library - runtime
Changed Bug title.
Request was from Frank Küster <frank@kuesterei.ch>
to control@bugs.debian.org.
Received: (at control) by bugs.debian.org; 27 Aug 2005 15:54:32 +0000
From frank@kuesterei.ch Sat Aug 27 08:54:32 2005
Return-path:
Received: from idmailgate1.unizh.ch [130.60.127.100]
by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
id 1E930q-0001y4-00; Sat, 27 Aug 2005 08:54:32 -0700
Received: from localhost.localdomain ([130.60.169.214])
by idmailgate1.unizh.ch (8.13.1/8.13.1/SuSE Linux 0.7) with ESMTP id j7RFsG4x026687;
Sat, 27 Aug 2005 17:54:16 +0200
Received: from localhost
([127.0.0.1] helo=localhost.localdomain ident=frank)
by localhost.localdomain with esmtp (Exim 4.50)
id 1E930a-0006jH-7Q; Sat, 27 Aug 2005 17:54:16 +0200
To: Thomas Ruedas
Cc: 105830-forwarded@bugs.debian.org, Matthew Swift
Subject: Please provide a method for packages to register themselves to
texdoctk
X-Attribution: fant
X-Ehrenamt: http://www.langau.de
In-Reply-To: <200107190341.f6J3fD96018231@beth.swift.xxx> (Matthew Swift's
message of "Wed, 18 Jul 2001 23:41:13 -0400")
References: <200107190341.f6J3fD96018231@beth.swift.xxx>
From: =?iso-8859-1?q?Frank_K=FCster?=
Date: Sat, 27 Aug 2005 17:54:15 +0200
Message-ID: <87br3jgyu0.fsf@alhambra.kuesterei.ch>
User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-Virus-Scanned: by amavisd-new
Delivered-To: control@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level:
X-Spam-Status: No, hits=-5.0 required=4.0 tests=BAYES_00,VALID_BTS_CONTROL
autolearn=no version=2.60-bugs.debian.org_2005_01_02
retitle 105830 Please provide a method for packages to register themselves =
to texdoctk
thanks
Hello Thomas,
Matthew suggested (actually long ago) that TeX packages and TeX-related
programs not included with teTeX should have the possibility to make
themselves known to texdoctk. This shouldn't be too difficult, if
texdoctk would allow them to drop a file "texdoctk-.dat" or
similar into its directory and read the information from this file,
merging all files it finds there.
What do you think about this?
Thanks in advance, Frank
--=20
Frank K=FCster
Inst. f. Biochemie der Univ. Z=FCrich
Debian Developer
Reply sent to Frank Küster <frank@kuesterei.ch>:
You have marked Bug as forwarded.
-t
X-Loop: owner@bugs.debian.org
From: owner@bugs.debian.org (Debian Bug Tracking System)
To: Frank =?UTF-8?Q?K=C3=BCster?=
Cc: teTeX maintainers
Subject: Bug#105830: marked as forwarded (Please provide a method for packages to register themselves to texdoctk)
Message-ID:
In-Reply-To: <87br3jgyu0.fsf@alhambra.kuesterei.ch>
References: <87br3jgyu0.fsf@alhambra.kuesterei.ch> <200107190341.f6J3fD96018231@beth.swift.xxx>
Precedence: bulk
X-Debian-PR-Message: forwarded 105830
X-Debian-PR-Package: tetex-bin
X-Debian-PR-Keywords:
Your message dated Sat, 27 Aug 2005 17:54:15 +0200
with message-id <87br3jgyu0.fsf@alhambra.kuesterei.ch>
has caused the Debian Bug report #105830,
regarding Please provide a method for packages to register themselves to texdoctk
to be marked as having been forwarded to the upstream software
author(s) Thomas Ruedas .
(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere. Please contact me immediately.)
Debian bug tracking system administrator
(administrator, Debian Bugs database)
---------------------------------------
Received: (at 105830-forwarded) by bugs.debian.org; 27 Aug 2005 15:54:32 +0000
From frank@kuesterei.ch Sat Aug 27 08:54:32 2005
Return-path:
Received: from idmailgate1.unizh.ch [130.60.127.100]
by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
id 1E930q-0001y4-00; Sat, 27 Aug 2005 08:54:32 -0700
Received: from localhost.localdomain ([130.60.169.214])
by idmailgate1.unizh.ch (8.13.1/8.13.1/SuSE Linux 0.7) with ESMTP id j7RFsG4x026687;
Sat, 27 Aug 2005 17:54:16 +0200
Received: from localhost
([127.0.0.1] helo=localhost.localdomain ident=frank)
by localhost.localdomain with esmtp (Exim 4.50)
id 1E930a-0006jH-7Q; Sat, 27 Aug 2005 17:54:16 +0200
To: Thomas Ruedas
Cc: 105830-forwarded@bugs.debian.org, Matthew Swift
Subject: Please provide a method for packages to register themselves to
texdoctk
X-Attribution: fant
X-Ehrenamt: http://www.langau.de
In-Reply-To: <200107190341.f6J3fD96018231@beth.swift.xxx> (Matthew Swift's
message of "Wed, 18 Jul 2001 23:41:13 -0400")
References: <200107190341.f6J3fD96018231@beth.swift.xxx>
From: =?iso-8859-1?q?Frank_K=FCster?=
Date: Sat, 27 Aug 2005 17:54:15 +0200
Message-ID: <87br3jgyu0.fsf@alhambra.kuesterei.ch>
User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-Virus-Scanned: by amavisd-new
Delivered-To: 105830-forwarded@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level:
X-Spam-Status: No, hits=-5.0 required=4.0 tests=BAYES_00,VALID_BTS_CONTROL
autolearn=no version=2.60-bugs.debian.org_2005_01_02
X-CrossAssassin-Score: 2
retitle 105830 Please provide a method for packages to register themselves =
to texdoctk
thanks
Hello Thomas,
Matthew suggested (actually long ago) that TeX packages and TeX-related
programs not included with teTeX should have the possibility to make
themselves known to texdoctk. This shouldn't be too difficult, if
texdoctk would allow them to drop a file "texdoctk-.dat" or
similar into its directory and read the information from this file,
merging all files it finds there.
What do you think about this?
Thanks in advance, Frank
--=20
Frank K=FCster
Inst. f. Biochemie der Univ. Z=FCrich
Debian Developer
Received: (at 105830-forwarded) by bugs.debian.org; 27 Aug 2005 15:54:32 +0000
From frank@kuesterei.ch Sat Aug 27 08:54:32 2005
Return-path:
Received: from idmailgate1.unizh.ch [130.60.127.100]
by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
id 1E930q-0001y4-00; Sat, 27 Aug 2005 08:54:32 -0700
Received: from localhost.localdomain ([130.60.169.214])
by idmailgate1.unizh.ch (8.13.1/8.13.1/SuSE Linux 0.7) with ESMTP id j7RFsG4x026687;
Sat, 27 Aug 2005 17:54:16 +0200
Received: from localhost
([127.0.0.1] helo=localhost.localdomain ident=frank)
by localhost.localdomain with esmtp (Exim 4.50)
id 1E930a-0006jH-7Q; Sat, 27 Aug 2005 17:54:16 +0200
To: Thomas Ruedas
Cc: 105830-forwarded@bugs.debian.org, Matthew Swift
Subject: Please provide a method for packages to register themselves to
texdoctk
X-Attribution: fant
X-Ehrenamt: http://www.langau.de
In-Reply-To: <200107190341.f6J3fD96018231@beth.swift.xxx> (Matthew Swift's
message of "Wed, 18 Jul 2001 23:41:13 -0400")
References: <200107190341.f6J3fD96018231@beth.swift.xxx>
From: =?iso-8859-1?q?Frank_K=FCster?=
Date: Sat, 27 Aug 2005 17:54:15 +0200
Message-ID: <87br3jgyu0.fsf@alhambra.kuesterei.ch>
User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-Virus-Scanned: by amavisd-new
Delivered-To: 105830-forwarded@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level:
X-Spam-Status: No, hits=-5.0 required=4.0 tests=BAYES_00,VALID_BTS_CONTROL
autolearn=no version=2.60-bugs.debian.org_2005_01_02
X-CrossAssassin-Score: 2
retitle 105830 Please provide a method for packages to register themselves =
to texdoctk
thanks
Hello Thomas,
Matthew suggested (actually long ago) that TeX packages and TeX-related
programs not included with teTeX should have the possibility to make
themselves known to texdoctk. This shouldn't be too difficult, if
texdoctk would allow them to drop a file "texdoctk-.dat" or
similar into its directory and read the information from this file,
merging all files it finds there.
What do you think about this?
Thanks in advance, Frank
--=20
Frank K=FCster
Inst. f. Biochemie der Univ. Z=FCrich
Debian Developer
Information forwarded to debian-bugs-dist@lists.debian.org, teTeX maintainers <debian-tetex-maint@lists.debian.org>:
Bug#105830; Package tetex-bin.
debian-bugs-dist@lists.debian.orgteTeX maintainers
X-Loop: owner@bugs.debian.org
Subject: Bug#105830: texdoc should make all Debian TeX documentation available
Reply-To: Frank =?UTF-8?Q?K=C3=BCster?= , 105830@bugs.debian.org
Resent-From: Frank =?UTF-8?Q?K=C3=BCster?=
Resent-To: debian-bugs-dist@lists.debian.org
Resent-CC: teTeX maintainers
Resent-Date: Sat, 27 Aug 2005 16:33:06 UTC
Resent-Message-ID:
Resent-Sender: owner@bugs.debian.org
X-Debian-PR-Message: report 105830
X-Debian-PR-Package: tetex-bin
X-Debian-PR-Keywords:
Received: via spool by 105830-submit@bugs.debian.org id=B105830.112516012717157
(code B ref 105830); Sat, 27 Aug 2005 16:33:06 UTC
Received: (at 105830) by bugs.debian.org; 27 Aug 2005 16:28:47 +0000
Received: from idmailgate1.unizh.ch [130.60.127.100]
by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
id 1E93Xy-0004RA-00; Sat, 27 Aug 2005 09:28:46 -0700
Received: from localhost.localdomain ([130.60.169.214])
by idmailgate1.unizh.ch (8.13.1/8.13.1/SuSE Linux 0.7) with ESMTP id j7RGSirM000907
for <105830@bugs.debian.org>; Sat, 27 Aug 2005 18:28:44 +0200
Received: from localhost
([127.0.0.1] helo=localhost.localdomain ident=frank)
by localhost.localdomain with esmtp (Exim 4.50)
id 1E93Xw-00070h-JP
for 105830@bugs.debian.org; Sat, 27 Aug 2005 18:28:44 +0200
To: 105830@bugs.debian.org
X-Attribution: fant
X-Ehrenamt: http://www.langau.de
From: Frank =?UTF-8?Q?K=C3=BCster?=
Date: Sat, 27 Aug 2005 18:28:44 +0200
Message-ID: <87fysvfio3.fsf@alhambra.kuesterei.ch>
User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-Virus-Scanned: by amavisd-new
Delivered-To: 105830@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level:
X-Spam-Status: No, hits=-3.0 required=4.0 tests=BAYES_00 autolearn=no
version=2.60-bugs.debian.org_2005_01_02
Matthew Swift wrote:
> Package: tetex-bin
> Version: 1.0.7+20001218-4
> Severity: wishlist
>
> TeTeX's texdoc program in tetex-bin and its TCL front end in the package
> tktexdoc are useful programs, but their usefulness is severely compromise=
d by
> working only on documentation included with teTeX. TeTeX (the web2c
> underneath, actually) is designed to function well as the core of a large=
r TeX
> installation, for example a full Debian TeX installation that includes ot=
her
> TeX packages besides teTeX. So the suggestion to make texdoc aware of all
> Debian TeX documentation is not a misuse of texdoc.
texdoc is already automatically aware of all files beneath
/usr/share/doc/texmf/, including files at other places that have
symlinks in this directory pointing to them. So this isn't (and AFAIK
never was) a bug. I'll forward the suggestion regarding texdoctk to
its author in a separate mail, since this is by no means a
Debian-specific problem.
Regards, Frank
--=20
Frank K=FCster
Inst. f. Biochemie der Univ. Z=FCrich
Debian Developer
Acknowledgement sent to Frank Küster <frank@kuesterei.ch>:
Extra info received and forwarded to list. Copy sent to teTeX maintainers <debian-tetex-maint@lists.debian.org>.
-t
X-Loop: owner@bugs.debian.org
From: owner@bugs.debian.org (Debian Bug Tracking System)
To: Frank =?UTF-8?Q?K=C3=BCster?=
Subject: Bug#105830: Info received (was texdoc should make all Debian TeX documentation available)
Message-ID:
In-Reply-To: <87fysvfio3.fsf@alhambra.kuesterei.ch>
References: <87fysvfio3.fsf@alhambra.kuesterei.ch>
Precedence: bulk
X-Debian-PR-Message: ack-info 105830
X-Debian-PR-Package: tetex-bin
X-Debian-PR-Keywords:
Thank you for the additional information you have supplied regarding
this problem report. It has been forwarded to the package maintainer(s)
and to other interested parties to accompany the original report.
Your message has been sent to the package maintainer(s):
teTeX maintainers
If you wish to continue to submit further information on your problem,
please send it to 105830@bugs.debian.org, as before.
Please do not reply to the address at the top of this message,
unless you wish to report a problem with the Bug-tracking system.
Debian bug tracking system administrator
(administrator, Debian Bugs database)
Received: (at 105830) by bugs.debian.org; 27 Aug 2005 16:28:47 +0000
From frank@kuesterei.ch Sat Aug 27 09:28:46 2005
Return-path:
Received: from idmailgate1.unizh.ch [130.60.127.100]
by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
id 1E93Xy-0004RA-00; Sat, 27 Aug 2005 09:28:46 -0700
Received: from localhost.localdomain ([130.60.169.214])
by idmailgate1.unizh.ch (8.13.1/8.13.1/SuSE Linux 0.7) with ESMTP id j7RGSirM000907
for <105830@bugs.debian.org>; Sat, 27 Aug 2005 18:28:44 +0200
Received: from localhost
([127.0.0.1] helo=localhost.localdomain ident=frank)
by localhost.localdomain with esmtp (Exim 4.50)
id 1E93Xw-00070h-JP
for 105830@bugs.debian.org; Sat, 27 Aug 2005 18:28:44 +0200
To: 105830@bugs.debian.org
Subject: Re: texdoc should make all Debian TeX documentation available
X-Attribution: fant
X-Ehrenamt: http://www.langau.de
From: =?iso-8859-1?q?Frank_K=FCster?=
Date: Sat, 27 Aug 2005 18:28:44 +0200
Message-ID: <87fysvfio3.fsf@alhambra.kuesterei.ch>
User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-Virus-Scanned: by amavisd-new
Delivered-To: 105830@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level:
X-Spam-Status: No, hits=-3.0 required=4.0 tests=BAYES_00 autolearn=no
version=2.60-bugs.debian.org_2005_01_02
Matthew Swift wrote:
> Package: tetex-bin
> Version: 1.0.7+20001218-4
> Severity: wishlist
>
> TeTeX's texdoc program in tetex-bin and its TCL front end in the package
> tktexdoc are useful programs, but their usefulness is severely compromise=
d by
> working only on documentation included with teTeX. TeTeX (the web2c
> underneath, actually) is designed to function well as the core of a large=
r TeX
> installation, for example a full Debian TeX installation that includes ot=
her
> TeX packages besides teTeX. So the suggestion to make texdoc aware of all
> Debian TeX documentation is not a misuse of texdoc.
texdoc is already automatically aware of all files beneath
/usr/share/doc/texmf/, including files at other places that have
symlinks in this directory pointing to them. So this isn't (and AFAIK
never was) a bug. I'll forward the suggestion regarding texdoctk to
its author in a separate mail, since this is by no means a
Debian-specific problem.
Regards, Frank
--=20
Frank K=FCster
Inst. f. Biochemie der Univ. Z=FCrich
Debian Developer
Received: (at 105830-forwarded) by bugs.debian.org; 28 Aug 2005 23:32:41 +0000
From tr@geol.ku.dk Sun Aug 28 16:32:41 2005
Return-path:
Received: from geo2.geol.ku.dk [130.225.209.4]
by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
id 1E9Wdl-0006XY-00; Sun, 28 Aug 2005 16:32:41 -0700
Received: from [192.168.2.97]
([172.20.202.1])
by geo2.geol.ku.dk; Mon, 29 Aug 2005 01:32:07 +0200
From: Thomas Ruedas
Organization: Geological Institute, Copenhagen
To: Frank =?iso-8859-1?q?K=FCster?=
Subject: Re: Please provide a method for packages to register themselves to texdoctk
Date: Mon, 29 Aug 2005 01:32:04 +0200
User-Agent: KMail/1.6.2
Cc: 105830-forwarded@bugs.debian.org,
Matthew Swift
References: <200107190341.f6J3fD96018231@beth.swift.xxx> <87br3jgyu0.fsf@alhambra.kuesterei.ch>
In-Reply-To: <87br3jgyu0.fsf@alhambra.kuesterei.ch>
MIME-Version: 1.0
Content-Disposition: inline
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
Message-Id: <200508290132.04809.tr@geol.ku.dk>
Delivered-To: 105830-forwarded@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level:
X-Spam-Status: No, hits=-3.0 required=4.0 tests=BAYES_00 autolearn=no
version=2.60-bugs.debian.org_2005_01_02
Hi,
On Saturday 27 August 2005 17:54, Frank Küster wrote:
> Matthew suggested (actually long ago) that TeX packages and TeX-related
[...]
> similar into its directory and read the information from this file,
> merging all files it finds there.
> What do you think about this?
yes, I think that's a good idea. I guess I'll try to give it some more
detailed thought next month and come back to you about it then.
Cheers,
Thomas
--
------------------------------------------------------------------------
Thomas Ruedas
Geological Institute, University of Copenhagen
------------------------------------------------------------------------
Information forwarded to debian-bugs-dist@lists.debian.org, teTeX maintainers <debian-tetex-maint@lists.debian.org>:
Bug#105830; Package tetex-bin.
debian-bugs-dist@lists.debian.orgteTeX maintainers
X-Loop: owner@bugs.debian.org
Subject: Bug#105830: Please provide a method for packages to register themselves to texdoctk
Reply-To: Frank =?UTF-8?Q?K=C3=BCster?= , 105830@bugs.debian.org
Resent-From: Frank =?UTF-8?Q?K=C3=BCster?=
Resent-To: debian-bugs-dist@lists.debian.org
Resent-CC: teTeX maintainers
Resent-Date: Mon, 29 Aug 2005 08:03:12 UTC
Resent-Message-ID:
Resent-Sender: owner@bugs.debian.org
X-Debian-PR-Message: report 105830
X-Debian-PR-Package: tetex-bin
X-Debian-PR-Keywords:
Received: via spool by 105830-submit@bugs.debian.org id=B105830.112530246920222
(code B ref 105830); Mon, 29 Aug 2005 08:03:12 UTC
Received: (at 105830) by bugs.debian.org; 29 Aug 2005 08:01:09 +0000
Received: from idmailgate2.unizh.ch [130.60.127.101]
by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
id 1E9eZp-0005FC-00; Mon, 29 Aug 2005 01:01:09 -0700
Received: from localhost.localdomain ([130.60.169.214])
by idmailgate2.unizh.ch (8.13.1/8.13.1/SuSE Linux 0.7) with ESMTP id j7T80YPN010922;
Mon, 29 Aug 2005 10:00:46 +0200
Received: from localhost
([127.0.0.1] helo=localhost.localdomain ident=frank)
by localhost.localdomain with esmtp (Exim 4.50)
id 1E9eZF-0006QK-9K; Mon, 29 Aug 2005 10:00:33 +0200
To: Thomas Ruedas
Cc: 105830@bugs.debian.org, Matthew Swift
X-Attribution: fant
X-Ehrenamt: http://www.langau.de
In-Reply-To: <200508290132.04809.tr@geol.ku.dk> (Thomas Ruedas's message of
"Mon, 29 Aug 2005 01:32:04 +0200")
References: <200107190341.f6J3fD96018231@beth.swift.xxx>
<87br3jgyu0.fsf@alhambra.kuesterei.ch>
<200508290132.04809.tr@geol.ku.dk>
From: Frank =?UTF-8?Q?K=C3=BCster?=
Date: Mon, 29 Aug 2005 10:00:32 +0200
Message-ID: <87slwtjhpb.fsf@alhambra.kuesterei.ch>
User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-Virus-Scanned: by amavisd-new
Delivered-To: 105830@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level:
X-Spam-Status: No, hits=-3.0 required=4.0 tests=BAYES_00 autolearn=no
version=2.60-bugs.debian.org_2005_01_02
Thomas Ruedas wrote:
> Hi,
> On Saturday 27 August 2005 17:54, Frank K=FCster wrote:
>> Matthew suggested (actually long ago) that TeX packages and TeX-related
> [...]
>> similar into its directory and read the information from this file,
>> merging all files it finds there.
>> What do you think about this?
> yes, I think that's a good idea. I guess I'll try to give it some more=20
> detailed thought next month and come back to you about it then.
Good news, thank you.
Bye, Frank
--=20
Frank K=FCster
Inst. f. Biochemie der Univ. Z=FCrich
Debian Developer
Acknowledgement sent to Frank Küster <frank@kuesterei.ch>:
Extra info received and forwarded to list. Copy sent to teTeX maintainers <debian-tetex-maint@lists.debian.org>.
-t
X-Loop: owner@bugs.debian.org
From: owner@bugs.debian.org (Debian Bug Tracking System)
To: Frank =?UTF-8?Q?K=C3=BCster?=
Subject: Bug#105830: Info received (was Please provide a method for packages to register themselves to texdoctk)
Message-ID:
In-Reply-To: <87slwtjhpb.fsf@alhambra.kuesterei.ch>
References: <87slwtjhpb.fsf@alhambra.kuesterei.ch>
Precedence: bulk
X-Debian-PR-Message: ack-info 105830
X-Debian-PR-Package: tetex-bin
X-Debian-PR-Keywords:
Thank you for the additional information you have supplied regarding
this problem report. It has been forwarded to the package maintainer(s)
and to other interested parties to accompany the original report.
Your message has been sent to the package maintainer(s):
teTeX maintainers
If you wish to continue to submit further information on your problem,
please send it to 105830@bugs.debian.org, as before.
Please do not reply to the address at the top of this message,
unless you wish to report a problem with the Bug-tracking system.
Debian bug tracking system administrator
(administrator, Debian Bugs database)
Received: (at 105830) by bugs.debian.org; 29 Aug 2005 08:01:09 +0000
From frank@kuesterei.ch Mon Aug 29 01:01:09 2005
Return-path:
Received: from idmailgate2.unizh.ch [130.60.127.101]
by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
id 1E9eZp-0005FC-00; Mon, 29 Aug 2005 01:01:09 -0700
Received: from localhost.localdomain ([130.60.169.214])
by idmailgate2.unizh.ch (8.13.1/8.13.1/SuSE Linux 0.7) with ESMTP id j7T80YPN010922;
Mon, 29 Aug 2005 10:00:46 +0200
Received: from localhost
([127.0.0.1] helo=localhost.localdomain ident=frank)
by localhost.localdomain with esmtp (Exim 4.50)
id 1E9eZF-0006QK-9K; Mon, 29 Aug 2005 10:00:33 +0200
To: Thomas Ruedas
Cc: 105830@bugs.debian.org, Matthew Swift
Subject: Re: Please provide a method for packages to register themselves to
texdoctk
X-Attribution: fant
X-Ehrenamt: http://www.langau.de
In-Reply-To: <200508290132.04809.tr@geol.ku.dk> (Thomas Ruedas's message of
"Mon, 29 Aug 2005 01:32:04 +0200")
References: <200107190341.f6J3fD96018231@beth.swift.xxx>
<87br3jgyu0.fsf@alhambra.kuesterei.ch>
<200508290132.04809.tr@geol.ku.dk>
From: =?iso-8859-1?q?Frank_K=FCster?=
Date: Mon, 29 Aug 2005 10:00:32 +0200
Message-ID: <87slwtjhpb.fsf@alhambra.kuesterei.ch>
User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-Virus-Scanned: by amavisd-new
Delivered-To: 105830@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level:
X-Spam-Status: No, hits=-3.0 required=4.0 tests=BAYES_00 autolearn=no
version=2.60-bugs.debian.org_2005_01_02
Thomas Ruedas wrote:
> Hi,
> On Saturday 27 August 2005 17:54, Frank K=FCster wrote:
>> Matthew suggested (actually long ago) that TeX packages and TeX-related
> [...]
>> similar into its directory and read the information from this file,
>> merging all files it finds there.
>> What do you think about this?
> yes, I think that's a good idea. I guess I'll try to give it some more=20
> detailed thought next month and come back to you about it then.
Good news, thank you.
Bye, Frank
--=20
Frank K=FCster
Inst. f. Biochemie der Univ. Z=FCrich
Debian Developer
Received: (at 105830-forwarded) by bugs.debian.org; 29 Sep 2005 19:22:03 +0000
From tr@geol.ku.dk Thu Sep 29 12:22:03 2005
Return-path:
Received: from geo2.geol.ku.dk [130.225.209.4]
by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
id 1EL3yk-0000JL-00; Thu, 29 Sep 2005 12:22:02 -0700
Received: from [172.20.100.39]
([172.20.100.39])
by geo2.geol.ku.dk; Thu, 29 Sep 2005 21:21:26 +0200
From: Thomas Ruedas
Organization: Geological Institute, Copenhagen
To: Frank =?iso-8859-1?q?K=FCster?= ,
Matthew Swift
Subject: Re: Please provide a method for packages to register themselves to texdoctk
Date: Thu, 29 Sep 2005 21:21:23 +0200
User-Agent: KMail/1.6.2
Cc: 105830-forwarded@bugs.debian.org
References: <200107190341.f6J3fD96018231@beth.swift.xxx> <87br3jgyu0.fsf@alhambra.kuesterei.ch>
In-Reply-To: <87br3jgyu0.fsf@alhambra.kuesterei.ch>
MIME-Version: 1.0
Content-Disposition: inline
Content-Type: Multipart/Mixed;
boundary="Boundary-00=_z6DPD7j1Tq4XbzR"
Message-Id: <200509292121.23518.tr@geol.ku.dk>
Delivered-To: 105830-forwarded@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level:
X-Spam-Status: No, hits=-3.0 required=4.0 tests=BAYES_00 autolearn=no
version=2.60-bugs.debian.org_2005_01_02
--Boundary-00=_z6DPD7j1Tq4XbzR
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
Content-Disposition: inline
Hi Frank and Matthew,
On Saturday 27 August 2005 17:54, Frank Küster wrote:
[...]
> Matthew suggested (actually long ago) that TeX packages and TeX-related
> programs not included with teTeX should have the possibility to make
> themselves known to texdoctk. This shouldn't be too difficult, if
> texdoctk would allow them to drop a file "texdoctk-.dat" or
> similar into its directory and read the information from this file,
> merging all files it finds there.
I have implemented such a feature as suggested for the local and home
texmf trees and send you a version of texdoctk to try it out, if you
want. Comments are welcome.
I have informed Thomas Esser about that to learn if he has any concerns,
but didn't get a reply for about 14 days now, so I assume it's ok with
him. Nonetheless I do think that this self-identification mechanism
should be reserved for the site's local and the users' individual texmf
trees, so that there is a standard database in the shipped teTeX
distribution which cannot be affected.
Cheers,
Thomas
--
------------------------------------------------------------------------
Thomas Ruedas
Geological Institute, University of Copenhagen
------------------------------------------------------------------------
--Boundary-00=_z6DPD7j1Tq4XbzR
Content-Type: application/x-perl;
name="texdoctk"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="texdoctk"
#!/usr/bin/env perl
# We started with a hack provided by Thomas Esser. This expression replaces
# the unix specific line \type {#!/usr/local/bin/perl -w}.
###############################################################################
# texdoctk v.0.6.3 (Sep 21, 2005) - GUI for TeX documentation access
# Copyright (C) 2000-2005 Thomas Ruedas
# This program is provided under the GNU Public License; see the file
# README.texdoctk for details about requirements, installation, configuration,
# and the full disclaimer.
###############################################################################
use strict;
use Tk;
use Getopt::Long;
Getopt::Long::config('bundling');
use File::Basename;
my $IsWin32 = ($^O =~ /MSWin32/i);
#if ($IsWin32) {
# use Win32::Registry;
# use Win32::API;
#}
# initialization of some internal variables
$|=1;
my $quiet=1;
my $autoview;
my $xfmt_viewer=1,
my @tdcolors;
my %butcol;
my $srchentry;
my $srchflag=0;
my $tmpfno;
# system variables
my ($texmfmain,$texmfdist,$texmfdoc,$texmflocal,$texmfhome,
$texdocpath,$distdocpath,$docdocpath,$localdocpath,$homedocpath,
$datadir,
$dvi_viewer,$dvips_conv,$ps_viewer,$pdf_viewer,
$pdfps_conv,$html_viewer,$htmlps_conv,$htmlps_redir,
$txt_viewer,$txtps_conv,$txtps_redir,$print_cmd);
# defaults: unix values
my $qq="'";
my $HomeEnv=$ENV{HOME};
my $TeXDocRcDefaults="texdocrc.defaults";
my $TempDir; $TempDir=$ENV{TMPDIR} or $TempDir="/tmp";
my $CmdConsole="xterm -e ";
if ($IsWin32) {
$qq = "\"";
$HomeEnv = &GetHomeDir;
chomp $HomeEnv;
$TeXDocRcDefaults = "texdocrc-win32.defaults";
$TempDir = &GetTempPath;
$CmdConsole = "command /c ";
}
my $myrc="${HomeEnv}/.texdocrc"; # optional personal settings file
my ($line,@dummy);
my @tmpfiles;
# read system-wide defaults from texdocrc.defaults
my $sysrc=`kpsewhich --progname=texdoctk --format=${qq}other text files${qq} ${TeXDocRcDefaults}`;
my $database=`kpsewhich --progname=texdoctk --format=${qq}other text files${qq} texdoctk.dat`;
my $locdatabase=`kpsewhich --progname=texdoctk --format=${qq}other text files${qq} texdoctk-local.dat`;
my $homedatabase=`kpsewhich --progname=texdoctk --format=${qq}other text files${qq} texdoctk-pers.dat`;
chomp $locdatabase;
chomp $homedatabase;
chomp $sysrc;
&readrc($sysrc,1);
@dummy=split("/",$sysrc);
pop @dummy;
$datadir=join('/',@dummy);
# possibly use personal settings instead of defaults
if (-e $myrc) { &readrc($myrc,2); }
# command line options
GetOptions('v'=>\$quiet,'a'=>\$autoview);
my $special=0;
my @button;
$button[17]="Miscellaneous";
my (@packname,@topic,@doc,@keywords,@maxind,%stydoc);
# read database file
my $i=-1;
my $j;
open(DATABASE,"$database") || &fatalmsg("Couldn't open database $database.\n");
while ($line = ) {
LINETYPE: {
($line =~ /^\@/) && do { # category
++$i;
if ($i == $#button) {
pop @button;
push @button,(substr($line,1,-1));
$special=1;
} else {
$button[$i]=substr($line,1,-1);
}
$j=0;
last LINETYPE;
};
($line =~ /^(#|$)/) && do { # comment or empty line
last LINETYPE;
};
# list item
@dummy=split(";",$line);
$packname[$i][$j]=$dummy[0];
$topic[$i][$j]=$dummy[1];
$doc[$i][$j]=$dummy[2];
$keywords[$i][$j]=$dummy[3];
if ($doc[$i][$j] =~ /sty$/ && $keywords[$i][$j]) {
$stydoc{"$doc[$i][$j]"}=substr($keywords[$i][$j],1,1);
unless ($stydoc{"$doc[$i][$j]"} =~ /^\d$/) {
$stydoc{"$doc[$i][$j]"}=0;
}
}
$maxind[$i]=$j;
++$j;
};
}
close(DATABASE);
# Read site-local and user's database(s) if it/they exist(s); also read the
# individual database files of additional packages
my @sudbs;
foreach my $dbfile ($locdatabase,$homedatabase) {
if (-e $dbfile) {
push @sudbs,$dbfile;
my $dbdir=dirname($dbfile);
opendir(DBDIR,$dbdir);
my @lsudbs=grep { /^texdoctk-\w*\.dat$/ &&
basename($dbfile) ne $_ } readdir(DBDIR);
closedir DBDIR;
foreach (@lsudbs) { $_="$dbdir/$_" }
push @sudbs,@lsudbs;
}
}
foreach my $dbfile (@sudbs) {
if (-e "$dbfile") {
open(DATABASE,"$dbfile") ||
print "Couldn't open additional database $dbfile.\n";
$i=17; # local/user: if no category is specified in database, add to "Misc"
while ($line = ) {
LINETYPE: {
($line =~ /^\@/) && do { # category
$i=&arrindex(@button,substr($line,1,-1));
if ($i >= $#button) {
$i=$#button;
pop @button;
push @button,(substr($line,1,-1));
$special=1;
}
last LINETYPE;
};
($line =~ /^(#|$)/) && do { # comment or empty line
last LINETYPE;
};
# list item
@dummy=split(";",$line);
$j=&arrindex(@{$packname[$i]},$dummy[0]);
if ($j > $#{$packname[$i]}) {
$packname[$i][$j]=$dummy[0];
$topic[$i][$j]=$dummy[1];
$doc[$i][$j]=$dummy[2];
$keywords[$i][$j]=$dummy[3];
if ($doc[$i][$j] =~ /sty$/ && $keywords[$i][$j]) {
$stydoc{"$doc[$i][$j]"}=substr($keywords[$i][$j],1,1);
unless ($stydoc{"$doc[$i][$j]"} =~ /^\d$/) {
$stydoc{"$doc[$i][$j]"}=0;
}
}
$maxind[$i]=$j;
++$j;
}
};
}
close(DATABASE);
$special=1 if ($i == 17 && $j > 0);
}
}
# Tk
# hash table for toplevel windows; used to avoid multiple calls of same window
my %tlwins;
my %buttonlist;
# create frames for main window: commands on top, frame for buttons below
my $main=new MainWindow;
$tlwins{'mainwindow'}{'addr'}=$main;
$main->resizable(0,0);
$main->title("TeX Documentation Browser");
$main->bind('all',''=>\&clean_exit);
$main->bind('all',''=>sub { $main->raise(); });
$main->bind('all',''=>\&helptext);
$main->bind('all',''=>sub { $main->raise(); &mksrch; });
$main->bind('all',''=>\&settings);
my $cmdframe=$main->Frame(-background=>"#ffcc99");
my $buttonframe=$main->Frame;
$cmdframe->pack(-side=>'top',-fill=>'x');
$buttonframe->pack(-side=>'bottom');
# normal cursor
my $defcursor=$main->cget(-cursor);
# make buttons for command frame
my $Qbut=$cmdframe->Button(-text=>'Quit',%butcol,
-command=>\&clean_exit)->pack(-side=>'left');
$tlwins{'mainwindow'}{'buttons'}[0]=$Qbut;
# define common default font for labels and text explicitly
my $deffont=$Qbut->cget(-font);
# ensure readability on high-res screens (suggested by R.Kotucha)
$deffont='Helvetica -16 bold' if &x_resolution > 1200;
$Qbut->configure(-font=>$deffont);
$tlwins{'mainwindow'}{'buttons'}[1]=$cmdframe->Button(-text=>'Search',
-font=>$deffont,%butcol,
-command=>\&mksrch
)->pack(-side=>'left');
$tlwins{'mainwindow'}{'buttons'}[2]=$cmdframe->Button(-text=>'Help/About',
-font=>$deffont,%butcol,
-command=>\&helptext
)->pack(-side=>'right');
$tlwins{'mainwindow'}{'buttons'}[3]=$cmdframe->Button(-text=>'Settings',
-font=>$deffont,%butcol,
-command=>\&settings
)->pack(-side=>'right');
# make buttons for category button frame
my $lbut=0;
my $l;
foreach (@button) { $l=length $_; $lbut=$l if ( $l > $lbut) }
my @catg;
my ($i2,$i3);
my $nbutt=scalar @button;
my $ncols=$nbutt/3-1;
foreach (0..$ncols) {
$i=$_;
$i2=$i+$nbutt/3;
$i3=$i+2*$nbutt/3;
$catg[$i]=$buttonframe->Button(-text=>$button[$i],
-font=>$deffont,%butcol,
-width=>$lbut,
-command=>[\&tpslct,$i,\@dummy])->grid
($catg[$i2]=$buttonframe->Button(-text=>$button[$i2],
-font=>$deffont,%butcol,
-width=>$lbut,
-command=>[\&tpslct,$i2,\@dummy]),
$catg[$i3]=$buttonframe->Button(-text=>$button[$i3],
-font=>$deffont,%butcol,
-width=>$lbut,
-command=>[\&tpslct,$i3,\@dummy]));
}
# disable last button (lower right) if no local specials are found in list
my $ncat;
if ($special == 0) {
$catg[$#button]->configure(-state=>'disabled');
$ncat=$nbutt-1;
} else {
$ncat=$nbutt;
}
for ($i=0,$j=4; $i<@catg; ++$i,++$j) {
$tlwins{'mainwindow'}{'buttons'}[$j]=$catg[$i];
}
MainLoop;
########## SUBROUTINES ########################################################
# toplevel for selecting a topic of a category for viewing or printing
sub tpslct {
my($opt,@srchitems)=@_;
my (@lbitems,@lbdocs,$dspselect,$docselect,$wtitle);
if ($opt >= 0) {
# main window buttons
# see if toplevel window is already there
if (Exists($tlwins{$opt}{'addr'})) {
$tlwins{$opt}{'addr'}->deiconify();
$tlwins{$opt}{'addr'}->raise();
return;
}
for ($j=0; $j <= $maxind[$opt]; ++$j) {
push @lbitems,$topic[$opt][$j];
push @lbdocs,$doc[$opt][$j];
}
$wtitle=$button[$opt];
} else {
# search results
my $spec_wtitle=shift @srchitems;
for ($j=0; $j < $#srchitems; $j+=2) {
my $k=$j+1;
push @lbitems,$topic[$srchitems[$j]][$srchitems[$k]];
push @lbdocs,$doc[$srchitems[$j]][$srchitems[$k]];
}
$wtitle="Search results for $spec_wtitle";
}
# toplevel window of category $opt with two frames
my $tpwin=$main->Toplevel(-title=>$wtitle);
$tlwins{$opt}{'addr'}=$tpwin;
my $tpdsp=$tpwin->Frame(-relief=>'groove')->pack(-side=>'top');
my $tpslc=$tpwin->Frame()->pack(-side=>'top');
# selection frame with listbox and buttons
# label for listbox
my $tplabel=$tpslc->Label(-text=>'Topics',
-font=>$deffont)->pack(-anchor=>'w',
-side=>'top');
# listbox with optional scrollbar
my $tplist=$tpslc->Scrolled("Listbox",
-font=>$deffont,
-scrollbars=>'osoe',
# -height=>0,
-width=>0,
-selectmode=>'single',
-exportselection=>0,
-cursor=>'hand2')->pack(-side=>'left',
-fill=>'y',
-expand=>1);
$tplist->insert('end',@lbitems); # fill topics into listbox
&mkscroll($tplist);
# buttons frame
my $tpbframe=$tpslc->Frame(-borderwidth=>8);
$tpbframe->pack(-side=>'right');
# make buttons for command frame
my $n_buttons = 0;
$tlwins{$opt}{'buttons'}[$n_buttons++]=
$tpbframe->Button(-text=>'View',
-font=>$deffont,%butcol,
-command=>sub{ &viewslc($docselect,$tpbframe);},
-width=>6)->pack(-side=>'top');
if (! $IsWin32) {
$tlwins{$opt}{'buttons'}[$n_buttons++]=
$tpbframe->Button(-text=>'Print',
-font=>$deffont,%butcol,
-command=>sub{ &prtslc($docselect,$tpbframe);},
-width=>6)->pack(-side=>'top');
}
if (! $IsWin32) {
$tlwins{$opt}{'buttons'}[$n_buttons++]=
$tpbframe->Button(-text=>'Save',
-font=>$deffont,%butcol,
-command=>sub{ &savfslc($docselect,$tpbframe);},
-width=>6)->pack(-side=>'top');
}
$tlwins{$opt}{'buttons'}[$n_buttons++]=
$tpbframe->Button(-text=>'Cancel',
-font=>$deffont,%butcol,
-command=>sub{ destroy $tpwin; undef $tlwins{$opt};},
-width=>6)->pack(-side=>'bottom');
# if only 1 item is in the list (most likely in search results), select it
if (scalar @lbitems == 1) {
$tplist->selectionSet(0);
$dspselect=$lbitems[0];
$docselect=$lbdocs[0];
&viewslc($docselect,$tpbframe)
if ($autoview && $wtitle =~ /^Search results/);
}
# display frame
my $dsplabel=$tpdsp->Label(-text=>'Selection:',
-font=>$deffont)->pack(-anchor=>'w',,
-fill=>'x',
-side=>'left');
my $dspslc=$tpdsp->Label(-textvariable=>\$dspselect,
-font=>$deffont,
-borderwidth=>2)->pack(-anchor=>'w',
-fill=>'x',
-side=>'right');
# handle selection; only one selection possible
$tplist->bind(''=>sub{my ($slctind)=$tplist->curselection();
$dspselect=$lbitems[$slctind];
$docselect=$lbdocs[$slctind];});
# key bindings
$tplist->bind(''=>sub{
&viewslc($docselect,$tpbframe);});
$tpwin->bind(''=>sub{
&viewslc($docselect,$tpbframe);});
$tpwin->bind(''=>sub{
&prtslc($docselect,$tpbframe);});
$tpwin->bind(''=>sub{
&savfslc($docselect,$tpbframe);});
$tpwin->bind(''=>sub{destroy $tpwin; undef $tlwins{$opt};});
$tplist->bind(''=>sub{
if ($docselect) {
&showpath($docselect,$tpbframe);
} else {
&popmsg(2,"No selection;\nuse left mouse button.",$tpbframe);
}});
}
# view document selected in listbox
sub viewslc {
my($slc,$parframe)=@_;
my $viewer;
my $itype=-1;
my $browser=0;
my $styflag=0;
unless (defined $slc) {
&popmsg(2,"No selection was made.",$parframe);
return;
}
$parframe->configure(-cursor=>'watch');
chomp $slc;
my @dummy=split('\.',$slc);
DOC_FORMAT: { # determine document type
($dummy[-1] =~ /dvi/) && do { $viewer=$dvi_viewer; last DOC_FORMAT; };
($dummy[-1] =~ /ps/) && do { $viewer=$ps_viewer; last DOC_FORMAT; };
($dummy[-1] =~ /pdf/) && do { $viewer=$pdf_viewer; last DOC_FORMAT; };
($dummy[-1] =~ /txt/ || $dummy[-1] =~ /faq$/) && do {
$viewer=($txt_viewer eq "TDK_OWN" ||
$txt_viewer =~ /xterm/) ?
$txt_viewer : "${CmdConsole} $txt_viewer";
last DOC_FORMAT;
};
($dummy[-1] =~ /README/i || $dummy[-2] =~ /\/README$/i) && do {
$viewer=($txt_viewer eq "TDK_OWN" ||
$txt_viewer =~ /xterm/) ?
$txt_viewer : "${CmdConsole} $txt_viewer";
last DOC_FORMAT;
};
($dummy[-1] =~ /htm/) && do {
$viewer=$html_viewer;
if ($html_viewer =~ /netscape/i) { # check if Netscape is open
my $lockfile="${HomeEnv}/.netscape/lock";
$browser=1 if (-e $lockfile || -l $lockfile);
} elsif ($html_viewer =~ /mozilla/i) { # check if Mozilla is open
my $mozcheck=
`mozilla -remote 'openFile($texmfmain/doc/index.html)'`;
$browser=1 unless ($?);
}
last DOC_FORMAT;
};
# some packages have no normal documentation but useful info in the .sty
($dummy[-1] =~ /sty$/) && do {
$viewer=($txt_viewer eq "TDK_OWN" ||
$txt_viewer =~ /xterm/) ?
$txt_viewer : "${CmdConsole} $txt_viewer";
$slc="../tex/$slc"; # .sty files are in ${tex,local}docpath/../tex/
$styflag=1;
last DOC_FORMAT;
};
$parframe->configure(-cursor=>$defcursor);
if ($xfmt_viewer != 1) {
&popmsg(2,"$dummy[-1]: not a known document format",$parframe);
return;
}
};
if ($viewer eq "") {
if ($xfmt_viewer == 1) {
&popmsg(-1,'Unknown format; assuming plain text.',$parframe);
$viewer=($txt_viewer eq "TDK_OWN" ||
$txt_viewer =~ /xterm/) ?
$txt_viewer : "${CmdConsole} $txt_viewer";
} else {
&popmsg(2,"$dummy[-1]: no viewer available/specified for this format",
$parframe);
$parframe->configure(-cursor=>$defcursor);
return;
}
}
# build complete path and start viewer if file exists
my $slcdoc;
$slcdoc=&finddoc($slcdoc,$slc,$parframe);
if ($slcdoc ne "") {
# change to doc directory in case there are pictures
my $docpath=substr($slcdoc,0,(rindex($slcdoc,'/',(length $slcdoc))));
chomp $slcdoc;
chdir ($docpath);
# try to get doc out of .sty file
if ($styflag) {
&popmsg(-1,'Trying to extract documentation out of .sty file;
might be cluttered with program comments.',
$parframe);
$slcdoc=&stripsty($slcdoc,substr($slc,7));
}
# for text files use built-in text viewer if set
if ($IsWin32) {
if ($viewer eq "TDK_OWN") {
&ShellExecute('open', $slcdoc);
$parframe->configure(-cursor=>$defcursor);
return;
}
else {
system("$viewer $slcdoc");
}
} else {
if ($viewer eq "TDK_OWN") {
&textview($slcdoc);
$parframe->configure(-cursor=>$defcursor);
return;
}
if ($quiet == 0) { # show messages
if ($browser == 0) { # normal viewers or new Netscape/Mozilla
system("$viewer $slcdoc &");
} else { # open doc in existing Netscape/Mozilla window
system("$viewer -remote 'openFile($slcdoc)' &");
&popmsg(-1,"Opening document in existing $viewer window.",
$parframe);
}
} else { # viewer messages written to /dev/null instead of terminal
if ($browser == 0) { # normal viewers or new Netscape/Mozilla
system("perl -we 'use strict; \
my \$dump=\"\"; \
open(NULL,\">/dev/null\"); \
open(VIEWQ,\"$viewer $slcdoc |\") or die; \
while (\$dump=) { print NULL \$dump; } \
close(VIEWQ); \
close(NULL);' &");
} else { # open doc in existing window (Netscape or Mozilla)
# not quiet; I didn't get an inline perl call like in
# the other branch working
system("$viewer -remote 'openFile($slcdoc)' &");
&popmsg(-1,"Opening document in existing $viewer window.",
$parframe);
}
}
}
}
$parframe->configure(-cursor=>$defcursor);
}
# Tk widget for text document
sub textview {
my($txtfile)=@_;
# see if toplevel window with this file is already there
if (Exists($tlwins{$txtfile}{'addr'})) {
$tlwins{$txtfile}{'addr'}->deiconify();
$tlwins{$txtfile}{'addr'}->raise();
return;
}
my $tfv_tk=$main->Toplevel(-title=>"Text file viewer");
$tfv_tk->resizable(0,1);
$tlwins{$txtfile}{'addr'}=$tfv_tk;
$tfv_tk->Label(-text=>"File: $txtfile",
-font=>$deffont,
-relief=>'ridge',
-borderwidth=>3)->pack(-side=>'top',
-fill=>'x',
-ipady=>10,
-anchor=>'s');
my $txtbody=$tfv_tk->Scrolled("Text",
-relief=>'flat',
-font=>$deffont,
-height=>20,
-width=>80,
-scrollbars=>"e")->pack(-side=>'top',
-fill=>'y',
-expand=>1);
open(TXTFILE,"$txtfile");
while () { $txtbody->insert('end',$_); }
close(TXTFILE);
$txtbody->configure(-state=>'disabled');
&mkscroll($txtbody);
$tlwins{$txtfile}{'buttons'}[0]=
$tfv_tk->Button(-text=>'Close',
-font=>$deffont,%butcol,
-command=>sub{ destroy $tfv_tk;
undef $tlwins{$txtfile};
})->pack(-side=>'bottom',
-fill=>'x');
$tfv_tk->bind(''=>sub{destroy $tfv_tk;
undef $tlwins{$txtfile};
});
}
# print document selected in listbox
sub prtslc {
my($slc,$parframe)=@_;
$tmpfno=&randname;
my $pstmpfile="${TempDir}/texdoc_$tmpfno.ps";
push @tmpfiles,$pstmpfile;
my $status;
chomp $slc;
unless (defined $slc) {
&popmsg(2,"No selection was made.",$parframe);
return;
}
if ($print_cmd eq "") {
&popmsg(2,"No printer specified.",$parframe);
return;
}
# build complete path and check existence of file
my @dummy=split('\.',$slc);
if ($dummy[-1] =~ /sty$/) {
$slc="../tex/$slc"; # .sty files are in ${tex,local,home}docpath/../tex
}
my $slcdoc;
$slcdoc=&finddoc($slcdoc,$slc,$parframe);
return if ($slcdoc eq "");
# change to doc directory in case there are pictures
my $docpath=substr($slcdoc,0,(rindex($slcdoc,'/',(length $slcdoc))));
chdir ($docpath);
DOC_FORMAT: { # determine document type
# convert dvi files to ps before printing
($dummy[-1] =~ /dvi/) && do {
if ($dvips_conv eq "") {
&popmsg(2,"No converter available for dvi->ps conversion.",
$parframe);
return;
}
&popmsg(-1,"Converting dvi to ps for printing and sending file to print...",$parframe);
$status=system("$dvips_conv $slcdoc -o $pstmpfile");
if ($status != 0) {
&popmsg(2,"Error: Conversion dvi->ps failed!",$parframe);
}
last DOC_FORMAT;
};
# PostScript is printed directly
($dummy[-1] =~ /ps/) && do {
&popmsg(-1,"Sending file to $print_cmd...",$parframe);
$pstmpfile=$slcdoc;
last DOC_FORMAT;
};
# convert pdf files to ps before printing
($dummy[-1] =~ /pdf/) && do {
if ($pdfps_conv eq "") {
&popmsg(2,"No converter available for pdf->ps conversion.",
$parframe);
return;
}
&popmsg(-1,"Converting pdf to ps for printing and sending file to print...",$parframe);
system("$pdfps_conv $slcdoc $pstmpfile");
last DOC_FORMAT;
};
# convert html files to ps before printing
($dummy[-1] =~ /htm/) && do {
if ($htmlps_conv eq "") {
&popmsg(2,"No converter available for html->ps conversion.",
$parframe);
return;
}
&popmsg(-1,"Converting html to ps for printing and sending file to print...",$parframe);
my $htmlps_redir_sign=($htmlps_redir == 1) ? ">" :"";
system("$htmlps_conv $slcdoc $htmlps_redir_sign $pstmpfile");
last DOC_FORMAT;
};
# convert txt or extracted comments from sty files to ps before printing
($dummy[-1] =~ /txt/ || $dummy[-1] =~ /faq$/
|| $dummy[-1] =~ /README/i || $dummy[-1] =~ /sty$/) && do {
if ($txtps_conv eq "") {
&popmsg(2,"No converter available for txt->ps conversion.",
$parframe);
return;
}
&popmsg(-1,"Converting txt to ps for printing and sending file to print...",$parframe);
if ($dummy[-1] =~ /sty$/) { # try to get doc out of .sty file
&popmsg(-1,'Trying to extract documentation out of .sty file;
might be cluttered with program comments.',$parframe);
$slcdoc=&stripsty($slcdoc,substr($slc,7));
}
my $txtps_redir_sign;
TXTPS: {
($txtps_redir == 1) && do {
$txtps_redir_sign=">";
last TXTPS;
};
($txtps_conv =~ /(a2ps|enscript)/) && do {
$txtps_redir_sign="-o";
last TXTPS;
};
$txtps_redir_sign="";
};
system("$txtps_conv $slcdoc $txtps_redir_sign $pstmpfile");
last DOC_FORMAT;
};
&popmsg(2,"$dummy[-1]: cannot print document format",$parframe);
return;
};
system("$print_cmd $pstmpfile");
}
# save document selected in listbox to a PostScript file
sub savfslc {
use File::Copy qw/cp mv/;
my($slc,$parframe)=@_;
$tmpfno=&randname;
my $pstmpfile="${TempDir}/texdoc_$tmpfno.ps";
push @tmpfiles,$pstmpfile;
my $status;
chomp $slc;
unless (defined $slc) {
&popmsg(2,"No selection was made.",$parframe);
return;
}
# build complete path and check existence of file
my @dummy=split('\.',$slc);
if ($dummy[-1] =~ /sty$/) {
$slc="../tex/$slc"; # .sty files are in ${tex,local,home}docpath/../tex
}
my $slcdoc;
$slcdoc=&finddoc($slcdoc,$slc,$parframe);
return if ($slcdoc eq "");
# change to doc directory in case there are pictures
my $docpath=substr($slcdoc,0,(rindex($slcdoc,'/',(length $slcdoc))));
chdir ($docpath);
DOC_FORMAT: { # determine document type
# convert dvi files to ps before saving
($dummy[-1] =~ /dvi/) && do {
if ($dvips_conv eq "") {
&popmsg(2,"No converter available for dvi->ps conversion.",
$parframe);
return;
}
&popmsg(-1,"Converting dvi to ps...",$parframe);
$status=system("$dvips_conv $slcdoc -o $pstmpfile");
if ($status != 0) {
&popmsg(2,"Error: Conversion dvi->ps failed!",$parframe);
}
last DOC_FORMAT;
};
# PostScript is saved directly
($dummy[-1] =~ /ps/) && do {
$pstmpfile=$slcdoc;
last DOC_FORMAT;
};
# convert pdf files to ps before saving
($dummy[-1] =~ /pdf/) && do {
if ($pdfps_conv eq "") {
&popmsg(2,"No converter available for pdf->ps conversion.",
$parframe);
return;
}
&popmsg(-1,"Converting pdf to ps...",$parframe);
system("$pdfps_conv $slcdoc $pstmpfile");
last DOC_FORMAT;
};
# convert html files to ps before saving
($dummy[-1] =~ /htm/) && do {
if ($htmlps_conv eq "") {
&popmsg(2,"No converter available for html->ps conversion.",
$parframe);
return;
}
&popmsg(-1,"Converting html to ps...",$parframe);
my $htmlps_redir_sign=($htmlps_redir == 1) ? ">" :"";
system("$htmlps_conv $slcdoc $htmlps_redir_sign $pstmpfile");
last DOC_FORMAT;
};
# convert txt or extracted comments from sty files to ps before saving
($dummy[-1] =~ /txt/ || $dummy[-1] =~ /faq$/
|| $dummy[-1] =~ /README/i || $dummy[-1] =~ /sty$/) && do {
if ($txtps_conv eq "") {
&popmsg(2,"No converter available for txt->ps conversion.",
$parframe);
return;
}
&popmsg(-1,"Converting txt to ps...",$parframe);
if ($dummy[-1] =~ /sty$/) { # try to get doc out of .sty file
&popmsg(-1,'Trying to extract documentation out of .sty file;
might be cluttered with program comments.',
$parframe);
$slcdoc=&stripsty($slcdoc,substr($slc,7));
}
my $txtps_redir_sign;
TXTPS: {
($txtps_redir == 1) && do {
$txtps_redir_sign=">";
last TXTPS;
};
($txtps_conv =~ /(a2ps|enscript)/) && do {
$txtps_redir_sign="-o";
last TXTPS;
};
$txtps_redir_sign="";
};
system("$txtps_conv $slcdoc $txtps_redir_sign $pstmpfile");
last DOC_FORMAT;
};
&popmsg(2,"$dummy[-1]: cannot process document format",$parframe);
return;
};
# create default name and then window
my $pssavefile=join("","$ENV{HOME}/",basename($slcdoc,""),".ps");
my $pssavwin=$parframe->Toplevel(-title=>"Save to PS");
$pssavwin->Label(-text=>"Save to PostScript file",
-font=>$deffont)->pack(-side=>'top',-fill=>'x');
my $pssavefr=$pssavwin->Frame()->pack(-side=>'top');
$pssavefr->Label(-text=>"Filename: ",
-font=>$deffont)->pack(-side=>'left');
$pssavefr->Entry(-textvariable=>\$pssavefile,
-font=>$deffont)->pack(-side=>'left');
my $pssavbfr=$pssavwin->Frame()->pack(-side=>'bottom');
$tlwins{$pssavwin}{'buttons'}[1]=
$pssavbfr->Button(-text=>'OK',
-font=>$deffont,%butcol,
-command=>sub{ if (-e $pssavefile) {
&popdlg("$pssavefile exists; overwrite?",$pssavwin,
"cp(\"$pstmpfile\",\"$pssavefile\")");
} else {
cp $pstmpfile,$pssavefile;;
destroy $pssavwin;
undef $tlwins{$pssavwin};
}},
-width=>6)->pack(-side=>'left',
-padx=>10,
-pady=>10);
$tlwins{$pssavwin}{'buttons'}[2]=
$pssavbfr->Button(-text=>'Cancel',
-font=>$deffont,%butcol,
-command=>sub{destroy $pssavwin;
undef $tlwins{$pssavwin};
})->pack(-side=>'left',
-padx=>10);
$pssavwin->bind(''=>sub{destroy $pssavwin;
undef $tlwins{$pssavwin};});
}
# test existence and search a documentation which is not in specified place
sub finddoc {
my($slcdoc,$slc,$parframe)=@_;
my ($dummy,$status);
SLCDOCFIND: foreach ($texdocpath,$distdocpath,$docdocpath) {
$slcdoc="$_/$slc";
if (-e $slcdoc) {
# found where it should be
return $slcdoc;
} else {
# see if the documentation file is in the local doc tree...
my @srchslcdoc=($slcdoc);
if ($localdocpath) {
push @srchslcdoc,"$localdocpath/$slc";
return $srchslcdoc[-1] if (-e $srchslcdoc[-1]);
}
# ... or the user's doc tree...
if ($homedocpath) {
push @srchslcdoc,"$homedocpath/$slc";
return $srchslcdoc[-1] if (-e $srchslcdoc[-1]);
}
# ... otherwise proceed with searching
$status=-1;
# see if the documentation file is compressed
CMPREND: foreach my $cmprtype ("gz","bz2","zip") {
foreach (@srchslcdoc) {
$dummy="$_.$cmprtype";
if (-e $dummy) { # yes, it is compressed
$tmpfno=&randname;
my $rawname=basename($slc,"");
$slcdoc="${TempDir}/texdoc_$tmpfno$rawname";
push @tmpfiles,$slcdoc;
my ($dcmp,$dcmp_opt);
COMPRESS: { # determine compression type
($cmprtype eq "gz") && do {
$dcmp="gzip";
$dcmp_opt="-cd";
last COMPRESS;
};
($cmprtype eq "bz2") && do {
$dcmp="bzip2";
$dcmp_opt="-cd";
last COMPRESS;
};
($cmprtype eq "zip") && do {
$dcmp="zip";
$dcmp_opt="-p";
last COMPRESS;
};
};
# try to decompress
$status=system("$dcmp $dcmp_opt $dummy > $slcdoc");
if ($status != 0) { # failure
&popmsg(2,
"$dcmp: Couldn't decompress file, cancelling.",
$parframe);
$slcdoc="";
return $slcdoc;
}
last CMPREND;
}
}
}
}
}
if ($status != 0) {
$parframe->configure(-cursor=>'watch');
# try to find it elsewhere with kpsewhich
my $rawname=basename($slc,"");
$slcdoc=($slcdoc =~ /\.sty$/) ?
`kpsewhich $rawname` :
`kpsewhich --format=${qq}TeX system documentation${qq} $rawname`;
if ($slcdoc eq "") { # nothing found; cancel
&popmsg(2,"$rawname not found, cancelling.",$parframe);
$slcdoc="";
}
$parframe->configure(-cursor=>$defcursor);
}
return $slcdoc;
}
# determine existence and show paths of files (Button-3)
sub showpath {
my ($docselect,$tpbframe)=@_;
my $found=0;
if ($docselect =~ /\.sty$/) {
STYPATH: foreach my $fullpath ("$texmfmain/tex/$docselect",
"$texmfdist/tex/$docselect",
"$texmflocal/tex/$docselect",
"$texmfhome/tex/$docselect") {
if (-e $fullpath) {
&popmsg(0,"Selected file:\n$fullpath",$tpbframe);
$found=1;
last STYPATH;
}
}
if (!$found) {
&popmsg(2,"Selected file:\n$docselect\ndoes not exist.",$tpbframe) }
} else {
DOCPATH: foreach my $fullpath ("$texdocpath/$docselect",
"$distdocpath/$docselect",
"$docdocpath/$docselect",
"$localdocpath/$docselect",
"$homedocpath/$docselect") {
foreach ('','.gz','.bz2','.zip') {
my $fullpathext="$fullpath$_";
if (-e $fullpathext) {
&popmsg(0,"Selected file:\n$fullpathext",$tpbframe);
$found=1;
last DOCPATH;
}
}
}
if (!$found) {
&popmsg(2,"Selected file:\n$docselect\ndoes not exist (neither in normal form nor compressed).",$tpbframe) }
}
}
# make or destroy search entry widget
sub mksrch {
if ($srchflag == 1) {
destroy $srchentry;
$srchflag=0;
} else {
# get the search string
$srchentry=$cmdframe->Entry(-cursor=>'xterm',
-font=>$deffont,
-width=>20,
-takefocus=>1)->pack(-side=>'left');
$srchentry->focus();
$srchentry->bind(''=>[\&srchstr, $srchentry]);
$srchflag=1;
# key binding
$srchentry->bind(''=>sub{destroy $srchentry; $srchflag=0;});
}
}
# search a string in @packname, @topic and @keywords
sub srchstr {
my ($i,$j,$string);
my (@results,@reslist);
$main->configure(-cursor=>'watch');
$string=$srchentry->get();
# search
if ($string) {
for ($i=0; $i<$ncat; ++$i) {
for ($j=0; $j<$maxind[$i]+1; ++$j) {
SRCH: {
($topic[$i][$j] =~ /$string/i) && do {
push @results,($i,$j);
last SRCH;
};
(defined $keywords[$i][$j]) && do {
if ($keywords[$i][$j] =~ /$string/i) {
push @results,($i,$j);
last SRCH;
}
};
($packname[$i][$j] =~ /$string/i) && do {
push @results,($i,$j);
last SRCH;
};
};
}
}
} else { # return full database
$string='all database entries';
for ($i=0; $i<$ncat; ++$i) {
for ($j=0; $j<$maxind[$i]+1; ++$j) { push @results,($i,$j); }
}
}
# destroy entry widget and show results
destroy $srchentry;
$srchflag=0;
if (scalar @results == 0) {
&popmsg(0,"Search for $string: no matches found.",$cmdframe);
} else {
# cancel multiple entries
my ($omit,$pack1,$pack2);
@reslist=($results[0],$results[1]);
for ($i=0; $i<$#results; $i+=2) {
$omit=0;
$pack1=$packname[$results[$i]][$results[$i+1]];
for ($j=0; $j<$#reslist; $j+=2) {
$pack2=$packname[$reslist[$j]][$reslist[$j+1]];
if ($pack1 eq $pack2) { $omit=1; last; }
}
if ($omit == 0) { push @reslist,($results[$i],$results[$i+1]); }
}
unshift @reslist,$string;
&tpslct(-1,@reslist);
}
$main->configure(-cursor=>$defcursor);
}
# extract documentation of .sty files; a flag in the @keywords array shows
# where the doc is located:
# -0-: no specific place; -1-: at end, behind \endinput; -2-: at beginning,
# terminated by %%%%%%; -3-: at beginning, terminated with blank line
sub stripsty {
my ($slcdoc,$slc)=@_;
my @stydoc;
$tmpfno=&randname;
my $tmpslcdoc="${TempDir}/texdoc_$tmpfno.txt";
push @tmpfiles,$tmpslcdoc;
open (STY,"$slcdoc");
LOC: {
($stydoc{$slc} == 0) && do { # no specific place, suck in everything :-(
while ($line = ) { push @stydoc,$line if ($line =~ /^%/); }
last LOC;
};
($stydoc{$slc} == 1) && do { # at end, behind \endinput
while ($line = ) {
last if ($line =~ /^\s*\\endinput/ && !($line =~ /^%/));
}
while ($line = ) { push @stydoc,$line; }
last LOC;
};
($stydoc{$slc} == 2) && do { # up to a certain %%%%%%%, hopefully the 1st
for (my $i=0; $i<9; ++$i) { $stydoc[$i]=; } # after the 8th line
while ($line = ) {
last if ($line =~ /^%{4,}/);
push @stydoc,$line;
}
last LOC;
};
($stydoc{$slc} == 3) && do { # up to 1st blank/apparently empty line
while ($line = ) {
last if ($line =~ /^\s*$/);
push @stydoc,$line;
}
last LOC;
};
};
close(STY);
open(TMPSTY,">$tmpslcdoc");
foreach (@stydoc) { print TMPSTY $_; }
close(TMPSTY);
return $tmpslcdoc;
}
# pop up a note or an error or warning message toplevel window
sub popmsg {
my($level,$msg,$parframe)=@_;
my $degree;
LEVEL: {
($level == -1) && do { $degree="Info"; last LEVEL; };
($level == 0) && do { $degree="Note"; last LEVEL; };
($level == 1) && do {
return if ($quiet == 1);
$degree="Warning";
last LEVEL
};
($level == 2) && do { $degree="Error"; last LEVEL; };
};
my $msgwin=$parframe->Toplevel(-title=>$degree);
my $lbl=$msgwin->Label(-text=>uc($degree),
-font=>$deffont)->pack(-side=>'top', -fill=>'x');
# get size of message text
my @dummy=split("\n",$msg);
my $nline=scalar @dummy;
my $msgwidth=0;
my $lline;
foreach (@dummy) {
$lline=length $_;
if ($lline > $msgwidth) { $msgwidth=$lline; }
}
my $message=$msgwin->Text(-relief=>'flat',
-font=>$deffont,
-height=>$nline,
-width=>$msgwidth)->pack(-side=>'top');
$message->insert('end',$msg);
$message->configure(-state=>'disabled');
LEVBUT: {
($level < 0) && do { # transient message window
$msgwin->after(3000,sub{destroy $msgwin});
last LEVBUT;
};
($level >= 0 && $level < 3) && do { # persistent message window
$msgwin->Button(-text=>'Close',
-font=>$deffont,%butcol,
-command=>sub{destroy $msgwin})->pack(-side=>'bottom',
-fill=>'x');
$msgwin->bind(''=>sub{destroy $msgwin});
last LEVBUT;
};
};
}
# pop up a dialog toplevel window
sub popdlg {
my($msg,$parframe,$action)=@_;
my $dlgwin=$parframe->Toplevel(-title=>"Dialog");
# get size of message text
my @dummy=split("\n",$msg);
my $nline=scalar @dummy;
my $msgwidth=0;
my $lline;
foreach (@dummy) {
$lline=length $_;
if ($lline > $msgwidth) { $msgwidth=$lline; }
}
my $message=$dlgwin->Text(-relief=>'flat',
-font=>$deffont,
-height=>$nline,
-width=>$msgwidth)->pack(-side=>'top');
$message->insert('end',$msg);
$message->configure(-state=>'disabled');
my $dlganswer=-1;
my $dlgwinfr=$dlgwin->Frame(-relief=>'flat')->pack(-side=>'bottom',
-fill=>'x');
$dlgwinfr->Button(-text=>'Yes',
-font=>$deffont,%butcol,
-command=>sub{eval $action;
destroy $dlgwin;
destroy $parframe;
undef $tlwins{$parframe};
})->pack(-side=>'left');
$dlgwinfr->Button(-text=>'No',
-font=>$deffont,%butcol,
-command=>sub{ destroy $dlgwin })->pack(-side=>'right');
}
# show/change settings (don't show this to an expert :-/ )
sub settings {
my ($homedocpath_tmp,$quiet_tmp,$autoview_tmp,$xfmt_viewer_tmp,
$dvi_viewer_tmp,$dvips_conv_tmp,
$ps_viewer_tmp,$pdf_viewer_tmp,$pdfps_conv_tmp,
$html_viewer_tmp,$htmlps_conv_tmp,$htmlps_redir_tmp,
$txt_viewer_tmp,$txtps_conv_tmp,$txtps_redir_tmp,$print_cmd_tmp)=
($homedocpath,$quiet,$autoview,$xfmt_viewer,
$dvi_viewer,$dvips_conv,$ps_viewer,
$pdf_viewer,$pdfps_conv,$html_viewer,
$htmlps_conv,$htmlps_redir,$txt_viewer,
$txtps_conv,$txtps_redir,$print_cmd);
my @tdcolors_tmp=@tdcolors;
# see if toplevel window is already there
if (Exists($tlwins{"setmenu"}{'addr'})) {
$tlwins{"setmenu"}{'addr'}->deiconify();
$tlwins{"setmenu"}{'addr'}->raise();
return;
}
my $setmenu=$main->Toplevel(-title=>'Settings');
$setmenu->resizable(0,0);
$tlwins{"setmenu"}{'addr'}=$setmenu;
# documentation path
my $datlabel;
$datlabel="Database file(s) used: teTeX";
$datlabel.=", local database" if (-e $locdatabase);
$datlabel.=", user database" if (-e $homedatabase);
my $docframe=$setmenu->Frame(-relief=>'groove',
-borderwidth=>2)->pack(-side=>'top',
-fill=>'x',
-expand=>1);
my $docframestring="\nDistribution documentation root path(s):\n$texdocpath";
$docframestring.=", $distdocpath" if (-e $distdocpath);
$docframestring.=", $docdocpath" if (length $docdocpath);
if ($localdocpath && $localdocpath ne $texdocpath) {
$docframestring.="\nLocal documentation root path: $localdocpath\n";
}
$docframe->Label(-text=>"$docframestring",
-font=>$deffont)->pack(-side=>'top',
-anchor=>'w',
-fill=>'x',
-expand=>1);
if (defined $texmfhome && -d $texmfhome) {
$homedocpath_tmp=basename($homedocpath_tmp,"");
my $usrdocframe=$docframe->Frame(-relief=>'flat')->pack(-side=>'top',
-fill=>'x');
my $usrdoclabel=$usrdocframe->Label(-text=>"User's documentation root path: $texmfhome/",
-font=>$deffont)->pack(-side=>'left');
my $usrdocentry=$usrdocframe->Entry(-textvariable=>\$homedocpath_tmp,
-font=>$deffont)->pack(-side=>'left');
}
$docframe->Label(-text=>"$datlabel.",
-font=>$deffont)->pack(-side=>'top',
-anchor=>'w',
-ipady=>2,
-fill=>'x',
-expand=>1);
# General viewer behaviour
my $genvframe=$setmenu->Frame(-label=>'General viewer behaviour',
-relief=>'groove',
-borderwidth=>2)->pack(-side=>'top',
-fill=>'x',
-ipady=>6,
-expand=>1);
my $genvframe1=$genvframe->Frame()->pack(-side=>'left');
my $genvsub1=$genvframe1->Frame()->pack(-side=>'top',
-anchor=>'w',
-ipady=>3);
my $genvecbut=$genvsub1->
Checkbutton(-variable=>\$quiet_tmp)->pack(-side=>'left',
-anchor=>'sw');
my $genvelabel=$genvsub1->Label(-text=>'Suppress error messages',
-font=>$deffont)->pack(-side=>'left',
-anchor=>'sw');
my $genvsub2=$genvframe1->Frame()->pack(-side=>'top',
-anchor=>'w');
my $genvscbut=$genvsub2->
Checkbutton(-variable=>\$autoview_tmp)->pack(-side=>'left',
-anchor=>'sw');
my $genvslabel=$genvsub2->Label(-text=>'Autostart viewer for one-item listboxes',
-font=>$deffont)->pack(-side=>'left',
-anchor=>'sw');
my $genvsub3=$genvframe1->Frame()->pack(-side=>'top',
-anchor=>'w');
my $genvxcbut=$genvsub3->
Checkbutton(-variable=>\$xfmt_viewer_tmp)->pack(-side=>'left',
-anchor=>'sw');
my $genvxlabel=$genvsub3->Label(-text=>'Use text viewer for unknown file format',
-font=>$deffont)->pack(-side=>'left',
-anchor=>'sw');
# colours of GUI
my @tdcolors_d=@tdcolors_tmp;
$tlwins{'setmenu'}{'buttons'}[0]=
$genvframe->Button(-text=>'Change viewer colours',
-command=>sub {
@tdcolors_tmp=&popcolor($setmenu,@tdcolors_tmp);
@tdcolors_d=@tdcolors_tmp;
},
-font=>$deffont,%butcol)->pack(-side=>'right');
# DVI
my $dviframe=$setmenu->Frame(-label=>'DVI',
-relief=>'groove',
-borderwidth=>2)->pack(-side=>'top',
-fill=>'x',
-ipady=>6,
-expand=>1);
my $dvisub1=$dviframe->Frame()->pack(-side=>'top',
-anchor=>'w');
my $dvisub2=$dviframe->Frame()->pack(-side=>'top',
-anchor=>'w',
-ipady=>6);
my $dvivlabel=$dvisub1->Label(-text=>'Viewer command',
-anchor=>'w',
-font=>$deffont)->pack(-side=>'left');
my $dviventry=$dvisub1->Entry(-textvariable=>\$dvi_viewer_tmp,
-font=>$deffont)->pack(-side=>'left');
my $dviclabel=$dvisub2->Label(-text=>'DVI->PS converter command',
-anchor=>'w',
-font=>$deffont)->pack(-side=>'left',
-anchor=>'sw');
my $dvilbwidth=length 'DVI->PS converter command';
$dvivlabel->configure(-width=>1.1*$dvilbwidth);
$dviclabel->configure(-width=>1.1*$dvilbwidth);
my $dvicentry=$dvisub2->Entry(-textvariable=>\$dvips_conv_tmp,
-font=>$deffont)->pack(-side=>'left',
-anchor=>'sw');
# PostScript
my $psframe=$setmenu->Frame(-label=>'PostScript',
-relief=>'groove',
-borderwidth=>2)->pack(-side=>'top',
-fill=>'x',
-ipady=>10,
-expand=>1);
my $psvlabel=$psframe->Label(-text=>'Viewer command',
-font=>$deffont)->pack(-side=>'left',
-anchor=>'w');
my $psventry=$psframe->Entry(-textvariable=>\$ps_viewer_tmp,
-font=>$deffont)->pack(-side=>'left');
# PDF
my $pdfframe=$setmenu->Frame(-label=>'PDF',
-relief=>'groove',
-borderwidth=>2)->pack(-side=>'top',
-fill=>'x',
-ipady=>6,
-expand=>1);
my $pdfsub1=$pdfframe->Frame()->pack(-side=>'top',
-anchor=>'w');
my $pdfsub2=$pdfframe->Frame()->pack(-side=>'top',
-anchor=>'w',
-ipady=>6);
my $pdfvlabel=$pdfsub1->Label(-text=>'Viewer command',
-font=>$deffont)->pack(-side=>'left',
-anchor=>'w');
my $pdfventry=$pdfsub1->Entry(-textvariable=>\$pdf_viewer_tmp,
-font=>$deffont)->pack(-side=>'left');
my $pdfclabel=$pdfsub2->Label(-text=>'PDF->PS converter command',
-font=>$deffont)->pack(-side=>'left',
-anchor=>'sw');
my $pdfcentry=$pdfsub2->Entry(-textvariable=>\$pdfps_conv_tmp,
-font=>$deffont)->pack(-side=>'left',
-anchor=>'sw');
# HTML
my $htmlframe=$setmenu->Frame(-label=>'HTML',
-relief=>'groove',
-borderwidth=>2)->pack(-side=>'top',
-fill=>'x',
-ipady=>6,
-expand=>1);
my $htmlsub1=$htmlframe->Frame()->pack(-side=>'top',
-anchor=>'w');
my $htmlsub2=$htmlframe->Frame()->pack(-side=>'top',
-anchor=>'w',
-ipady=>6);
my $htmlvlabel=$htmlsub1->Label(-text=>'Viewer command',
-font=>$deffont)->pack(-side=>'left',
-anchor=>'w');
my $htmlventry=$htmlsub1->Entry(-textvariable=>\$html_viewer_tmp,
-font=>$deffont)->pack(-side=>'left');
my $htmlclabel=$htmlsub2->Label(-text=>'HTML->PS converter command',
-font=>$deffont)->pack(-side=>'left',
-anchor=>'sw');
my $htmlcentry=$htmlsub2->Entry(-textvariable=>\$htmlps_conv_tmp,
-font=>$deffont)->pack(-side=>'left',
-anchor=>'sw');
my $htmlrlabel=$htmlsub2->Label(-text=>'Output redirect needed',
-font=>$deffont)->pack(-side=>'left',
-anchor=>'sw');
my $htmlrcbut=$htmlsub2->
Checkbutton(-variable=>\$htmlps_redir_tmp)->pack(-side=>'left',
-anchor=>'sw');
# plain text
my $txtframe=$setmenu->Frame(-label=>'Plain text',
-relief=>'groove',
-borderwidth=>2)->pack(-side=>'top',
-fill=>'x',
-ipady=>6,
-expand=>1);
my $txtsub1=$txtframe->Frame()->pack(-side=>'top',
-anchor=>'w');
my $txtsub2=$txtframe->Frame()->pack(-side=>'top',
-anchor=>'w',
-ipady=>6);
my $txtvlabel=$txtsub1->Label(-text=>'Viewer command',
-font=>$deffont)->pack(-side=>'left',
-anchor=>'w');
my $txtventry=$txtsub1->Entry(-textvariable=>\$txt_viewer_tmp,
-font=>$deffont)->pack(-side=>'left');
my $txt_view_flag;
if ($txt_viewer_tmp eq "TDK_OWN") {
$txt_view_flag=1;
$txtventry->configure(-state=>'disabled');
} else {
$txt_view_flag=0;
$txtventry->configure(-state=>'normal');
}
my $txtvilabel=$txtsub1->Label(-text=>"\tUse texdoctk\'s own viewer",
-font=>$deffont)->pack(-side=>'left',
-anchor=>'sw');
my $txtvcbut=$txtsub1->
Checkbutton(-variable=>\$txt_view_flag,
-command=>sub {
if ($txt_view_flag == 1) {
$txt_viewer_tmp="TDK_OWN";
$txtventry->configure(-state=>'disabled');
} else {
$txt_viewer_tmp=$txt_viewer;
$txtventry->configure(-state=>'normal');
$txtventry->focus();
}
})->pack(-side=>'left',
-anchor=>'sw');
my $txtclabel=$txtsub2->Label(-text=>'Text->PS converter command',
-font=>$deffont)->pack(-side=>'left',
-anchor=>'sw');
my $txtcentry=$txtsub2->Entry(-textvariable=>\$txtps_conv_tmp,
-font=>$deffont)->pack(-side=>'left',
-anchor=>'sw');
my $txtrlabel=$txtsub2->Label(-text=>'Output redirect needed',
-font=>$deffont)->pack(-side=>'left',
-anchor=>'sw');
my $txtrcbut=$txtsub2->
Checkbutton(-variable=>\$txtps_redir_tmp)->pack(-side=>'left',
-anchor=>'sw');
# printer
my $prtframe=$setmenu->Frame(-label=>'Printer',
-relief=>'groove',
-borderwidth=>2)->pack(-side=>'top',
-fill=>'x',
-ipady=>10,
-expand=>1);
my $prtclabel=$prtframe->Label(-text=>'Command',
-font=>$deffont)->pack(-side=>'left',
-anchor=>'w');
my $prtcentry=$prtframe->Entry(-textvariable=>\$print_cmd_tmp,
-font=>$deffont)->pack(-side=>'left');
# buttons and key bindings
my $setbfr=$setmenu->Frame()->pack(-side=>'bottom');
$tlwins{'setmenu'}{'buttons'}[1]=
$setbfr->Button(-text=>'OK',
-font=>$deffont,%butcol,
-command=>sub{
$homedocpath="$texmfhome/$homedocpath_tmp";
&whichbin($setmenu,$dvi_viewer_tmp,$dvips_conv_tmp,
$ps_viewer_tmp,$pdf_viewer_tmp,
$pdfps_conv_tmp,$html_viewer_tmp,
$htmlps_conv_tmp,$txt_viewer_tmp,
$txtps_conv_tmp,$print_cmd_tmp);
($quiet,$autoview,$xfmt_viewer,
$dvi_viewer,$dvips_conv,
$ps_viewer,$pdf_viewer,
$pdfps_conv,$html_viewer,
$htmlps_conv,$htmlps_redir,
$txt_viewer,$txtps_conv,$txtps_redir,$print_cmd)=
($quiet_tmp,$autoview_tmp,$xfmt_viewer_tmp,
$dvi_viewer_tmp,$dvips_conv_tmp,
$ps_viewer_tmp,
$pdf_viewer_tmp,$pdfps_conv_tmp,
$html_viewer_tmp,
$htmlps_conv_tmp,$htmlps_redir_tmp,
$txt_viewer_tmp,$txtps_conv_tmp,
$txtps_redir_tmp,$print_cmd_tmp);
@tdcolors=@tdcolors_tmp;
%butcol=('-background'=>$tdcolors[0],
'-foreground'=>$tdcolors[1],
'-activebackground'=>$tdcolors[2],
'-activeforeground'=>$tdcolors[3]);
foreach my $tlkey (keys %tlwins) {
foreach (@{$tlwins{$tlkey}{'buttons'}}) {
$_->configure(%butcol);
}
}
if ($txt_viewer eq "" &&
defined $ENV{PAGER}) {
$txt_viewer=$ENV{PAGER};
}
destroy $setmenu;
undef $tlwins{"setmenu"}},
-width=>6)->pack(-side=>'left',
-padx=>10,
-pady=>10);
$tlwins{'setmenu'}{'buttons'}[2]=
$setbfr->Button(-text=>'Save',
-font=>$deffont,%butcol,
-command=>sub{
$setmenu->configure(-cursor=>'watch');
&whichbin($setmenu,$dvi_viewer_tmp,$dvips_conv_tmp,
$ps_viewer_tmp,$pdf_viewer_tmp,
$pdfps_conv_tmp,$html_viewer_tmp,
$htmlps_conv_tmp,$txt_viewer_tmp,
$txtps_conv_tmp,$print_cmd_tmp);
&popmsg(-1,"Writing settings to $myrc",$setmenu);
my $tdcolors_tmp=join(' ',@tdcolors_tmp);
&writerc($homedocpath_tmp,
$quiet_tmp,$autoview_tmp,$xfmt_viewer_tmp,
$tdcolors_tmp,
$dvi_viewer_tmp,$dvips_conv_tmp,
$ps_viewer_tmp,
$pdf_viewer_tmp,$pdfps_conv_tmp,
$html_viewer_tmp,
$htmlps_conv_tmp,$htmlps_redir_tmp,
$txt_viewer_tmp,$txtps_conv_tmp,
$txtps_redir_tmp,$print_cmd_tmp,$setmenu);
$setmenu->configure(-cursor=>$defcursor);
})->pack(-side=>'left',
-padx=>10);
$tlwins{'setmenu'}{'buttons'}[3]=
$setbfr->Button(-text=>'Cancel',
-font=>$deffont,%butcol,
-command=>sub{destroy $setmenu;
undef $tlwins{"setmenu"};
})->pack(-side=>'left',
-padx=>10);
$setmenu->bind(''=>sub{destroy $setmenu;
undef $tlwins{"setmenu"};});
}
# check presence of selected viewer/converter/printing commands
sub whichbin {
my ($parframe,@progs)=@_;
my @absent;
foreach (@progs) {
next if ($_ eq "" || $_ eq "TDK_OWN");
my ($prog,$dummy)=split(" ",$_);
`which $prog 2>&1`;
push @absent,$prog if ($? > 0);
}
if (scalar @absent > 0) {
my $absent=(scalar @absent == 1) ? $absent[0] : join(', ',@absent);
&popmsg(2,"The following programs seem not to be in your \$PATH:\n$absent",
$parframe);
}
}
# dialog toplevel for color settings
sub popcolor {
my ($parframe,@entryvar)=@_;
# see if toplevel window is already there
if (Exists($tlwins{'chngcol'}{'addr'})) {
$tlwins{'chngcol'}{'addr'}->deiconify();
$tlwins{'chngcol'}{'addr'}->raise();
return;
}
my $dlgwin=$parframe->Toplevel(-title=>'Change colours');
$dlgwin->resizable(0,0);
$tlwins{'chngcol'}{'addr'}=$dlgwin;
# entry widgets for default/active back/foreground
$dlgwin->Label(-text=>'Enter colours as names or RGB #xxxxxx values',
-font=>$deffont)->pack(-side=>'top');
my $dlgdef=$dlgwin->Frame()->pack(-side=>'top');
my $dlgact=$dlgwin->Frame()->pack(-side=>'top');
my $dlgdef1=$dlgdef->Frame()->pack(-side=>'left');
my $dlgtfr0=$dlgdef1->Frame()->pack(-side=>'top');
my $dlgtfr1=$dlgdef1->Frame()->pack(-side=>'top');
my $dlgact1=$dlgact->Frame()->pack(-side=>'left');
my $dlgtfr2=$dlgact1->Frame()->pack(-side=>'top');
my $dlgtfr3=$dlgact1->Frame()->pack(-side=>'top');
$dlgtfr0->Label(-text=>"Default background",
-anchor=>'w',
-width=>18,
-font=>$deffont)->pack(-side=>'left');
$dlgtfr0->Entry(-textvariable=>\$entryvar[0],
-font=>$deffont)->pack(-side=>'left');
$dlgtfr1->Label(-text=>"Default foreground",
-anchor=>'w',
-width=>18,
-font=>$deffont)->pack(-side=>'left');
$dlgtfr1->Entry(-textvariable=>\$entryvar[1],
-font=>$deffont)->pack(-side=>'left');
my $deflabel=$dlgdef->Label(-text=>'Default',
-relief=>'ridge',
-width=>10,
-height=>2)->pack(-side=>'right',
-padx=>7);
$dlgtfr2->Label(-text=>"Active background",
-anchor=>'w',
-width=>18,
-font=>$deffont)->pack(-side=>'left');
$dlgtfr2->Entry(-textvariable=>\$entryvar[2],
-font=>$deffont)->pack(-side=>'left');
$dlgtfr3->Label(-text=>"Active foreground",
-anchor=>'w',
-width=>18,
-font=>$deffont)->pack(-side=>'left');
$dlgtfr3->Entry(-textvariable=>\$entryvar[3],
-font=>$deffont)->pack(-side=>'left');
my $actlabel=$dlgact->Label(-text=>'Active',
-background=>$entryvar[2],
-foreground=>$entryvar[3],
-relief=>'ridge',
-width=>10,
-height=>2)->pack(-side=>'right',
-padx=>7);
# buttons
my $setbfr=$dlgwin->Frame()->pack(-side=>'bottom');
my $chngflag=0;
$tlwins{'chngcol'}{'buttons'}[0]=
$setbfr->Button(-text=>'OK',
-font=>$deffont,%butcol,
-command=>sub {
foreach (@entryvar) { # RGB form with leading #
$_="#$_" if (/^[A-Fa-f0-9]{6}$/);
}
$chngflag=1 if (&colcheck($dlgwin,@entryvar));
},
-width=>6)->pack(-side=>'left',
-padx=>5,
-pady=>10);
$tlwins{'chngcol'}{'buttons'}[1]=
$setbfr->Button(-text=>'Preview',
-font=>$deffont,%butcol,
-command=>sub {
foreach (@entryvar) { # RGB form with leading #
$_="#$_" if (/^[A-Fa-f0-9]{6}$/);
}
if (&colcheck($dlgwin,@entryvar)) {
$deflabel->
configure(-background=>$entryvar[0],
-foreground=>$entryvar[1]);
$actlabel->
configure(-background=>$entryvar[2],
-foreground=>$entryvar[3]);
}
},
-width=>6)->pack(-side=>'left',
-padx=>5,
-pady=>10);
$tlwins{'chngcol'}{'buttons'}[2]=
$setbfr->Button(-text=>'Cancel',
-font=>$deffont,%butcol,
-command=>sub{destroy $dlgwin;
undef $tlwins{'chngcol'};
})->pack(-side=>'right',
-padx=>5,
-pady=>10);
$dlgwin->bind(''=>sub{destroy $dlgwin;
undef $tlwins{'chngcol'}; });
$dlgwin->waitVariable(\$chngflag);
destroy $dlgwin;
undef $tlwins{'chngcol'};
return @entryvar;
}
# check colours set in popcolor; relies on the existence of X11's showrgb
sub colcheck {
my ($dlgwin,@entryvar)=@_;
my $ecnt=0;
foreach (@entryvar) { # all colours defined?
last unless ($_);
++$ecnt;
}
&popmsg(2,'Some colours undefined.',$dlgwin) if ($ecnt != 4);
my $defcol=0;
if (`which showrgb`) { # test for proper name
my @rgb=`showrgb`;
my @norgb;
foreach my $colour (@entryvar) {
if ($colour =~ /^#[A-Fa-f0-9]{6}$/ || grep /\b$colour\b/i,@rgb) {
++$defcol;
} else {
push @norgb,$colour;
}
}
if ($defcol != 4) {
my $norgb=join("\n",@norgb);
&popmsg(2,"Some colours invalid:\n$norgb",$dlgwin);
}
} else { $defcol=4; }
return ($ecnt == 4 && $defcol == 4) ? 1 : 0;
}
# write user's ~/.texdocrc
sub writerc {
use File::Copy qw/cp mv/;
my ($homedocpath_tmp,$quiet_tmp,$autoview_tmp,$xfmt_viewer_tmp,
$tdcolors_tmp,
$dvi_viewer_tmp,$dvips_conv_tmp,
$ps_viewer_tmp,
$pdf_viewer_tmp,$pdfps_conv_tmp,
$html_viewer_tmp,
$htmlps_conv_tmp,$htmlps_redir_tmp,
$txt_viewer_tmp,$txtps_conv_tmp,
$txtps_redir_tmp,$print_cmd_tmp,$parframe)=@_;
my $err=0;
mv $myrc,"$myrc.save" if (-e $myrc);
open(MYRC,">$myrc");
print MYRC "# user's .texdocrc, generated by program\n
# root of user's doc directory (from \$HOMETEXMF)
# can be left empty if \$TEXMFHOME is undefined
HOMEDOCPATH=$homedocpath_tmp
# general viewer behaviour (y or yes to make active)
QUIET=$quiet_tmp
AUTOVIEW=$autoview_tmp
XFMT_VIEWER=$xfmt_viewer_tmp
# button colours: default and active back-/foreground
# names and RGB values are both allowed; use the form #xxxxxx for RGB
TDCOLORS=$tdcolors_tmp
# the following variables contain whole commands, i.e. options can be given
# DVI settings
DVI_VIEWER=$dvi_viewer_tmp
DVIPS_CONV=$dvips_conv_tmp
# PostScript handling
PS_VIEWER=$ps_viewer_tmp
# PDF handling
PDF_VIEWER=$pdf_viewer_tmp
PDFPS_CONV=$pdfps_conv_tmp
# HTML handling
HTML_VIEWER=$html_viewer_tmp
HTMLPS_CONV=$htmlps_conv_tmp
# HTMLPS_REDIR must be on, if the html->ps converter normally writes its output
# to stdout instead of a file (e.g. as html2ps) (y or yes to make active)
HTMLPS_REDIR=$htmlps_redir_tmp
# Plain text handling
# TDK_OWN is texdoctk's own text file viewer
TXT_VIEWER=$txt_viewer_tmp
TXTPS_CONV=$txtps_conv_tmp
# TXTPS_REDIR must be on, if the txt->ps converter normally writes its output
# to stdout instead of a file (y or yes to make active)
TXTPS_REDIR=$txtps_redir_tmp
# printer
PRINT_CMD=$print_cmd_tmp
\n# end of config\n";
close(MYRC);
}
# help window (toplevel)
sub helptext {
# see if toplevel window is already there
if (Exists($tlwins{"helptext"}{'addr'})) {
$tlwins{"helptext"}{'addr'}->deiconify();
$tlwins{"helptext"}{'addr'}->raise();
return;
}
my $help=$main->Toplevel(-title=>'Help/About');
$help->resizable(0,1);
$tlwins{'helptext'}{'addr'}=$help;
$help->Label(-text=>"texdoctk
TeX documentation browser
v.0.6.3 (Sep 21, 2005)",
-font=>$deffont)->pack(-side=>'top',
-ipady=>10,
-anchor=>'s');
my $helpbody=$help->Scrolled("Text",
-relief=>'flat',
-font=>$deffont,
-height=>20,
-width=>60,
-scrollbars=>"e")->pack(-side=>'top',
-fill=>'y',
-expand=>1);
my $pos=tell DATA;
while () {
$_ =~ s/\$sysrc/$sysrc/;
last if (/^#/);
$helpbody->insert('end',$_);
}
seek(DATA,$pos,0);
$helpbody->configure(-state=>'disabled');
&mkscroll($helpbody);
$tlwins{'helptext'}{'buttons'}[0]=
$help->Button(-text=>'Close',
-font=>$deffont,%butcol,
-command=>sub{destroy $help;
undef $tlwins{"helptext"};
})->pack(-side=>'bottom',
-fill=>'x');
$help->bind(''=>sub{destroy $help; undef $tlwins{"helptext"};});
}
# read config file; personal settings override the default settings
sub readrc {
my($rcfile,$icall)=@_;
my ($var,$val);
my $pathflag=0;
my $pathflagl=0;
my $pathflagh=0;
my $tdcolors='';
# for backward compatibility of converter/printer options
my ($dvips_opts,$pdfps_opts,$print_opts);
# read defaults resp. local/personal settings
CALL: {
($icall == 1) && do {
open (RC,"$rcfile") ||
&fatalmsg("Couldn't open system-wide default config file ${TeXDocRcDefaults}.\n");
last CALL;
};
($icall == 2) && do {
open (RC,"$rcfile") ||
&fatalmsg("Couldn't open personal config file ~/.texdocrc.\n");
last CALL;
};
};
while ($line = ) {
next if ($line =~ /^($|#)/);
chomp $line;
($var,$val)=split("=",$line,2);
RCVARS: {
($var =~ /texdocpath/i) && do { # TEXDOCPATH
if (length $val > 0) {
$pathflag=1;
eval(join("",("\$",lc($var),"=\$val")));
}
last RCVARS;
};
($var =~ /localdocpath/i) && do { # LOCALDOCPATH
if (length $val > 0) {
$pathflagl=1;
eval(join("",("\$",lc($var),"=\$val")));
}
last RCVARS;
};
($var =~ /homedocpath/i) && do { # HOMEDOCPATH
if ($icall == 2 && length $val > 0) { # set only in ~/.texdocrc
$pathflagh=1;
eval(join("",("\$",lc($var),"=\$val")));
}
last RCVARS;
};
# other variables
eval(join("",("\$",lc($var),"=\$val")));
};
}
close(RC);
# find texmf/doc, and possibly other distribution texmf trees
if ($rcfile eq $sysrc || $pathflag == 1) {
$texmfmain=`kpsewhich --expand-path=${qq}\$TEXMFMAIN${qq}`;
chomp $texmfmain;
$texdocpath="$texmfmain/$texdocpath";
$texmfdist=`kpsewhich --expand-path=${qq}\$TEXMFDIST${qq}`;
chomp $texmfdist;
$distdocpath=join('/',"$texmfdist",basename($texdocpath,""))
if (length $texmfdist);
# TeXLive has this texmf-doc
$texmfdoc=join('/',"$texmfmain-doc",basename($texdocpath,""));
if (-e $texmfdoc) {
chomp $texmfdoc;
$docdocpath="$texmfdoc/$docdocpath";
}
}
# find texmf-local/doc, if there is one
if ($rcfile eq $sysrc || $pathflagl == 1) {
$texmflocal=`kpsewhich --expand-path=${qq}\$TEXMFLOCAL${qq}`;
chomp $texmflocal;
if (length $texmflocal) {
# if LOCALDOCPATH is not explicitly defined, it equals TEXDOCPATH
unless (defined $localdocpath) {
$localdocpath=basename($texdocpath,"");
}
$localdocpath="$texmflocal/$localdocpath";
}
}
# find user's $HOMETEXMF/doc, if there is one
if ($icall == 2 || $pathflagh == 1) {
$texmfhome=`kpsewhich --expand-path=${qq}\$HOMETEXMF${qq}`;
chomp $texmfhome;
if (length $texmfhome) {
# if HOMEDOCPATH is not explicitly defined, it equals TEXDOCPATH
unless (defined $homedocpath) {
$homedocpath=basename($texdocpath,"");
}
$homedocpath="$texmfhome/$homedocpath";
}
}
# colours: create array
@tdcolors=split(' ',$tdcolors);
if (scalar @tdcolors != 4) { # if old texdocrc file is used
if (!(-e $myrc) || (-e $myrc && $icall == 2)) {
print "NOTE: Button colours not set in $rcfile; using defaults.\n";
@tdcolors=('#d9d9d9','Black','#ececec','red');
}
}
%butcol=('-background'=>$tdcolors[0],
'-foreground'=>$tdcolors[1],
'-activebackground'=>$tdcolors[2],
'-activeforeground'=>$tdcolors[3]);
# viewer: suppress viewer warnings/use $PAGER if no $txt_viewer is defined
$quiet=($quiet =~ /y/i || $quiet eq "1") ? 1 : 0;
if (!(defined $txt_viewer) && defined $ENV{PAGER}) {
$txt_viewer=$ENV{PAGER};
}
# viewer: autostart viewer if listbox of search results contains only 1 item
$autoview=($autoview =~ /y/i || $autoview eq "1") ? 1 : 0;
# viewer: use text viewer to open files with unrecognized format
$xfmt_viewer=($xfmt_viewer =~ /y/i || $xfmt_viewer eq "1") ? 1 : 0;
# converter: output redirection flags for HTML/Text->PS converters
$htmlps_redir=($htmlps_redir =~ /(y|1)/i) ? 1 : 0;
$txtps_redir=($txtps_redir =~ /(y|1)/i) ? 1 : 0;
# for backward compatibility of converter/printer options
$dvips_conv.=" $dvips_opts" if ($dvips_opts);
$pdfps_conv.=" $pdfps_opts" if ($pdfps_opts);
$print_cmd.=" $print_opts" if ($print_opts);
}
# determine resolution if xwininfo is available
# slightly modified from a patch contributed by Reinhard Kotucha
sub x_resolution {
my $x_res;
if ($IsWin32) {
$x_res = &GetScreenWidth;
}
else {
open(XINF,"xwininfo -root|") or return 1200;
while () {
chop;
if (/Width:/) { ($x_res=$_)=/Width:\s+(\d+)/; last; }
}
close(XINF);
}
return $x_res;
}
# make Scrolled widgets scrollable with mouse wheel and PgUp/PgDown
sub mkscroll {
my ($wdgname)=@_;
# mouse wheel
$wdgname->bind("<4>",
sub{ $wdgname->yview('scroll',
$wdgname->cget(-height)*-0.5,'units')});
$wdgname->bind("<5>",
sub{ $wdgname->yview('scroll',
$wdgname->cget(-height)*0.5,'units')});
return;
}
# generate a random name for temporary files
sub randname {
my $namestr;
my @chars=("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z");
my $time=time;
my $maxcnt=3+substr($time,-1);
for (my $i=0; $i<=$maxcnt; $i++) { $namestr.=$chars[rand(51)] }
my @tmp=split(/./,$time/$$);
$namestr.=$tmp[1];
until (length($namestr) > 16) { $namestr.=int(rand(1000000)) }
return $namestr;
}
# find index of an array entry
sub arrindex {
my @array=@_;
my $item=pop @array;
my $i=0;
foreach (@array) {
last if ($_ eq $item);
++$i;
}
return $i;
}
# clean up and exit
sub clean_exit {
foreach (@tmpfiles) { if (-e $_) { unlink $_; } }
exit;
}
# alternative main window, launched for fatal error messages on startup
sub fatalmsg {
my($msg)=@_;
print STDERR $msg; # also print to stderr
# create frame for main window
my $main=new MainWindow;
$main->resizable(0,0);
$main->title("TeX Documentation Browser");
$main->bind(''=>sub { exit });
$main->bind(''=>sub { exit });
my $msgframe=$main->Frame(-background=>"#ffcc99");
my $cmdframe=$main->Frame;
$msgframe->pack(-side=>'top');
$cmdframe->pack(-side=>'bottom',-fill=>'x');
# make buttons for command frame
my $Qbut=$cmdframe->Button(-text=>'Kill',%butcol,
-command=>sub { exit })->pack(-fill=>'x');
# define common default font for labels and text explicitly
my @deffont=$Qbut->configure(-font);
# ensure readability on high-res screens (suggested by R.Kotucha)
$deffont='Helvetica -16 bold' if &x_resolution > 1200;
$Qbut->configure(-font=>$deffont);
$msgframe->Label(-text=>'FATAL ERROR',
-font=>$deffont)->pack(-side=>'top', -fill=>'x');
# get size of message text
my @dummy=split("\n",$msg);
my $nline=scalar @dummy;
my $msgwidth=0;
my $lline;
foreach (@dummy) {
$lline=length $_;
if ($lline > $msgwidth) { $msgwidth=$lline; }
}
my $message=$msgframe->Text(-relief=>'flat',
-font=>$deffont,
-height=>$nline,
-width=>$msgwidth)->pack(-side=>'top');
$message->insert('end',$msg);
$message->configure(-state=>'disabled');
MainLoop;
}
if ($IsWin32) {
sub GetScreenWidth {
my $GetDeviceCaps = new Win32::API('gdi32', 'GetDeviceCaps', 'NN', 'N');
my $HORZRES = 8; # from WinGDI.h
if(not defined $GetDeviceCaps) {
die "Can't import API GetDeviceCaps: $!\n";
}
return $GetDeviceCaps->Call(0, $HORZRES);
}
sub GetTempPath {
my $GetTempPath = new Win32::API('kernel32', 'GetTempPath', 'NP', 'N');
if(not defined $GetTempPath) {
die "Can't import API GetTempPath: $!\n";
}
my $lpBuffer = " " x 260;
$GetTempPath->Call(80, $lpBuffer);
}
sub ShellExecute {
my ($command, $file) = @_;
my $ShellExecute = new Win32::API('shell32', 'ShellExecute', 'NPPPPN', 'N');
if(not defined $ShellExecute) {
die "Can't import API ShellExecute: $!\n";
}
$ShellExecute->Call(0, $command, $file, '', '', 0);
}
sub GetHomeDir {
my $home = $ENV{'HOME'};
# Should check for CSIDL_...
return $home;
}
}
__END__
Many TeX programmers provide more or less detailed manuals for
their programs or packages. They are usually available as .dvi,
ps, .pdf, .html or plain text files (sometimes included in the
sty files instead of a separate documentation file) and can be
accessed with this browser, which is simply an interface to find a
documentation more easily. It starts the respective viewer for
reading the selected documentation making use of a database file
which contains the path entries according to the current teTeX
texmf/doc structure; additional usage of a system-wide local and
of individual user texmf trees with corresponding databases is also
possible.
The documentations are grouped in several categories shown in the
main window; pressing one of its buttons lists all documentations
belonging to this topic.
The topic window lets you select one documentation file to view or
send it to the default printer; instead of printing it, you can
also save it into a PostScript file. By right-clicking on the
selected item you get the complete path of the file.
The search button of the main window allows you to search the
database for a string; it does not search file names. Enter the
string and hit to start the search or to
cancel. Just hitting without typing something in will
show the full list of files in the database.
Defaults for the documentation root directory, the viewers, the
converters, certain options and the printer are set in the global
configuration file $sysrc.
However, each user can put a copy of it as .texdocrc into his home
directory to modify them according to his needs; modification or
generation of ~/.texdocrc can also be done with the Settings menu.
Additionally, the settings can be changed temporarily with this
menu.
The following key shortcuts are defined for use with the browser:
Quit browser
Raise the Main window to the foreground
Search a keyword in database (case insensitive)
Cancel/close subwindow or search entry widget
View selected document (topic windows)
Print selected document (topic windows)
Save selected document as .ps file (topic windows)
Open settings menu
Kill fatal error message window (same as
)
Open this help
Equivalent to button press;
OK in selection menu and search
Next/previous widget
There are the following command line options:
-a autostart viewer if a listbox of search results
contains only one item; can also be set in a
configuration file
-v disable suppression of viewer messages sent to
stderr (if possible) and of certain permanent
message popup windows, in case this was not set
in a configuration file; default: off
Some more information is available in the manpage of texdoctk.
Comments and suggestions to:
Thomas Ruedas
tr@geol.ku.dk
# Local Variables:
# mode: perl
# auto-fill-hook: do-auto-fill
# End:
--Boundary-00=_z6DPD7j1Tq4XbzR--
Information forwarded to debian-bugs-dist@lists.debian.org, teTeX maintainers <debian-tetex-maint@lists.debian.org>:
Bug#105830; Package tetex-bin.
debian-bugs-dist@lists.debian.orgteTeX maintainers
X-Loop: owner@bugs.debian.org
Subject: Bug#105830: Please provide a method for packages to register themselves to texdoctk
Reply-To: Frank =?UTF-8?Q?K=C3=BCster?= , 105830@bugs.debian.org
Resent-From: Frank =?UTF-8?Q?K=C3=BCster?=
Resent-To: debian-bugs-dist@lists.debian.org
Resent-CC: teTeX maintainers
Resent-Date: Fri, 30 Sep 2005 14:48:17 UTC
Resent-Message-ID:
Resent-Sender: owner@bugs.debian.org
X-Debian-PR-Message: report 105830
X-Debian-PR-Package: tetex-bin
X-Debian-PR-Keywords:
Received: via spool by 105830-submit@bugs.debian.org id=B105830.112808890014958
(code B ref 105830); Fri, 30 Sep 2005 14:48:17 UTC
Received: (at 105830) by bugs.debian.org; 30 Sep 2005 14:01:40 +0000
Received: from idmailgate1.unizh.ch [130.60.127.100]
by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
id 1ELLSG-0003sI-00; Fri, 30 Sep 2005 07:01:40 -0700
Received: from localhost.localdomain ([130.60.169.223])
by idmailgate1.unizh.ch (8.13.1/8.13.1/SuSE Linux 0.7) with ESMTP id j8UE1Xgd031948;
Fri, 30 Sep 2005 16:01:33 +0200
Received: from localhost
([127.0.0.1] helo=localhost.localdomain ident=frank)
by localhost.localdomain with esmtp (Exim 4.50)
id 1ELLS9-0001EX-4t; Fri, 30 Sep 2005 16:01:33 +0200
To: Thomas Ruedas
Cc: 105830@bugs.debian.org, Thomas Esser
X-Attribution: fant
X-Ehrenamt: http://www.langau.de
In-Reply-To: <200509292121.23518.tr@geol.ku.dk> (Thomas Ruedas's message of
"Thu, 29 Sep 2005 21:21:23 +0200")
References: <200107190341.f6J3fD96018231@beth.swift.xxx>
<87br3jgyu0.fsf@alhambra.kuesterei.ch>
<200509292121.23518.tr@geol.ku.dk>
From: Frank =?UTF-8?Q?K=C3=BCster?=
Date: Fri, 30 Sep 2005 16:01:32 +0200
Message-ID: <87ek76mz7n.fsf@alhambra.kuesterei.ch>
User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-Virus-Scanned: by amavisd-new
Delivered-To: 105830@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level:
X-Spam-Status: No, hits=-3.0 required=4.0 tests=BAYES_00 autolearn=no
version=2.60-bugs.debian.org_2005_01_02
Thomas Ruedas wrote:
> I have implemented such a feature as suggested for the local and home=20
> texmf trees and send you a version of texdoctk to try it out, if you=20
> want. Comments are welcome.
Great, that looks very good.
> I have informed Thomas Esser about that to learn if he has any concerns,=
=20
> but didn't get a reply for about 14 days now, so I assume it's ok with=20
> him. Nonetheless I do think that this self-identification mechanism=20
> should be reserved for the site's local and the users' individual texmf=20
> trees, so that there is a standard database in the shipped teTeX=20
> distribution which cannot be affected.
Hm, things are a little different when teTeX is installed from a package
of a Linux distribution: TEXMFLOCAL is still for the local admin - so
other TeX packages from the distribution cannot put things there. But
they can, on the other hand, put things into /usr/share/texmf
(TEXMFDIST, if you like), since the package management system has no
problem with files from different packages coexisting (as opposed to the
user who updates teTeX by removing TEXMFDIST and untarring the new
tar.gz).=20
Therefore, besides TEXMFLOCAL and the users' texmf trees, I'd like to
have the possibility to include information that other packages=B9 have
dropped into /usr/share/texmf/texdoctk/, or into $TEXMFCONFIG/texdoctk
if you prefer that.=20=20
I can implement this as a Debian-specific patch, but generally I prefer
to deviate as little from upstream as possible. Therefore I'd be glad
if you would enhance it this way. I'm Ccing Thomas Esser so that he can
comment.=20
Many thanks for this improvement,
Frank
=B9here, packages means more "a Debian package" than "a LaTeX package": it
has been adapted to put its file there, whereas an ordinary LaTeX
package would instruct the user to put it into TEXMFLOCAl/texdoctk or
their home tree.
--=20
Frank K=FCster
Inst. f. Biochemie der Univ. Z=FCrich
Debian Developer
Acknowledgement sent to Frank Küster <frank@kuesterei.ch>:
Extra info received and forwarded to list. Copy sent to teTeX maintainers <debian-tetex-maint@lists.debian.org>.
-t
X-Loop: owner@bugs.debian.org
From: owner@bugs.debian.org (Debian Bug Tracking System)
To: Frank =?UTF-8?Q?K=C3=BCster?=
Subject: Bug#105830: Info received (was Please provide a method for packages to register themselves to texdoctk)
Message-ID:
In-Reply-To: <87ek76mz7n.fsf@alhambra.kuesterei.ch>
References: <87ek76mz7n.fsf@alhambra.kuesterei.ch>
Precedence: bulk
X-Debian-PR-Message: ack-info 105830
X-Debian-PR-Package: tetex-bin
X-Debian-PR-Keywords:
Thank you for the additional information you have supplied regarding
this problem report. It has been forwarded to the package maintainer(s)
and to other interested parties to accompany the original report.
Your message has been sent to the package maintainer(s):
teTeX maintainers
If you wish to continue to submit further information on your problem,
please send it to 105830@bugs.debian.org, as before.
Please do not reply to the address at the top of this message,
unless you wish to report a problem with the Bug-tracking system.
Debian bug tracking system administrator
(administrator, Debian Bugs database)
Received: (at 105830) by bugs.debian.org; 30 Sep 2005 14:01:40 +0000
From frank@kuesterei.ch Fri Sep 30 07:01:40 2005
Return-path:
Received: from idmailgate1.unizh.ch [130.60.127.100]
by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
id 1ELLSG-0003sI-00; Fri, 30 Sep 2005 07:01:40 -0700
Received: from localhost.localdomain ([130.60.169.223])
by idmailgate1.unizh.ch (8.13.1/8.13.1/SuSE Linux 0.7) with ESMTP id j8UE1Xgd031948;
Fri, 30 Sep 2005 16:01:33 +0200
Received: from localhost
([127.0.0.1] helo=localhost.localdomain ident=frank)
by localhost.localdomain with esmtp (Exim 4.50)
id 1ELLS9-0001EX-4t; Fri, 30 Sep 2005 16:01:33 +0200
To: Thomas Ruedas
Cc: 105830@bugs.debian.org, Thomas Esser
Subject: Re: Please provide a method for packages to register themselves to
texdoctk
X-Attribution: fant
X-Ehrenamt: http://www.langau.de
In-Reply-To: <200509292121.23518.tr@geol.ku.dk> (Thomas Ruedas's message of
"Thu, 29 Sep 2005 21:21:23 +0200")
References: <200107190341.f6J3fD96018231@beth.swift.xxx>
<87br3jgyu0.fsf@alhambra.kuesterei.ch>
<200509292121.23518.tr@geol.ku.dk>
From: =?iso-8859-1?q?Frank_K=FCster?=
Date: Fri, 30 Sep 2005 16:01:32 +0200
Message-ID: <87ek76mz7n.fsf@alhambra.kuesterei.ch>
User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-Virus-Scanned: by amavisd-new
Delivered-To: 105830@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level:
X-Spam-Status: No, hits=-3.0 required=4.0 tests=BAYES_00 autolearn=no
version=2.60-bugs.debian.org_2005_01_02
Thomas Ruedas wrote:
> I have implemented such a feature as suggested for the local and home=20
> texmf trees and send you a version of texdoctk to try it out, if you=20
> want. Comments are welcome.
Great, that looks very good.
> I have informed Thomas Esser about that to learn if he has any concerns,=
=20
> but didn't get a reply for about 14 days now, so I assume it's ok with=20
> him. Nonetheless I do think that this self-identification mechanism=20
> should be reserved for the site's local and the users' individual texmf=20
> trees, so that there is a standard database in the shipped teTeX=20
> distribution which cannot be affected.
Hm, things are a little different when teTeX is installed from a package
of a Linux distribution: TEXMFLOCAL is still for the local admin - so
other TeX packages from the distribution cannot put things there. But
they can, on the other hand, put things into /usr/share/texmf
(TEXMFDIST, if you like), since the package management system has no
problem with files from different packages coexisting (as opposed to the
user who updates teTeX by removing TEXMFDIST and untarring the new
tar.gz).=20
Therefore, besides TEXMFLOCAL and the users' texmf trees, I'd like to
have the possibility to include information that other packages=B9 have
dropped into /usr/share/texmf/texdoctk/, or into $TEXMFCONFIG/texdoctk
if you prefer that.=20=20
I can implement this as a Debian-specific patch, but generally I prefer
to deviate as little from upstream as possible. Therefore I'd be glad
if you would enhance it this way. I'm Ccing Thomas Esser so that he can
comment.=20
Many thanks for this improvement,
Frank
=B9here, packages means more "a Debian package" than "a LaTeX package": it
has been adapted to put its file there, whereas an ordinary LaTeX
package would instruct the user to put it into TEXMFLOCAl/texdoctk or
their home tree.
--=20
Frank K=FCster
Inst. f. Biochemie der Univ. Z=FCrich
Debian Developer
Information forwarded to debian-bugs-dist@lists.debian.org, teTeX maintainers <debian-tetex-maint@lists.debian.org>:
Bug#105830; Package tetex-bin.
debian-bugs-dist@lists.debian.orgteTeX maintainers
X-Loop: owner@bugs.debian.org
Subject: Bug#105830: Please provide a method for packages to register themselves to texdoctk
Reply-To: Thomas Esser , 105830@bugs.debian.org
Resent-From: Thomas Esser
Resent-To: debian-bugs-dist@lists.debian.org
Resent-CC: teTeX maintainers
Resent-Date: Sun, 16 Oct 2005 15:18:10 UTC
Resent-Message-ID:
Resent-Sender: owner@bugs.debian.org
X-Debian-PR-Message: report 105830
X-Debian-PR-Package: tetex-bin
X-Debian-PR-Keywords:
Received: via spool by 105830-submit@bugs.debian.org id=B105830.112947545431317
(code B ref 105830); Sun, 16 Oct 2005 15:18:10 UTC
Received: (at 105830) by bugs.debian.org; 16 Oct 2005 15:10:54 +0000
Received: from leo.dbs.uni-hannover.de [130.75.26.7] (root)
by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
id 1ERAA2-00088Q-00; Sun, 16 Oct 2005 08:10:54 -0700
Received: from gauss.site (dslb-082-083-194-208.pools.arcor-ip.net [82.83.194.208])
(authenticated bits=0)
by leo.dbs.uni-hannover.de (8.12.10/8.12.10) with ESMTP id j9GFApBn006408
(version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO);
Sun, 16 Oct 2005 17:10:51 +0200
Received: by gauss.site (Postfix, from userid 1340)
id E8EE5212C3; Sun, 16 Oct 2005 17:10:45 +0200 (CEST)
Date: Sun, 16 Oct 2005 17:10:45 +0200
From: Thomas Esser
To: Frank =?UTF-8?Q?K=C3=BCster?=
Cc: Thomas Ruedas , 105830@bugs.debian.org
Message-ID: <20051016151045.GA11105@dbs.uni-hannover.de>
References: <200107190341.f6J3fD96018231@beth.swift.xxx> <87br3jgyu0.fsf@alhambra.kuesterei.ch> <200509292121.23518.tr@geol.ku.dk> <87ek76mz7n.fsf@alhambra.kuesterei.ch>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
In-Reply-To: <87ek76mz7n.fsf@alhambra.kuesterei.ch>
User-Agent: Mutt/1.5.9i
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by leo.dbs.uni-hannover.de id j9GFApBn006408
Delivered-To: 105830@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level:
X-Spam-Status: No, hits=-3.0 required=4.0 tests=BAYES_00 autolearn=no
version=2.60-bugs.debian.org_2005_01_02
Hi Frank+Thomas,
> Therefore, besides TEXMFLOCAL and the users' texmf trees, I'd like to
> have the possibility to include information that other packages=B9 have
> dropped into /usr/share/texmf/texdoctk/, or into $TEXMFCONFIG/texdoctk
> if you prefer that. =20
I don't think that maintaining large texmf trees plus their support
structure (texdoctk database / updmap.cfg / fmtutil.cnf / ...) has a
good future. It creates a lot of work and package based approaches have
a lot of advantages. Therefore, I would welcome everything which makes
packages more self contained and independend from a larger "registry".
I have no idea how much work it would be to drop all other
predefined database names and to load just all texdoctk-*.dat files
in $TEXMF/texdoctk. That would support an "all in one" database
(texdoctk-tetex.dat) until someone has splitted the whole texmf tree
into smaller "packages".
I am very sorry that I have not replied to this "Please provide a method
..." thread before (and even more: not really looked at texdoctk v.0.6.2).
Thomas
Acknowledgement sent to Thomas Esser <te@dbs.uni-hannover.de>:
Extra info received and forwarded to list. Copy sent to teTeX maintainers <debian-tetex-maint@lists.debian.org>.
-t
X-Loop: owner@bugs.debian.org
From: owner@bugs.debian.org (Debian Bug Tracking System)
To: Thomas Esser
Subject: Bug#105830: Info received (was Please provide a method for packages to register themselves to texdoctk)
Message-ID:
In-Reply-To: <20051016151045.GA11105@dbs.uni-hannover.de>
References: <20051016151045.GA11105@dbs.uni-hannover.de>
Precedence: bulk
X-Debian-PR-Message: ack-info 105830
X-Debian-PR-Package: tetex-bin
X-Debian-PR-Keywords:
Thank you for the additional information you have supplied regarding
this problem report. It has been forwarded to the package maintainer(s)
and to other interested parties to accompany the original report.
Your message has been sent to the package maintainer(s):
teTeX maintainers
If you wish to continue to submit further information on your problem,
please send it to 105830@bugs.debian.org, as before.
Please do not reply to the address at the top of this message,
unless you wish to report a problem with the Bug-tracking system.
Debian bug tracking system administrator
(administrator, Debian Bugs database)
Received: (at 105830) by bugs.debian.org; 16 Oct 2005 15:10:54 +0000
From te@dbs.uni-hannover.de Sun Oct 16 08:10:54 2005
Return-path:
Received: from leo.dbs.uni-hannover.de [130.75.26.7] (root)
by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
id 1ERAA2-00088Q-00; Sun, 16 Oct 2005 08:10:54 -0700
Received: from gauss.site (dslb-082-083-194-208.pools.arcor-ip.net [82.83.194.208])
(authenticated bits=0)
by leo.dbs.uni-hannover.de (8.12.10/8.12.10) with ESMTP id j9GFApBn006408
(version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO);
Sun, 16 Oct 2005 17:10:51 +0200
Received: by gauss.site (Postfix, from userid 1340)
id E8EE5212C3; Sun, 16 Oct 2005 17:10:45 +0200 (CEST)
Date: Sun, 16 Oct 2005 17:10:45 +0200
From: Thomas Esser
To: Frank =?iso-8859-1?Q?K=FCster?=
Cc: Thomas Ruedas , 105830@bugs.debian.org
Subject: Re: Please provide a method for packages to register themselves to texdoctk
Message-ID: <20051016151045.GA11105@dbs.uni-hannover.de>
References: <200107190341.f6J3fD96018231@beth.swift.xxx> <87br3jgyu0.fsf@alhambra.kuesterei.ch> <200509292121.23518.tr@geol.ku.dk> <87ek76mz7n.fsf@alhambra.kuesterei.ch>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
In-Reply-To: <87ek76mz7n.fsf@alhambra.kuesterei.ch>
User-Agent: Mutt/1.5.9i
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by leo.dbs.uni-hannover.de id j9GFApBn006408
Delivered-To: 105830@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level:
X-Spam-Status: No, hits=-3.0 required=4.0 tests=BAYES_00 autolearn=no
version=2.60-bugs.debian.org_2005_01_02
Hi Frank+Thomas,
> Therefore, besides TEXMFLOCAL and the users' texmf trees, I'd like to
> have the possibility to include information that other packages=B9 have
> dropped into /usr/share/texmf/texdoctk/, or into $TEXMFCONFIG/texdoctk
> if you prefer that. =20
I don't think that maintaining large texmf trees plus their support
structure (texdoctk database / updmap.cfg / fmtutil.cnf / ...) has a
good future. It creates a lot of work and package based approaches have
a lot of advantages. Therefore, I would welcome everything which makes
packages more self contained and independend from a larger "registry".
I have no idea how much work it would be to drop all other
predefined database names and to load just all texdoctk-*.dat files
in $TEXMF/texdoctk. That would support an "all in one" database
(texdoctk-tetex.dat) until someone has splitted the whole texmf tree
into smaller "packages".
I am very sorry that I have not replied to this "Please provide a method
..." thread before (and even more: not really looked at texdoctk v.0.6.2).
Thomas
Information forwarded to debian-bugs-dist@lists.debian.org, teTeX maintainers <debian-tetex-maint@lists.debian.org>:
Bug#105830; Package tetex-bin.
debian-bugs-dist@lists.debian.orgteTeX maintainers
X-Loop: owner@bugs.debian.org
Subject: Bug#105830: Please provide a method for packages to register themselves to texdoctk
Reply-To: Frank =?UTF-8?Q?K=C3=BCster?= , 105830@bugs.debian.org
Resent-From: Frank =?UTF-8?Q?K=C3=BCster?=
Resent-To: debian-bugs-dist@lists.debian.org
Resent-CC: teTeX maintainers
Resent-Date: Mon, 17 Oct 2005 13:18:06 UTC
Resent-Message-ID:
Resent-Sender: owner@bugs.debian.org
X-Debian-PR-Message: report 105830
X-Debian-PR-Package: tetex-bin
X-Debian-PR-Keywords:
Received: via spool by 105830-submit@bugs.debian.org id=B105830.112955455824850
(code B ref 105830); Mon, 17 Oct 2005 13:18:06 UTC
Received: (at 105830) by bugs.debian.org; 17 Oct 2005 13:09:18 +0000
Received: from idmailgate2.unizh.ch [130.60.127.101]
by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
id 1ERUjt-0006QU-00; Mon, 17 Oct 2005 06:09:18 -0700
Received: from localhost.localdomain ([130.60.169.166])
by idmailgate2.unizh.ch (8.13.1/8.13.1/SuSE Linux 0.7) with ESMTP id j9HD9F07000907;
Mon, 17 Oct 2005 15:09:15 +0200
Received: from localhost
([127.0.0.1] helo=localhost.localdomain ident=frank)
by localhost.localdomain with esmtp (Exim 4.50)
id 1ERUjr-0001bw-1N; Mon, 17 Oct 2005 15:09:15 +0200
To: Thomas Esser
Cc: 105830@bugs.debian.org
X-Attribution: fant
X-Ehrenamt: http://www.langau.de
In-Reply-To: <20051016151045.GA11105@dbs.uni-hannover.de> (Thomas Esser's
message of "Sun, 16 Oct 2005 17:10:45 +0200")
References: <200107190341.f6J3fD96018231@beth.swift.xxx>
<87br3jgyu0.fsf@alhambra.kuesterei.ch>
<200509292121.23518.tr@geol.ku.dk>
<87ek76mz7n.fsf@alhambra.kuesterei.ch>
<20051016151045.GA11105@dbs.uni-hannover.de>
From: Frank =?UTF-8?Q?K=C3=BCster?=
Date: Mon, 17 Oct 2005 15:09:14 +0200
Message-ID: <87fyr0p9xh.fsf@alhambra.kuesterei.ch>
User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-Virus-Scanned: by amavisd-new
Delivered-To: 105830@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level:
X-Spam-Status: No, hits=-6.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER
autolearn=no version=2.60-bugs.debian.org_2005_01_02
Hi Thomas,
Thomas Esser wrote:
> I don't think that maintaining large texmf trees plus their support
> structure (texdoctk database / updmap.cfg / fmtutil.cnf / ...) has a
> good future. It creates a lot of work and package based approaches have
> a lot of advantages. Therefore, I would welcome everything which makes
> packages more self contained and independend from a larger "registry".
Does that mean that you plan a restructuring of teTeX? Or is there a
realistic chance to have a "CTAN installer" so that teTeX would only
provide binaries, basic packages and infrastructure?
Are you interested in how we adapted teTeX (and tex-live, btw) to the
Debian packaging system with individual packages adding themselves to
the TEXMF trees?
Regards, Frank
--=20
Frank K=FCster
Inst. f. Biochemie der Univ. Z=FCrich
Debian Developer
Acknowledgement sent to Frank Küster <frank@debian.org>:
Extra info received and forwarded to list. Copy sent to teTeX maintainers <debian-tetex-maint@lists.debian.org>.
-t
X-Loop: owner@bugs.debian.org
From: owner@bugs.debian.org (Debian Bug Tracking System)
To: Frank =?UTF-8?Q?K=C3=BCster?=
Subject: Bug#105830: Info received (was Bug#105830: Please provide a method for packages to register themselves to texdoctk)
Message-ID:
In-Reply-To: <87fyr0p9xh.fsf@alhambra.kuesterei.ch>
References: <87fyr0p9xh.fsf@alhambra.kuesterei.ch>
Precedence: bulk
X-Debian-PR-Message: ack-info 105830
X-Debian-PR-Package: tetex-bin
X-Debian-PR-Keywords:
Thank you for the additional information you have supplied regarding
this problem report. It has been forwarded to the package maintainer(s)
and to other interested parties to accompany the original report.
Your message has been sent to the package maintainer(s):
teTeX maintainers
If you wish to continue to submit further information on your problem,
please send it to 105830@bugs.debian.org, as before.
Please do not reply to the address at the top of this message,
unless you wish to report a problem with the Bug-tra