Open Reyon62 opened 2 years ago
my SATySFi's version:
$ satysfi -v
SATySFi version 0.0.6
The assertion causing this error was introduced at the same time as PBHookPageBreak
was introduced (https://github.com/gfngfn/SATySFi/commit/c6699b3a7369cf9b862d7f1b3cbe566d09292565). It might suffice to fix the problem to handle PBHookPageBreak
properly in Main__PageBreak.chop_single_column.normalize_after_break.omit_redundant_clear
As @leque pointed out, Main__PageBreak.chop_single_column.normalize_after_break.omit_redundant_clear
is the line where assertion fails.
--- a/src/backend/pageBreak.ml
+++ b/src/backend/pageBreak.ml
@@ -105,7 +105,8 @@ let chop_single_column (pbinfo : page_break_info) (area_height : length) (pbvbls
| (PBVertSkip(_), _) :: pbvbtail -> omit_redundant_clear pbvbtail
| (PBVertLine(_), _) :: _
| (PBVertFrame(_), _) :: _ -> None
- | (PBHookPageBreak(_), _) :: _ -> assert false
+ | (PBHookPageBreak(_), _) :: _ -> None
| [] -> Some([]) (* -- the original `pbvblst` consists only of spaces -- *)
in
Change like above eliminates the error message and it looks there is no problem in output pdf.
But, I'm not confident that this is the right way to solve this issue.
Also, I did somewhat simplified reproduction of this problem. I hope it would be helpful.
let text-width = 440pt
let text-height = 630pt
let-inline ctx \math m = embed-math ctx m
let ctx = get-initial-context text-width (command \math)
let bb-main =
let ib =
inline-fil
++ (embed-block-breakable ctx (block-skip 1pt))
in
line-break true true ctx ib
let vhook = hook-page-break-block (fun _ _ -> ())
let bb = bb-main +++ vhook
in
page-break A4Paper
(fun _ -> (| text-height = text-height; text-origin = (0pt,0pt); |))
(fun _ -> (| header-content = block-nil; header-origin = (0pt,0pt);
footer-content = block-nil; footer-origin = (0pt,0pt); |))
bb
The assertion was about PBHookPageBreak
(which corresponds to hook-page-break-block
) but, preceding block-box also matters.
When I change block-skip
in the embed-block-breakable
to something like block-nil
or some paragraph didn't reproduce the problem.
In the original situation, \enumerate
have a embed-block-breakable
, which contains block-skip
as the last element, and it is followed by hook-page-break-block
which is introduced in stdjareport
class document
function.
(edit)
Code like below also reproduces the problem.
embed-block-breakable
is not important, but the combination of
is sufficient.
let text-width = 440pt
let text-height = 630pt
let-inline ctx \math m = embed-math ctx m
let ctx = get-initial-context text-width (command \math)
let bb-main =
let it = {some text} in
let ib = read-inline ctx it in
line-break true true ctx ib
let vhook = hook-page-break-block (fun _ _ -> ())
let bb = bb-main +++ (block-skip 1pt) +++ vhook
in
page-break A4Paper
(fun _ -> (| text-height = text-height; text-origin = (0pt,0pt); |))
(fun _ -> (| header-content = block-nil; header-origin = (0pt,0pt);
footer-content = block-nil; footer-origin = (0pt,0pt); |))
bb
Example
Input
Output
@ R_O_R_I_J_O also found this error: https://twitter.com/R_O_R_I_J_O/status/1505121840565735424?s=20&t=gukKQDDsyNMagWU_WiHiWQ
I could avoid this error by following ways:
@ R_O_R_I_J_O checked no error using \listing in place of \enumerate: https://twitter.com/R_O_R_I_J_O/status/1505039343991533571?s=20&t=gukKQDDsyNMagWU_WiHiWQ.
This error occured when \enumerate is placed in +p, +definition, +lemma, +theorem, +corollary commands. However, such document can be compiled in +proof command. For example,
Output