[pdftex] \pdfendlink ended up in different nesting level than \pdfstartlink

Ross Moore ozross at icloud.com
Tue Oct 25 06:43:09 CEST 2022


Hi Aleks.

I can now tell you where in the coding the problem occurs.
Knowing this, you should be able to kludge a work-around. (hints below)

In this image, it is the link  (anchored with  14.1.11 ) at the top of the 2nd column.


How do I know this?
Because a tracing of the  output  at the appropriate place gives:


>>> ..........\pdfcolorstack 0 pop
>>> ..........\hbox(101.67294+0.0)x175.0
>>> ...........\vbox(101.67294+0.0)x175.0
>>> ............\pdfcolorstack 0 push {0.9 0 0.3 rg 0.9 0 0.3 RG}
>>> ............\glue(\topskip) 0.0
>>> ............\hbox(7.49817+2.49939)x175.0, glue set - 0.33926
>>> .............\T2B/cmr/m/it/10 1
>>> .............\T2B/cmr/m/it/10 4
>>> .............\T2B/cmr/m/it/10 .
>>> .............\T2B/cmr/m/it/10 1
>>> .............\T2B/cmr/m/it/10 .
>>> .............\T2B/cmr/m/it/10 1
>>> .............\T2B/cmr/m/it/10 1
>>> .............\pdfcolorstack 0 pop
>>> .............\pdfendlink
>>> .............\T2B/cmr/m/it/10 .
>>> .............\glue 3.5769 plus 1.54213 minus 1.01587
>>> .............\T2B/cmr/m/it/10 Ð
>>> .............\kern-0.2555
>>> .............\T2B/cmr/m/it/10 à


Notice the unmatched  \pdfendlink .


Other such links look as follows:

>>> .............\hbox(7.49817+2.49939)x38.32397
>>> ..............\T2B/cmr/m/n/10 (
>>> ..............\pdfstartlink(*+*)x* attr{/Border[0 0 0]/H/I/C[1 0 0]} action got
>>> o name{equation.Russian.14.1.35}
>>> ..............\pdfcolorstack 0 push {0.9 0 0.3 rg 0.9 0 0.3 RG}
>>> ..............\T2B/cmr/m/n/10 1
>>> ..............\T2B/cmr/m/n/10 4
>>> ..............\T2B/cmr/m/n/10 .
>>> ..............\T2B/cmr/m/n/10 1
>>> ..............\T2B/cmr/m/n/10 .
>>> ..............\T2B/cmr/m/n/10 3
>>> ..............\T2B/cmr/m/n/10 5
>>> ..............\pdfcolorstack 0 pop
>>> ..............\pdfendlink
>>> ..............\T2B/cmr/m/n/10 )
>>> .............\glue 3.5769 plus 1.53294 minus 1.02197


with the \pdfstartlink   and  matching  \pdfendlink  .

In fact, neither the  14.1.10  nor  the  14.1.11  are active as links in my PDF.


What I think has happened is that the output-routine is splitting the two streams
to create the parallel page-breaks.  
The place where these splits occur is  *after* the  \pdfstartlink  but before any of its anchor-text.

What you probably need to do is add some (apparently redundant) extra whitespace *before* the start of this material.
e.g.  perhaps a  \bigskip  at the bottom of the columns will be enough to make the box splitting happen that little bit earlier.

Here’s another image that shows the 2 columns also on the previous page:




Notice how the last line on the preceding page is very *loose*; that is, the words are spread out.
Quite possibly a non-textual token for the  \pdfstartlink   has been included on that page,
cutting it off from the  \pdfendlink .
(I would need to trace the previous page’s output to find where these went; or may have been discarded entirely.)

My suggestion for a possible workaround is to force extra space after the displayed equations:
  (14.1.33) in the left column, and  (14.1.35) in the right column.
This should encourage the columns be split across the page-break, while keeping a balanced
look at the top of the next page.

e.g.  \goodbreak\noindent   might be sufficient, but quite likely not.
     or  \bigskip\noindent  should do it;
          \filbreak\noindent   might be overkill.
(the \noindent  might be irrelevant for your columns)


Note that I can process your files quite comfortably.
I’m *not* using the latest LaTeX, which has made significant internal changes,
to prepare for Tagged-PDF.  
I keep a machine that runs earlier versions, so that I can be sure that critical documents
(using my own implementation of Tagged PDF) are not crunched by such changes.


Another difference with my setup is to have a *huge* block of main-memory and extra-memory.
That’s probably not relevant to your job, as these stats show:

>>> Output written on 2207.06506.Russian.pdf (295 pages, 1654705 bytes).
>>> PDF statistics:
>>>  8377 PDF objects out of 8907 (max. 8388607)
>>>  7955 compressed objects within 80 object streams
>>>  2736 named destinations out of 2984 (max. 500000)
>>>  901 words of extra memory for PDF output out of 10000 (max. 10000000)



Hope this helps.

	Ross


>> From: Aleks Kleyn <Aleks_Kleyn at mailaps.org>
>> Date: 25 October 2022 at 12:41:33 pm AEDT
>> To: pdftex at tug.org
>> Subject: Re: [pdftex] \pdfendlink ended up in different nesting level than \pdfstartlink
>> 
>>  Thank you for response. I do not think this is problem with babel because I write the same text in English and Russian. Sometimes I see such error in English version. But it is hard to catch. Long time I suspected macro. When I used macro trace, I saw that pdfstart and pdfend appear on the same level. Once when I had such error in English text, I used dvips (like I did long time ago) and compilation was good. This is why I think the problem is not in macro, but in the procedure of compilation. I found today that following bat file works
>> latex -output-directory=Out 2207.06506.Russian.tex
>> dvipdfm -o Out\2207.06506.Russian.pdf Out\2207.06506.Russian.dvi
>> I got compiled text. But links in this file does not work. Earlier I tried bat file
>> latex -output-directory=Out 2207.06506.Russian.tex
>> dvips -o Out\2207.06506.Russian.ps Out\2207.06506.Russian.dvi
>> ps2pdf Out\2207.06506.Russian.ps
>> but when I use Russian text, dvips reports that it cannot find probably font. And today for some reason ps2pdf did not create pdf file even for English version.
>> 
>> Also I tried at summer reduce number of files. I removed a lot of files and had only few including file where I had error. Suddenly error disappeared and even when I returned all files back I did not the error. This is why I decided to submit the whole package.
>> 
>> Aleks Kleyn
>> 
>> 
>> -----Original Message-----
>> From: Ross Moore [mailto:ross.moore at mq.edu.au] 
>> Sent: Monday, October 24, 2022 7:11 PM
>> To: Karl Berry
>> Cc: Aleks_Kleyn at mailaps.org; pdftex at tug.org
>> Subject: Re: [pdftex] \pdfendlink ended up in different nesting level than \pdfstartlink
>> 
>> Hi Karl, Alex’s.
>> 
>> It is interesting that you get it as a fatal error. I only get a warning, and there is nothing broken in the PDF.
>> 
>> My pdfTeX is from TeXLive 2021.
>> 
>> I have suspicions about which is the faulty link, but could not confirm these, due to the input encoding. Editing in the file: Left.Eugene.Russian.tex corrupted the file’s encoding. I’ll need to extract it afresh from the archive.
>> 
>> Primary suspect is the hyperlink in the footnote near the beginning of that chapter.
>> 
>> Other possibilities are ones that occur just on a page-break, or column-break. 
>> 
>> Best of luck in chasing this one.
>> 


Dr Ross Moore
Department of Mathematics and Statistics 
12 Wally’s Walk, Level 7, Room 734
Macquarie University, NSW 2109, Australia
T: +61 2 9850 8955  |  F: +61 2 9850 8114
M:+61 407 288 255  |  E: ross.moore at mq.edu.au
http://www.maths.mq.edu.au

I respectfully acknowledge the traditional custodians of the Macquarie University Land, the Wallumedegal clan of the Darug nation, whose cultures and customs have nurtured and continue to nurture this land since the Dreamtime. I pay my respects to Elders past, present, and future.


CRICOS Provider Number 00002J. Think before you print. 
Please consider the environment before printing this email.

This message is intended for the addressee named and may 
contain confidential information. If you are not the intended 
recipient, please delete it and notify the sender. Views expressed 
in this message are those of the individual sender, and are not 
necessarily the views of Macquarie University. <http://mq.edu.au/>
CRICOS Provider Number 00002J. Think before you print. 
Please consider the environment before printing this email.

This message is intended for the addressee named and may 
contain confidential information. If you are not the intended 
recipient, please delete it and notify the sender. Views expressed 
in this message are those of the individual sender, and are not 
necessarily the views of Macquarie University.
 <http://mq.edu.au/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/pdftex/attachments/20221025/99836c9a/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2022-10-25 at 2.54.25 pm.png
Type: image/png
Size: 118723 bytes
Desc: not available
URL: <https://tug.org/pipermail/pdftex/attachments/20221025/99836c9a/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2022-10-25 at 3.12.57 pm.png
Type: image/png
Size: 147602 bytes
Desc: not available
URL: <https://tug.org/pipermail/pdftex/attachments/20221025/99836c9a/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 4605 bytes
Desc: not available
URL: <https://tug.org/pipermail/pdftex/attachments/20221025/99836c9a/attachment-0005.png>


More information about the pdftex mailing list.