From zartzartzart at gmail.com Wed Feb 15 13:38:07 2006
From: zartzartzart at gmail.com (Lasse Nisted)
Date: Wed Feb 15 20:04:44 2006
Subject: [tex-k] Bibtex 0.99c handling of \@input
Message-ID: <410040ea0602150438u62ee9beasa10fc14bd016cfb1@mail.gmail.com>
Hello
I think I've found a bug in bibtex.
It seems it only searches for .aux files in the current directory instead
of searching in the root aux file directory. (I use latex -output-directory
to place .aux files in ./output/)
$ bibtex output/shuttle
This is BibTeX, Version 0.99c (Web2C 7.5.4)
The top-level auxiliary file: output/shuttle.aux
I couldn't open auxiliary file introduction.aux
---line 6 of file output/shuttle.aux
: \@input{introduction.aux
: }
I'm skipping whatever remains of this command
The style file: alpha.bst
I found no \citation commands---while reading file output/shuttle.aux
Database file #1: tex/lit.bib
(There were 2 error messages)
$ cd output/
$ bibtex shuttle
This is BibTeX, Version 0.99c (Web2C 7.5.4)
The top-level auxiliary file: shuttle.aux
A level-1 auxiliary file: introduction.aux
The style file: alpha.bst
I couldn't open database file tex/lit.bib
---line 8 of file shuttle.aux
: \bibdata{tex/lit
: }
I'm skipping whatever remains of this command
I found no database files---while reading file shuttle.aux
Warning--I didn't find a database entry for "vazirani"
(There were 2 error messages)
As can be seen, it wouldn't help to change directory, as the
relative path to "lit.bib" then would be wrong.
I'm sorry if this isn't a bug :)
- Lasse
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tug.org/pipermail/tex-k/attachments/20060215/55ca156e/attachment.htm
From olegkat at gmail.com Mon Feb 27 13:03:36 2006
From: olegkat at gmail.com (Oleg Katsitadze)
Date: Mon Feb 27 13:08:58 2006
Subject: [tex-k] HyperTeX tags
Message-ID: <20060227120336.GA11359@thor>
Dear all,
I have a couple of questions about hyperTeX with Ghostscript
(ps2pdf) and dvipdfm(x). Sorry if this is a wrong place to
ask, but I could not get an answer on the texhax mailing
list, and pdftex mailing list seems to be even more
off-topic.
For the test case I've created two files, from.tex and
to.tex, like this:
--------------------from.tex--------------------
{\catcode`\#=11
\gdef\hash{#}}
\noindent
\special{html:}%
Link to to.pdf%
\special{html:}
\bye
--------------------from.tex--------------------
---------------------to.tex---------------------
{\catcode`\#=11
\gdef\hash{#}}
\null\vfill\eject % Empty first page.
\noindent
\special{html:}%
Destination in to.pdf%
\special{html:}
\vfill
\noindent
\special{html:}Reference to force
creation of the target anchor\special{html:}
\bye
---------------------to.tex---------------------
So I have a link from from.tex pointing to a destination
on the second page of to.tex.
I compile the files with the commands
$ tex from.tex
$ dvips -z from.dvi -o
$ ps2pdf from.ps
$ tex to.tex
$ dvips -z to.dvi -o
$ ps2pdf to.ps
and obtain two files, from.pdf and to.pdf.
The first problem: the link from from.pdf opens to.pdf on
the _first_ page (both in Xpdf and Acrobat Reader). When I
look at the `raw' from.pdf, I see:
9 0 obj
<>
/Subtype/Link>>endobj
Alright. Now I open to.pdf and see:
10 0 obj
<>
/Annots[13 0 R]/Contents 11 0 R
>>
endobj
[...]
3 0 obj
<< /Type /Pages /Kids [
4 0 R
10 0 R
] /Count 2
>>
endobj
[...]
13 0 obj
<>endobj
14 0 obj
This is the link on the second page of to.pdf to the
destination on the same page, but instead of creating a
named destination "dest" and linking to it, ps2pdf created
link using explicit destination. There is no destination
named "dest" defined in to.pdf, so this explains why viewers
can't find it when I click on the link in from.pdf. This
appears to be the problem with ps2pdf, because when I look
at to.ps, I see:
HPSdict begin
/TargetAnchors
1 dict dup begin
(dest) [2 [72 757 163 769] 841] def
end targetdump-hook def end
[...]
TeXDict begin HPSdict begin 2 1 bop 0 166 a
Fa(Destination)55
b(in)h(to.p)5 b(df)0 5507 y(Reference)55
b(to)g(force)f(creation)h(of)g
(the)g(target)g(anc)-5 b(hor)p
(#dest) [[72 437 279 449] [1 1 1 [3 3]] [0 0 1]] pdfm
3858 11078 a(2)p eop end end
which I think means that the destination is defined in
to.ps. Furthermore, if I run
$ dvipdfmx to.dvi
to produce to.pdf, the inter-document link starts to work,
and to.pdf contains:
15 0 obj
<<
/Names[(dest) 8 0 R]
>>
endobj
[...]
8 0 obj
[7 0 R /XYZ null 783.9271239 null]
endobj
[...]
7 0 obj
<<
/Contents[10 0 R]
/Resources 11 0 R
/Type/Page
/Parent 17 0 R
/Annots 18 0 R
>>
endobj
[...]
17 0 obj
<<
/Type/Pages
/Count 2
/Kids[3 0 R 7 0 R]
/MediaBox[0 0 595.28 841.89]
>>
endobj
So the named destination "dest" is in place. So my question
is, how do I force ps2pdf to create real named destinations
in the produced PDFs?
The second question is about dvipdfmx. As I mentioned
above, dvipdfmx correctly creates destinations in to.pdf,
but when I run it on from.dvi to create the inter-document
link:
$ dvipdfmx from.dvi
unlike dvips, dvipdfmx seems to fail to parse the `#'
extension, and creates the following link in from.pdf:
4 0 obj
<<
/Type/Action
/S/URI
/URI(file:to.pdf#dest\000)
>>
endobj
Is this just a fact of life, or there is a way to make
dvipdfmx create correct local inter-document links? (Of
course, this is possible using "native" \special's of
dvipdfmx, but I need to use only hyperTeX tags and/or
dvipdfmx command line options.)
While I am at it, here's another quick question about
hyperTeX: what is the reason for creating a target spanning
some text, instead of marking just a spot on a page? In
other words, what is the difference (functionally) between
these two pieces of code:
\special{html:}Destination\special{html:}
and
\special{html:}\special{html:}Destination
Versions of the programs I use:
- TeX (Web2C 7.4.5) 3.14159
- dvips(k) 5.92b
- dvipdfmx-20040411 by the DVIPDFMx project team
- ESP Ghostscript 8.15.0 (2005-08-11)
- Xpdf 3.01
- Acrobat Reader 7.0
Thanks in advance for any help,
Oleg Katsitadze
From karl at freefriends.org Mon Feb 27 23:03:43 2006
From: karl at freefriends.org (Karl Berry)
Date: Mon Feb 27 23:03:46 2006
Subject: [tex-k] HyperTeX tags
In-Reply-To: <20060227120336.GA11359@thor>
Message-ID: <200602272203.k1RM3hP31198@f7.net>
Hi Oleg,
how do I force ps2pdf to create real named destinations
in the produced PDFs?
As you probably know, ps2pdf is just a tiny shell script frontend for
ghostscript. I do not know what kind of controls it has for dealing
with links like this. I never ran across anything. All I can
suggest is to poke at the gs doc and source and mailing lists ...
Is this just a fact of life, or there is a way to make
dvipdfmx create correct local inter-document links?
This would seem to be a bug in dvipdfmx, and I suggest writing to the
authors. It is actually actively maintained, unlike dvipdf and dvipdfm
and ...
Jin-Hwan Cho
Shunsaku Hirata
You might also try a newer version. TL05 included dvipdfmx-20050823.
what is the reason for creating a target spanning
some text, instead of marking just a spot on a page?
Are you sure there is any reason? I would speculate that this was
inherited from HTML, where you can say
some text
even though it is effectively equivalent (afaik) to
some text
Thanks in advance for any help,
Not much, but it's the best I can do :). Good luck with the paper.
Best,
Karl
From reinhard.kotucha at web.de Tue Feb 28 00:51:15 2006
From: reinhard.kotucha at web.de (Reinhard Kotucha)
Date: Tue Feb 28 00:51:24 2006
Subject: [tex-k] HyperTeX tags
In-Reply-To: <200602272203.k1RM3hP31198@f7.net>
References: <20060227120336.GA11359@thor>
<200602272203.k1RM3hP31198@f7.net>
Message-ID: <17411.36979.386766.87925@zarniwoop.ms25.local>
> how do I force ps2pdf to create real named destinations
> in the produced PDFs?
I must admit that I didn't follow the whole tread, hence I do not
understand the problem.
However, since PostScript does not support hyperlinks, Adobe added a
new primitive /pdfmark to PostScript which allows you to insert PDF
code into PostScript files.
http://www.pdflib.com/pdffiles/pdfmark_primer.pdf
http://www.math.uakron.edu/~dpstory/tutorial/pdfmarks/txtfield.pdf
http://www.math.uakron.edu/~dpstory/lnk_forms.html
It's described in Adobe TechNote 5150:
pdfmark Reference Manual
#5150 11/16/99 [48](PDF: 511 KB / 98 pages)
but Google resists to tell me the URL.
> what is the reason for creating a target spanning some text,
> instead of marking just a spot on a page?
> Are you sure there is any reason? I would speculate that this was
> inherited from HTML, where you can say some text
> even though it is effectively equivalent (afaik) to name="foo">some text
If you say some text then "some text" is highlighted
and people can click on it.
If you say some text then there is still a hyperlink
but how can it be accessed?
But this is the source, not the target. The target can be just a spot
on a page. Does a target really span some text? Isn't it just
\label{foo} in LaTeX?
Regards,
Reinhard
--
----------------------------------------------------------------------------
Reinhard Kotucha Phone: +49-511-4592165
Marschnerstr. 25
D-30167 Hannover mailto:reinhard.kotucha@web.de
----------------------------------------------------------------------------
Microsoft isn't the answer. Microsoft is the question, and the answer is NO.
----------------------------------------------------------------------------
From vojta at Math.Berkeley.EDU Tue Feb 28 01:18:32 2006
From: vojta at Math.Berkeley.EDU (Paul Vojta)
Date: Tue Feb 28 01:37:32 2006
Subject: [tex-k] HyperTeX tags
In-Reply-To: <17411.36979.386766.87925@zarniwoop.ms25.local>
References: <20060227120336.GA11359@thor> <200602272203.k1RM3hP31198@f7.net>
<17411.36979.386766.87925@zarniwoop.ms25.local>
Message-ID: <20060228001832.GA3045@math.berkeley.edu>
On Tue, Feb 28, 2006 at 12:51:15AM +0100, Reinhard Kotucha wrote:
> It's described in Adobe TechNote 5150:
>
> pdfmark Reference Manual
> #5150 11/16/99 [48](PDF: 511 KB / 98 pages)
>
> but Google resists to tell me the URL.
http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/pdf_creation_apis_and_specs/pdfmarkReference.pdf
--Paul Vojta, vojta@math.berkeley.edu
From oberdiek at uni-freiburg.de Tue Feb 28 09:38:32 2006
From: oberdiek at uni-freiburg.de (Heiko Oberdiek)
Date: Tue Feb 28 09:42:01 2006
Subject: [tex-k] HyperTeX tags
In-Reply-To: <20060227120336.GA11359@thor>
References: <20060227120336.GA11359@thor>
Message-ID: <20060228083832.GA5637@irwin.vpn.uni-freiburg.de>
On Mon, Feb 27, 2006 at 02:03:36PM +0200, Oleg Katsitadze wrote:
> ---------------------to.tex---------------------
> {\catcode`\#=11
> \gdef\hash{#}}
>
> \null\vfill\eject % Empty first page.
>
> \noindent
> \special{html:}%
> Destination in to.pdf%
> \special{html:}
>
> \vfill
>
> \noindent
> \special{html:}Reference to force
> creation of the target anchor\special{html:}
>
> \bye
> ---------------------to.tex---------------------
> The first problem: the link from from.pdf opens to.pdf on
> the _first_ page (both in Xpdf and Acrobat Reader). When I
> look at the `raw' from.pdf, I see:
>
> Alright. Now I open to.pdf and see:
> 13 0 obj
> < /T(dest)
> /Rect [72 437 279 449]
> /Border [1 1 1[]]
> /C [0 0 1]
> /Dest [10 0 R /FitH 841]
> /Subtype/Link>>endobj
> 14 0 obj
>
> This is the link on the second page of to.pdf to the
> destination on the same page, but instead of creating a
> named destination "dest" and linking to it, ps2pdf created
> link using explicit destination. There is no destination
> named "dest" defined in to.pdf,
I agree with your analysis and found a bug in dvips (hps.lpro):
dvips puts the destinations in a dictionary /TargetAnchors and
applies the procedure targetdump-hook on the dictionary.
The default definition of targetdump-hook in hps.lpro:
/targetdump-hook
{dup mark exch gsave initmat setmatrix
{{ mark /Dest 4 2 roll
targetvalidate
{aload pop exch pop
/Page 3 1 roll /View exch [ exch /FitH exch ]
/DEST pdfmark}
{cleartomark}
ifelse} forall} stackstopped pop
grestore} bind def
It calls targetvalidate that is the cause of the problem:
/tempstring 256 string def
/targetvalidate
{1 index dup length 255 gt exch
dup (/) search
{pop pop pop exch pop true exch}
{pop}
ifelse
cvn tempstring cvs
token pop pop length 0 ne or
not} bind def
I do not know the purpose of this procedure. Perhaps it want to
sort out names that does not work with some Distiller/older
Ghostscript versions? It throws away names longer than 255
characters, names that contain "/" or white space. This might
be a problem with very old Distiller programs for PDF < 1.2,
but for PDF-1.2 any character except null (code 0) can be part
of a name.
"1 index" at the beginning of targetvalidate gets the key
of the entry in the dictionary TargetAnchors. The original
type was string. The entry in the dictionary was defined
with the key as string. That is possible in PostScript where
string or name (or any other type) can be used as key.
But the forall loop produces the type name for the key
(perhaps older versions of ghostscript/distiller behaved differently
returning a string?). Thus the key has the type name!
The length test works for both string and name, but search
expects a string only. Thus the conversion to the string must
be done *before* search, not after.
Also the PDF specification (Version 1.6) says in appendix C
"Implemenation Limits", table C.1 "Architectural limits":
quantitiy: name
limit: 127
description: Maximum length of a name, in bytes.
The next bug: token also can return false. This case is not checked.
For example, this case is triggered by an empty name. This is valid
for PDF, but perhaps it is intended to prevent this case for
older distiller versions? The patch below assumes yes.
*** hps.lpro.org 2006-02-28 09:31:13.000000000 +0100
--- hps.lpro 2006-02-28 09:35:41.000000000 +0100
***************
*** 69,84 ****
}
bind def
! /tempstring 256 string def
/targetvalidate
! {1 index dup length 255 gt exch
dup (/) search
{pop pop pop exch pop true exch}
{pop}
ifelse
! cvn tempstring cvs
! token pop pop length 0 ne or
not} bind def
/targetdump-hook where
--- 69,87 ----
}
bind def
! % PDF implementation limit for names is 127, see PDF specification,
! % version 1.6, appendix C "Implementation Limits,
! % table C.1 "Architectural limits", page 920.
! /tempstring 128 string def
/targetvalidate
! {1 index dup length 127 gt exch
! tempstring cvs
dup (/) search
{pop pop pop exch pop true exch}
{pop}
ifelse
! token {pop length 0 ne} {true} ifelse or
not} bind def
/targetdump-hook where
Next problem is dvips itself:
\special{html:}%
The PS file is then invalid:
(abc)def) [2 [72 719 183 721] 841] def
The name should be quoted to get a valid PostScript string:
(abc\)def) ...
Yours sincerely
Heiko
--
From olegkat at gmail.com Tue Feb 28 10:43:48 2006
From: olegkat at gmail.com (Oleg Katsitadze)
Date: Tue Feb 28 10:49:15 2006
Subject: [tex-k] HyperTeX tags
In-Reply-To: <200602272203.k1RM3hP31198@f7.net>
References: <20060227120336.GA11359@thor> <200602272203.k1RM3hP31198@f7.net>
Message-ID: <20060228094348.GA19549@thor>
On Mon, Feb 27, 2006 at 04:03:43PM -0600, Karl Berry wrote:
> All I can suggest is to poke at the gs doc and source and mailing lists ...
I've grepped through the docs, but no cigar. Will have to
read more carefully, but I'm afraid I'll have to go to the
source. Not sure I can handle that...
> This would seem to be a bug in dvipdfmx, and I suggest writing to the
> authors. It is actually actively maintained, unlike dvipdf and dvipdfm
> and ...
> Jin-Hwan Cho
> Shunsaku Hirata
Thanks, I'll report this, after I try the new version.
> Good luck with the paper.
Thanks!
Oleg
From olegkat at gmail.com Tue Feb 28 10:53:54 2006
From: olegkat at gmail.com (Oleg Katsitadze)
Date: Tue Feb 28 10:58:42 2006
Subject: [tex-k] HyperTeX tags
In-Reply-To: <17411.36979.386766.87925@zarniwoop.ms25.local>
References: <20060227120336.GA11359@thor> <200602272203.k1RM3hP31198@f7.net>
<17411.36979.386766.87925@zarniwoop.ms25.local>
Message-ID: <20060228095354.GA19402@thor>
On Tue, Feb 28, 2006 at 12:51:15AM +0100, Reinhard Kotucha wrote:
> http://www.pdflib.com/pdffiles/pdfmark_primer.pdf
>
> http://www.math.uakron.edu/~dpstory/tutorial/pdfmarks/txtfield.pdf
>
> http://www.math.uakron.edu/~dpstory/lnk_forms.html
>
> It's described in Adobe TechNote 5150:
>
> pdfmark Reference Manual
> #5150 11/16/99 [48](PDF: 511 KB / 98 pages)
Thanks for the links, Paul and Reinhard. Now downloading
the docs :).
> If you say some text then "some text" is highlighted
> and people can click on it.
>
> If you say some text then there is still a hyperlink
> but how can it be accessed?
>
> But this is the source, not the target. The target can be just a spot
> on a page. Does a target really span some text? Isn't it just
> \label{foo} in LaTeX?
But some text _is_ the target, if I
understand it correctly (the link is some
text). And in PDF, targets are actually just a spot.
Anyway, I assume this is some kind of atavism from HTML, as
Karl suggests.
Thanks again,
Oleg
From olegkat at gmail.com Tue Feb 28 11:02:00 2006
From: olegkat at gmail.com (Oleg Katsitadze)
Date: Tue Feb 28 11:00:47 2006
Subject: [tex-k] HyperTeX tags
In-Reply-To: <20060228083832.GA5637@irwin.vpn.uni-freiburg.de>
References: <20060227120336.GA11359@thor>
<20060228083832.GA5637@irwin.vpn.uni-freiburg.de>
Message-ID: <20060228100200.GB19402@thor>
On Tue, Feb 28, 2006 at 09:38:32AM +0100, Heiko Oberdiek wrote:
> I agree with your analysis and found a bug in dvips (hps.lpro):
Golly, this is way over my head. I am a total layman with
the PostScript language (learning it is on the looong list
of things to do :). I hope someone knowledgeable can pick
it up.
Thanks,
Oleg
From oberdiek at uni-freiburg.de Tue Feb 28 11:28:29 2006
From: oberdiek at uni-freiburg.de (Heiko Oberdiek)
Date: Tue Feb 28 11:28:47 2006
Subject: [tex-k] HyperTeX tags
In-Reply-To: <20060228095354.GA19402@thor>
References: <20060227120336.GA11359@thor> <200602272203.k1RM3hP31198@f7.net>
<17411.36979.386766.87925@zarniwoop.ms25.local>
<20060228095354.GA19402@thor>
Message-ID: <20060228102828.GA10674@irwin.vpn.uni-freiburg.de>
On Tue, Feb 28, 2006 at 11:53:54AM +0200, Oleg Katsitadze wrote:
> On Tue, Feb 28, 2006 at 12:51:15AM +0100, Reinhard Kotucha wrote:
> > If you say some text then "some text" is highlighted
> > and people can click on it.
> >
> > If you say some text then there is still a hyperlink
> > but how can it be accessed?
> >
> > But this is the source, not the target. The target can be just a spot
> > on a page. Does a target really span some text? Isn't it just
> > \label{foo} in LaTeX?
>
> But some text _is_ the target, if I
> understand it correctly (the link is some
> text). And in PDF, targets are actually just a spot.
They are rectangle areas.
Yours sincerely
Heiko
--
From olegkat at gmail.com Tue Feb 28 11:52:19 2006
From: olegkat at gmail.com (Oleg Katsitadze)
Date: Tue Feb 28 11:51:06 2006
Subject: [tex-k] HyperTeX tags
In-Reply-To: <20060228102828.GA10674@irwin.vpn.uni-freiburg.de>
References: <20060227120336.GA11359@thor> <200602272203.k1RM3hP31198@f7.net>
<17411.36979.386766.87925@zarniwoop.ms25.local>
<20060228095354.GA19402@thor>
<20060228102828.GA10674@irwin.vpn.uni-freiburg.de>
Message-ID: <20060228105219.GA19963@thor>
On Tue, Feb 28, 2006 at 11:28:29AM +0100, Heiko Oberdiek wrote:
> On Tue, Feb 28, 2006 at 11:53:54AM +0200, Oleg Katsitadze wrote:
> And in PDF, targets are actually just a spot.
>
> They are rectangle areas.
But what about
[ page /XYZ left top zoom ]
? Of course, from the viewer's point of view (no pun
intended :), this is a rectangle at (left,top), with the
width and height of the viewer's window at the given zoom.
But the destination itself does not explicitly define the
rectangle.
Best,
Oleg
From kakuto at fsci.fuk.kindai.ac.jp Tue Feb 28 13:51:22 2006
From: kakuto at fsci.fuk.kindai.ac.jp (Akira Kakuto)
Date: Tue Feb 28 13:51:36 2006
Subject: [tex-k] HyperTeX tags
In-Reply-To: Your message of "Tue, 28 Feb 2006 09:38:32 +0100"
References: <20060228083832.GA5637@irwin.vpn.uni-freiburg.de>
Message-ID: <200602281251.k1SCpOjQ002569@jupiter.fsci.fuk.kindai.ac.jp>
> Next problem is dvips itself:
>
> \special{html:}%
>
> The PS file is then invalid:
>
> (abc)def) [2 [72 719 183 721] 841] def
>
> The name should be quoted to get a valid PostScript string:
>
> (abc\)def) ...
Very crude patch:
Best,
Akira
--- hps.c.orig Sun Jan 16 14:54:10 2005
+++ hps.c Tue Feb 28 21:36:12 2006
@@ -123,7 +123,14 @@
void do_html P1C(char *, s)
{
Hps_link *nl ;
- url_name = (char *)malloc(strlen(s)+1) ;
+ int ki = 0 ;
+ char *kp ;
+
+ for (kp = s; *kp; kp++) {
+ if (*kp == '(' || *kp == ')')
+ ki++ ;
+ }
+ url_name = (char *)malloc(strlen(s)+ki+1) ;
hs = s ;
HREF_COUNT = 0 ;
skip_space(hs) ; /* skip spaces */
@@ -227,7 +234,10 @@
skip_space(hs) ;
/* hash_name() ; */
if (*hs == '"') {
- for(hs++ ; *hs != '"' && *hs != '\0' ; *v++ = *hs++) ; /* need to esc " */
+ for(hs++ ; *hs != '"' && *hs != '\0' ; hs++) {
+ if (*hs == '(' || *hs == ')') *v++ = '\\' ;
+ *v++ = *hs ;
+ }
if(*hs == '"') {
hs++ ;
*v++ = '\0' ;
From oberdiek at uni-freiburg.de Tue Feb 28 15:04:20 2006
From: oberdiek at uni-freiburg.de (Heiko Oberdiek)
Date: Tue Feb 28 15:49:04 2006
Subject: [tex-k] HyperTeX tags
In-Reply-To: <20060228105219.GA19963@thor>
References: <20060227120336.GA11359@thor> <200602272203.k1RM3hP31198@f7.net>
<17411.36979.386766.87925@zarniwoop.ms25.local>
<20060228095354.GA19402@thor>
<20060228102828.GA10674@irwin.vpn.uni-freiburg.de>
<20060228105219.GA19963@thor>
Message-ID: <20060228140419.GA11839@irwin.vpn.uni-freiburg.de>
On Tue, Feb 28, 2006 at 12:52:19PM +0200, Oleg Katsitadze wrote:
> On Tue, Feb 28, 2006 at 11:28:29AM +0100, Heiko Oberdiek wrote:
> > On Tue, Feb 28, 2006 at 11:53:54AM +0200, Oleg Katsitadze wrote:
> > And in PDF, targets are actually just a spot.
> >
> > They are rectangle areas.
>
> But what about
>
> [ page /XYZ left top zoom ]
>
> ? Of course, from the viewer's point of view (no pun
> intended :), this is a rectangle at (left,top), with the
> width and height of the viewer's window at the given zoom.
> But the destination itself does not explicitly define the
> rectangle.
Yes you are right, the spec says (8.2.1 Destinations):
| A destination defines a particular view
| of a document, consisting of the following
| items:
| * The page of the document to be displayed
| * The location of the document window on that page
| * The magnification (zoom) factor to use when displaying the page
Yours sincerely
Heiko
--
From oberdiek at uni-freiburg.de Tue Feb 28 14:57:02 2006
From: oberdiek at uni-freiburg.de (Heiko Oberdiek)
Date: Tue Feb 28 15:49:05 2006
Subject: [tex-k] HyperTeX tags
In-Reply-To: <200602281251.k1SCpOjQ002569@jupiter.fsci.fuk.kindai.ac.jp>
References: <20060228083832.GA5637@irwin.vpn.uni-freiburg.de>
<200602281251.k1SCpOjQ002569@jupiter.fsci.fuk.kindai.ac.jp>
Message-ID: <20060228135701.GA11822@irwin.vpn.uni-freiburg.de>
On Tue, Feb 28, 2006 at 09:51:22PM +0900, Akira Kakuto wrote:
> > Next problem is dvips itself:
> >
> > \special{html:}%
> >
> > The PS file is then invalid:
> >
> > (abc)def) [2 [72 719 183 721] 841] def
> >
> > The name should be quoted to get a valid PostScript string:
> >
> > (abc\)def) ...
>
> Very crude patch:
> Best,
> Akira
>
> --- hps.c.orig Sun Jan 16 14:54:10 2005
> +++ hps.c Tue Feb 28 21:36:12 2006
> @@ -123,7 +123,14 @@
> void do_html P1C(char *, s)
> {
> Hps_link *nl ;
> - url_name = (char *)malloc(strlen(s)+1) ;
> + int ki = 0 ;
> + char *kp ;
> +
> + for (kp = s; *kp; kp++) {
> + if (*kp == '(' || *kp == ')')
and at least: || *kp == '\\'
> + ki++ ;
> + }
> + url_name = (char *)malloc(strlen(s)+ki+1) ;
> hs = s ;
> HREF_COUNT = 0 ;
> skip_space(hs) ; /* skip spaces */
> @@ -227,7 +234,10 @@
> skip_space(hs) ;
> /* hash_name() ; */
> if (*hs == '"') {
> - for(hs++ ; *hs != '"' && *hs != '\0' ; *v++ = *hs++) ; /* need to esc " */
> + for(hs++ ; *hs != '"' && *hs != '\0' ; hs++) {
> + if (*hs == '(' || *hs == ')') *v++ = '\\' ;
and at least: || *kp = '\\'
> + *v++ = *hs ;
> + }
> if(*hs == '"') {
> hs++ ;
> *v++ = '\0' ;
Yours sincerely
Heiko
From kakuto at fsci.fuk.kindai.ac.jp Tue Feb 28 16:52:15 2006
From: kakuto at fsci.fuk.kindai.ac.jp (Akira Kakuto)
Date: Tue Feb 28 16:52:24 2006
Subject: [tex-k] HyperTeX tags
In-Reply-To: Your message of "Tue, 28 Feb 2006 14:57:02 +0100"
References: <20060228135701.GA11822@irwin.vpn.uni-freiburg.de>
Message-ID: <200602281552.k1SFqGkk003502@jupiter.fsci.fuk.kindai.ac.jp>
...
> > + if (*kp == '(' || *kp == ')')
>
> and at least: || *kp == '\\'
Thanks. I'm not sure to change these lines.
Original author may have expected a user to
escape himself like "\string\(\string\134" for "(\".
Best,
Akira
From karl at freefriends.org Tue Feb 28 20:12:44 2006
From: karl at freefriends.org (Karl Berry)
Date: Tue Feb 28 20:13:03 2006
Subject: [tex-k] HyperTeX tags
In-Reply-To: <200602281552.k1SFqGkk003502@jupiter.fsci.fuk.kindai.ac.jp>
Message-ID: <200602281912.k1SJCi408661@f7.net>
Original author may have expected a user to
escape himself like "\string\(\string\134" for "(\".
Indeed, we had this same discussion last year in regards to pdftex,
which also requires the user to do escaping. The conclusion was, as far
as I could gather, was that it was too late to fix it, since any
existing packages (notably hyperref), already assume that behavior.
So I fear it might actually cause more trouble than it solves to change
dvips in this way :(.
Thanks,
Karl
From karl at freefriends.org Tue Feb 28 20:39:10 2006
From: karl at freefriends.org (Karl Berry)
Date: Tue Feb 28 20:39:18 2006
Subject: [tex-k] HyperTeX tags
In-Reply-To: <20060228083832.GA5637@irwin.vpn.uni-freiburg.de>
Message-ID: <200602281939.k1SJdAd14719@f7.net>
*** hps.lpro.org 2006-02-28 09:31:13.000000000 +0100
--- hps.lpro 2006-02-28 09:35:41.000000000 +0100
Thank you very much for that detailed analysis and fix, Heiko!
I'll apply the change in the dvips sources as soon as I have the
repository ready for checkins :).
Oleg, if you want to try it out with your ps2pdf stuff for immediate
gratification, you can just replace the /targetvalidate...bind def in
hps.pro with Heiko's routine. It looks different since all the
whitespace is removed in the .pro files, but that's not important.
Thanks,
K
From oberdiek at uni-freiburg.de Tue Feb 28 22:05:55 2006
From: oberdiek at uni-freiburg.de (Heiko Oberdiek)
Date: Tue Feb 28 22:06:11 2006
Subject: [tex-k] HyperTeX tags
In-Reply-To: <200602281912.k1SJCi408661@f7.net>
References: <200602281552.k1SFqGkk003502@jupiter.fsci.fuk.kindai.ac.jp>
<200602281912.k1SJCi408661@f7.net>
Message-ID: <20060228210555.GA16269@irwin.vpn.uni-freiburg.de>
On Tue, Feb 28, 2006 at 01:12:44PM -0600, Karl Berry wrote:
> Original author may have expected a user to
> escape himself like "\string\(\string\134" for "(\".
>
> Indeed, we had this same discussion last year in regards to pdftex,
> which also requires the user to do escaping. The conclusion was, as far
> as I could gather, was that it was too late to fix it, since any
> existing packages (notably hyperref), already assume that behavior.
hyperref does not protect the name at all:
\special{html:}%
> So I fear it might actually cause more trouble than it solves to change
> dvips in this way :(.
Perhaps there is hope that the html syntax has prevented that
someone thought about protecting as PDF string.
Also the specials are used by other systems that are far
away from PostScript and PDF, such as DVI viewers.
Therefore I think quoting as PDF string is the task
of the program that uses the name for PDF strings, in our
case this is dvips.
Who controls the syntax of \special{html:...}? Does a
specification exist?
Using google I found only:
http://arxiv.org/hypertex/
It contains a short explanation, but a specification I haven't seen.
* What is the specified range of characters?
* How are special characters given? For example the quotes, as
entities? Without quoting (all between the first and last
quotes in the special is the name)?
* ...
Yours sincerely
Heiko
--
From karl at freefriends.org Tue Feb 28 22:21:14 2006
From: karl at freefriends.org (Karl Berry)
Date: Tue Feb 28 22:21:21 2006
Subject: [tex-k] HyperTeX tags
In-Reply-To: <20060228210555.GA16269@irwin.vpn.uni-freiburg.de>
Message-ID: <200602282121.k1SLLEp05918@f7.net>
hyperref does not protect the name at all:
Ok, I couldn't remember for sure. So then it's even worse -- every
document/macro package which cares has implemented it. So, in practice,
some have, some haven't. Sigh.
Therefore I think quoting as PDF string is the task
of the program that uses the name for PDF strings, in our
case this is dvips.
Well, personally, I agree, but my point was that it seems wrong for dvips
to escape things when pdftex doesn't. (Of course pdftex doesn't use
specials, but the situation is completely analogous.)
Who controls the syntax of \special{html:...}?
There is no controlling body. All attempts to standardize specials (not
to mention DVI itself) have become moribund. There are various drafts
in various stages of completions, all of them many years old, as far as
I know. I am unaware of any active efforts along these lines.
If we decide to do something, whatever that would be, we can do it. My
only thought is that it would be good to coordinate with xdvi, xdvik,
dvipdfmx. Not sure if any other active drivers would care about this.
From olegkat at gmail.com Tue Feb 28 22:53:10 2006
From: olegkat at gmail.com (Oleg Katsitadze)
Date: Tue Feb 28 22:51:51 2006
Subject: [tex-k] HyperTeX tags
In-Reply-To: <200602281939.k1SJdAd14719@f7.net>
References: <20060228083832.GA5637@irwin.vpn.uni-freiburg.de>
<200602281939.k1SJdAd14719@f7.net>
Message-ID: <20060228215309.GA4882@thor>
On Tue, Feb 28, 2006 at 01:39:10PM -0600, Karl Berry wrote:
> Oleg, if you want to try it out with your ps2pdf stuff for immediate
> gratification, you can just replace the /targetvalidate...bind def in
> hps.pro with Heiko's routine.
> whitespace is removed in the .pro files, but that's not important.
I've tried and it's working! Thanks!
However, I now see a couple of lesser issues (some people
are just never satisfied with what they get ;).
First, although the resulting PDF now contains the
definition for the named destination "dest":
5 0 obj
<>endobj
the link to this destination inside to.tex actually does not
use it, it just keeps linking to the page:
14 0 obj
<>endobj
But this is not that important, anyway.
Second, I've tried to shift the destination vertically, and
the numbers in to.ps seem to change:
/TargetAnchors
1 dict dup begin
(dest) [2 [72 660 163 672] 841] def
end targetdump-hook def end
against
/TargetAnchors
1 dict dup begin
(dest) [2 [72 757 163 769] 841] def
end targetdump-hook def end
However, the dest in to.pdf never changes, and seems to
point the top of the page, instead of the actual location:
5 0 obj
<>endobj
(both times the same; it takes that last 841 from to.ps).
But maybe this is not a bug, just limitation of Ghostscript?
Anyway, thanks for the impressively quick solution to the
original problem,
Oleg