|
| 1 | +# VarTable |
| 2 | + |
| 3 | +An easy way to render variation table on typst, built on [Cetz](https://github.com/cetz-package/cetz)\ |
| 4 | +The [documention](https://github.com/Le-foucheur/Typst-VarTable/blob/main/documentation.pdf) ( English version )\ |
| 5 | +La [documention](https://github.com/Le-foucheur/Typst-VarTable/blob/main/documentationVF.pdf) ( Version française ) |
| 6 | + |
| 7 | + |
| 8 | +```js |
| 9 | +#import "@preview/vartable:0.2.3": tabvar |
| 10 | +``` |
| 11 | +# Few examples |
| 12 | + |
| 13 | +### Trigonometric functions |
| 14 | +Turn this : |
| 15 | +```js |
| 16 | +#import "@preview/vartable:0.2.3": tabvar |
| 17 | + |
| 18 | +#tabvar( |
| 19 | + |
| 20 | + variable: $x$, |
| 21 | + label: ( |
| 22 | + ([sign of cos’], "s"), |
| 23 | + ([variation of cos], "v"), |
| 24 | + ([sign of sin’], "s"), |
| 25 | + ([variation of sin], "v"), |
| 26 | + ), |
| 27 | + |
| 28 | + domain: ($0$, $ pi / 2 $, $ pi $, $ (2pi) / 3 $, $ 2 pi $), |
| 29 | + contents: ( |
| 30 | + ($-$, (), ("0",$+$), ()), |
| 31 | + ( |
| 32 | + (top, $1$), |
| 33 | + (), |
| 34 | + (bottom, $-1$), |
| 35 | + (), |
| 36 | + (top, $1$), |
| 37 | + ), |
| 38 | + ($+$, $-$, (), $+$), |
| 39 | + ( |
| 40 | + (center, $0$), |
| 41 | + (top, $1$), |
| 42 | + (), |
| 43 | + (bottom, $-1$), |
| 44 | + (center, $0$), |
| 45 | + ), |
| 46 | + ), |
| 47 | + values: ( |
| 48 | + ("arrow10.50%", $ $, $ 0 $, "f"), |
| 49 | + ("arrow12.49%", $ $, $ 0 $, "f"), |
| 50 | + ) |
| 51 | +) |
| 52 | +``` |
| 53 | +Into this |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | +### hyperbolic function $f(x) = 1/x $ |
| 58 | + |
| 59 | +```js |
| 60 | +#import "@preview/vartable:0.2.3": tabvar |
| 61 | + |
| 62 | +#tabvar( |
| 63 | + arrow-mark: (end: ">", start: "|"), |
| 64 | + variable: $x$, |
| 65 | + label: ( |
| 66 | + ([sign of $f’$], "s"), |
| 67 | + ([variation of $f$], "v"), |
| 68 | + ), |
| 69 | + domain: ($ -oo $, $ 0 $, $ +oo $), |
| 70 | + contents: ( |
| 71 | + ($+$, ("||", $+$)), |
| 72 | + ( |
| 73 | + (center, $0$), |
| 74 | + (bottom, top, "||", $ -oo $, $ +oo $), |
| 75 | + (center, $ 0 $), |
| 76 | + ), |
| 77 | + ), |
| 78 | +) |
| 79 | +``` |
| 80 | + |
| 81 | + |
| 82 | +### A random function : $f(x) = \sqrt{x²-4}$ & $f'(x) = \frac {x} {\sqrt{x² - 4}}$ |
| 83 | + |
| 84 | +```js |
| 85 | +#import "@preview/Tabvar:0.2.3": tabvar, hatch |
| 86 | + |
| 87 | +#tabvar( |
| 88 | + variable: $t$, |
| 89 | + label: ( |
| 90 | + ([Sign of $f’$], 1cm,"s"), |
| 91 | + ([Variation of $f$], "v"), |
| 92 | + ), |
| 93 | + hatching-style: hatch, |
| 94 | + domain: ($ -oo $,($ -2 $, 1cm),$ 2 $, $ +oo $), |
| 95 | + contents: ( |
| 96 | + ( $ - $, "|h|", $ + $), |
| 97 | + ( |
| 98 | + (top, $ +oo $), |
| 99 | + (bottom,"|h", $ 0 $), |
| 100 | + (bottom, "H|", $ 0 $), |
| 101 | + (top, $ +oo $) |
| 102 | + ) |
| 103 | + ) |
| 104 | +) |
| 105 | +``` |
| 106 | + |
| 107 | + |
| 108 | + |
| 109 | +## ·change log· |
| 110 | + |
| 111 | +### 0.2.3 |
| 112 | +- fix [issue #17](https://github.com/Le-foucheur/Typst-VarTable/issues/17) |
| 113 | + |
| 114 | +#### 0.2.2 : |
| 115 | +- fix [issue #15](https://github.com/Le-foucheur/Typst-VarTable/issues/15) |
| 116 | + |
| 117 | +#### 0:2:1 : |
| 118 | +- change "Variation" into "v" |
| 119 | +- change "Sign" into "s" |
| 120 | +- add the possibility to hatch some area |
| 121 | +- add the possibility to add some elements |
| 122 | +- can change the table dimension |
| 123 | +- support `Cetz 0.4.1` |
| 124 | +- bug fix |
| 125 | + |
| 126 | +#### 0.2.0 : |
| 127 | +- **Require :** typst version >= 0.13.0 |
| 128 | +- Now bluid on `Cetz 0.3.4` insted of fletcher |
| 129 | +- rename stroke to table-style and now take the Cetz style type |
| 130 | +- rename stroke-arrow to arrow-style and now take the Cetz style type |
| 131 | +- rename arrow to arrow-mark and now take the Cetz mark type |
| 132 | +- rename marks-line to line-style and now take the Cetz style type |
| 133 | +- fix the bug (that was present on this readme) |
| 134 | + |
| 135 | +#### 0.1.2 : |
| 136 | +- Support `fletcher 0.5.2` |
| 137 | + |
| 138 | +#### 0.1.1 : |
| 139 | +- added customisation of separator bars between signs |
| 140 | + |
| 141 | +##### 0.1.0 : |
| 142 | +- publishing the package |
0 commit comments