Forum Bugs

Internal error: R7843

ixgal
Hello,
When I export my PDF, I get this error: "internal error: R7843", and the PDF is not exported.
Any tip on how to solve it?
Thanks
pjrm
As a workaround before I've looked into it, try adding

h1,h2,h3,h4,h5,h6 { prince-line-break-choices: heading-greedy }

(or apply it just to the heading that has the forced break).

What does “prince-books --version” say?
pjrm
That particular check is not in the current version, so a possible solution might be to try a more recent version from https://www.princexml.com/books/
ixgal
Thanks for your prompt reply.
I am using a 3 year old version of Prince and I fear that if I update it, some key configurations may change.
So I would prefer to keep my current version of Prince, and try to solve the error manually in this book (actually this is the only book where I had this problem).

What may be the cause of this "internal error: R7843" in this specific book?
pjrm
Based on what you've said about the version being fairly old, I would guess that it relates not to a heading, but to a paragraph where Prince is trying to avoid hyphenating at the end of a page or column.

[Those two situations may sound completely unrelated, but they're both situations that call for a more complex approach to line breaking.]

If you could give the exact version number then I might be able to find more precisely the circumstances where this error can arise.

Does your document contain any headings longer than two lines?

You could test that page-end hyphenation hypothesis by adding
* { hyphens: none !important; }


If that avoids the problem, then the workaround would be to locate the hyphenation(s) that cause the problem, and apply hyphens:none to just a single word. If you change the ‘*’ selector to just ‘p’ (just p { hyphens:none !important; } instead of applying to all elements) then does it still prevent the problem? (This is just to help with finding the word(s) that Prince is trying to avoid hyphenating.)

If the problem is caused by trying to avoid a page-end hyphenation, then it's a bit fiddly to find the hyphenation(s) in question, especially if there's more than one. How big is the document in question? If you add --capture=r7843-bug to the command-line when running prince-books on that document then does it say ‘unrecognized option’, or does it create a r7843-bug directory that contains your document? Are you able to send us either the resulting r7843-bug directory (if it gets created), or else send the input document and associated stylesheets and any images whose size is not given in the document?

If you're not able to send the document, then the approach I was intending to try would be either to
change the hyphens:none selector to apply to different subsets of the paragraphs (e.g. p:nth(2n), then p:nth(2n+1), and then similarly for p:nth(4n+...)); or to change the page height to extremely high and see where hyphens fall and hence have a set of words on which to try suppressing hyphenation, perhaps trying a similar binary-like search, by wrapping those words in <span> with a different attribute value each. Note that the search can be scripted, if you or someone nearby is experienced in writing shell scripts. Of course a benefit of sending us the input documents is that that can be me doing the search for you.

With regard to trying a newer version: certainly any software upgrade brings risks. However, if you are safely able to try a newer version (perhaps on a different computer or in a virtual machine), then you may find it the quickest way of avoiding this problem.

ixgal
Thank you very much!!
I found the chapter that had the problem and solved it following your advice.
All the best,