diff --git a/gallery/example1.pdf b/gallery/example1.pdf index a9b5ad8..750205d 100644 Binary files a/gallery/example1.pdf and b/gallery/example1.pdf differ diff --git a/gallery/example1.typ b/gallery/example1.typ index b29748e..3af0b84 100644 --- a/gallery/example1.typ +++ b/gallery/example1.typ @@ -87,4 +87,59 @@ none )) } +) + +#pagebreak() + +#functastic.sign-table( + ($0$, $1/e$, $e^((1-sqrt(5))/2)$, $e^(-1/3)$, $e$, $e^phi$, $e^2$, $+oo$), + espcl: 2, + { + import functastic: * + sign-line( + $f'(x)$, start-ood: true, ( + "d", $+$, "t", $+$, $0$, $-$, "t", $-$, "t", $-$, $0$, $+$, "t", $+$ + ) + ) + + sign-line( + $f''(x)$, start-ood: true, ( + "d", $-$, "t", $-$, "t", $-$, $0$, $+$, "t", $+$, "t", $+$, $0$, $-$ + ) + ) + + func-line( + $f(x)$, mult: 2, start-ood: true, ( + disc(right: (asymp($y = 0$), "bottom")), + none, + val([max], "top"), + none, + none, + val([min], "bottom"), + none, + val(asymp($x = 0$), "top"), + inter($0$, 0, 1, i: 1), + inter($0$, 1, 2, i: 4) + ) + ) + + convex-line( + [concavité], mult: 1.5, ( + "AV", + false, + none, + false, + none, + false, + "PI", + true, + none, + true, + none, + true, + "PI", + false + ) + ) + } ) \ No newline at end of file diff --git a/src/renderer.typ b/src/renderer.typ index 472a356..9990dc4 100644 --- a/src/renderer.typ +++ b/src/renderer.typ @@ -57,6 +57,21 @@ let yt = ht.at(1) let yb = hb.at(1) + if line.start-ood and line.values.len() != 0 { + let first = line.values.first() + let p0 = "header-" + str(line-i) + ".north-east" + let p1 = func.get-anchor( + ctx, + line-i, + 0, + "bottom", + if first == "d" {"left"} else {"center"}, + dx: 0.05, + dy: 0 + ) + draw.rect(p0, p1, fill: stripes, stroke: none) + } + for (i, value) in line.values.enumerate() { // Value if calc.rem(i, 2) == 1 { @@ -137,9 +152,24 @@ #let render-func(styles, ctx, line, line-i) = { let header = "header-" + str(line-i) - let ood = false + let ood = line.start-ood let value-i = -1 + if line.start-ood and line.values.len() != 0 { + let first = line.values.first() + let p0 = "header-" + str(line-i) + ".north-east" + let p1 = func.get-anchor( + ctx, + line-i, + 0, + "bottom", + if (first.eod) {"center"} else {"left"}, + dx: 0.05, + dy: 0 + ) + draw.rect(p0, p1, fill: stripes, stroke: none) + } + for (i, value) in line.values.enumerate() { if value == none { continue diff --git a/src/table.typ b/src/table.typ index 99c2ef2..810c441 100644 --- a/src/table.typ +++ b/src/table.typ @@ -15,20 +15,23 @@ #let sign-line( name, - values + values, + start-ood: false ) = { return (( type: "sign", name: name, inset: 1em, values: values, + start-ood: start-ood ),) } #let func-line( name, values, - mult: 1 + mult: 1, + start-ood: false ) = { return (( type: "func", @@ -40,13 +43,15 @@ right: 1em ), values: values, + start-ood: start-ood ),) } #let convex-line( name, values, - mult: 1 + mult: 1, + start-ood: false ) = { return (( type: "convex", @@ -58,6 +63,7 @@ right: 1em ), values: values, + start-ood: start-ood ),) }