Commands › Calculating in the report
#eq Calculating in the report
Writes a calculation: the formula in letters, in numbers, and the answer, computed with its units.
#eq(, , ,
: , : , : , : ,
: ,
: , : , : , : ,
: , : , : ,
: , : , : , :
)Hover an argument: what it does. Hover its value: every possible value. A click keeps the bubble open.
keyrequiredThe name the answer is stored under, which the lines below cite.
symboloptionalThe math source printed in the key's place.
formularequiredThe formula, in Typst math, citing keys noted above.
unitoptional · default autoThe unit the answer is converted into.
unitoptional · default autoautothe dimension's default unit (#unit)"Nm"a unit of the same dimension, converted""dimensionlessHover a value: its call and what it prints.
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`)What it prints
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, unit: "Nm")What it prints
#var("k_1", 0.8, level: 0)
#var("k_2", 0.9, level: 0)
#eq("k", `k_1 dot k_2`, unit: "")What it prints
Compiled once by Woodcore's engine, on the examples' frozen data.
as-unitoptional · default noneAnother unit without conversion: the number is kept. Not with
unit:.as-unitoptional · default nonenoneFree text, for example:
as-unit: "kN/m"display-equationoptional · default autoWhat is printed of the name and the answer.
display-equationoptional · default autoautoleft to the level"none"nothing is printed"variable"the symbol alone"value"the number alone"value-unit"the number and its unit"variable-value-unit"symbol = number unitHover a value: its call and what it prints.
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, display-equation: auto)What it prints
Prints the same as "variable-value-unit".
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, display-equation: "none")What it prints
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, display-equation: "variable")What it prints
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, display-equation: "value")What it prints
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, display-equation: "value-unit")What it prints
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, display-equation: "variable-value-unit")What it prints
Prints the same as auto.
Compiled once by Woodcore's engine, on the examples' frozen data.
display-formulaoptional · default autoWhat is printed of the formula, between the name and the answer.
display-formulaoptional · default autoautoleft to the level"none"no formula"variable"the formula in letters"value"in numbers"value-unit"in numbers, with units"variable-value-unit"in letters, then in numbersHover a value: its call and what it prints.
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, display-formula: auto)What it prints
Prints the same as "variable".
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, display-formula: "none")What it prints
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, display-formula: "variable")What it prints
Prints the same as auto.
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, display-formula: "value")What it prints
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, display-formula: "value-unit")What it prints
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, display-formula: "variable-value-unit")What it prints
Compiled once by Woodcore's engine, on the examples' frozen data.
styleoptional · default autoHow the answer is emphasised.
styleoptional · default autoautofollows #calc-defaults, else normal"normal"normal"bold"bold"underline"underlined"double"ruled twiceHover a value: its call and what it prints.
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, style: auto)What it prints
Prints the same as "normal".
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, style: "normal")What it prints
Prints the same as auto.
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, style: "bold")What it prints
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, style: "underline")What it prints
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, style: "double")What it prints
Compiled once by Woodcore's engine, on the examples' frozen data.
labeloptional · default noneWhat the answer is, in words.
labeloptional · default nonenoneFree text, for example:
label: "Bemessungswert"label-positionoptional · default autoWhere the answer's label goes.
label-positionoptional · default autoautoleft to the level: a footnote from level 2"none"no label"before"before the line, then «:»"after"after the line, after a dash"footnote"as a footnoteHover a value: its call and what it prints.
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, label: "Design moment", label-position: auto)What it prints
Prints the same as "footnote".
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, label: "Design moment", label-position: "none")What it prints
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, label: "Design moment", label-position: "before")What it prints
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, label: "Design moment", label-position: "after")What it prints
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, label: "Design moment", label-position: "footnote")What it prints
Prints the same as auto.
Compiled once by Woodcore's engine, on the examples' frozen data.
descroptional · default noneWhy the answer is what it is.
descroptional · default nonenoneFree text, for example:
descr: "Mittelwert der Feuchteklassen 1 und 2"descr-positionoptional · default autoWhere the answer's description goes.
descr-positionoptional · default autoautoleft to the level: a footnote at level 3"none"no description"after"after the line, in brackets"footnote"as a footnoteHover a value: its call and what it prints.
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, descr: "at midspan", descr-position: auto)What it prints
Prints the same as "none".
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, descr: "at midspan", descr-position: "none")What it prints
Prints the same as auto.
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, descr: "at midspan", descr-position: "after")What it prints
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, descr: "at midspan", descr-position: "footnote")What it prints
Compiled once by Woodcore's engine, on the examples' frozen data.
normoptional · default noneThe norm the formula comes from.
normoptional · default nonenoneFree text, for example:
norm: "SIA 265"norm-sectionoptional · default noneThe clause or table the formula comes from.
norm-sectionoptional · default nonenoneFree text, for example:
norm-section: "2.2.5"norm-positionoptional · default autoWhere the formula's citation goes.
norm-positionoptional · default autoautoleft to the level: a footnote at level 3"none"no citation"in-line"after the line, in grey"line-right"in the right-hand column"footnote"as a footnoteHover a value: its call and what it prints.
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, norm: "SIA 265", norm-section: "4.2.3", norm-position: auto)What it prints
Prints the same as "none".
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, norm: "SIA 265", norm-section: "4.2.3", norm-position: "none")What it prints
Prints the same as auto.
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, norm: "SIA 265", norm-section: "4.2.3", norm-position: "in-line")What it prints
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, norm: "SIA 265", norm-section: "4.2.3", norm-position: "line-right")What it prints
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, norm: "SIA 265", norm-section: "4.2.3", norm-position: "footnote")What it prints
Compiled once by Woodcore's engine, on the examples' frozen data.
valueoptional · default autoThe answer of a formula Woodcore cannot evaluate.
valueoptional · default autoautoFree text, for example:
value: 12.5roleoptional · default autoWhat the answer is to the calculation;
#var-table sorts by it. Default: compute.roleoptional · default autoautocompute, for #eq"data"a datum"compute"an intermediate value"result"a resultHover a value: its call and what it prints.
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, label: "Design moment", role: auto)What it prints
The role does not change the line: it tells #var-table where to file it.
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, label: "Design moment", role: "data")What it prints
The role does not change the line: it tells #var-table where to file it.
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, label: "Design moment", role: "compute")What it prints
The role does not change the line: it tells #var-table where to file it.
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, label: "Design moment", role: "result")What it prints
The role does not change the line: it tells #var-table where to file it.
Compiled once by Woodcore's engine, on the examples' frozen data.
idoptional · default noneThe name Woodcore finds the calculation by; once per domain, with those of
#var and #verify.idoptional · default nonenoneFree text, for example:
id: "eq-R_d"leveloptional · default autoThe line's level of detail. An argument written wins.
leveloptional · default autoautofollows the domain, else the report0nothing printed; the value is stored1the symbol and the answer2also the formula in letters and the label3also the formula in numbers, the description and citationHover a value: its call and what it prints.
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, label: "Design moment", descr: "at midspan", norm: "SIA 265", norm-section: "4.2.3", level: auto)What it prints
Prints the same as 2.
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, label: "Design moment", descr: "at midspan", norm: "SIA 265", norm-section: "4.2.3", level: 0)What it prints
Nothing is printed.
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, label: "Design moment", descr: "at midspan", norm: "SIA 265", norm-section: "4.2.3", level: 1)What it prints
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, label: "Design moment", descr: "at midspan", norm: "SIA 265", norm-section: "4.2.3", level: 2)What it prints
Prints the same as auto.
#var("q_d", 4.5, "kN/m", level: 0)
#var("l", 5, "m", level: 0)
#eq("M_d", `q_d dot l^2 / 8`, label: "Design moment", descr: "at midspan", norm: "SIA 265", norm-section: "4.2.3", level: 3)What it prints
Compiled once by Woodcore's engine, on the examples' frozen data.
The essentials
Computed, checkedThe answer is computed and its units checked; a sum of kN and m stops the compile.
NamedThe answer is stored under its key: the next line cites it.
Keys in the formulaThe formula cites the keys noted above;
* multiplies as dot does.Not computableAn integral prints as written;
value: gives the answer.Arguments
| Argument | Status | What it does, and examples |
|---|---|---|
| The line's arguments | ||
| required | The name the answer is stored under, which the lines below cite. #eq("R_d", `k_dens dot R_k`)R_d stored: a #verify below cites it"M_Ed"printed M with the subscript Ed, there being no symbol | |
| optional | The math source printed in the key's place. "sigma_(m,d)"σ with the subscripts m,d"G_(1,Ed)"a word as subscript, no quotes needed | |
| required | The formula, in Typst math, citing keys noted above. `q_d dot l^2 / 8`between backticks: no quotes to escape`F / (3 "m")`a number with its unit, in quotes`sqrt(A) * 2`* multiplies as dot does | |
| What is printed | ||
| optional | The unit the answer is converted into. unit: "kNm"M in kNm rather than Nmmunit: ""a dimensionless ratio, printed as a number | |
| optional | Another unit without conversion: the number is kept. Not with unit:.as-unit: "kN/m"for a factor whose formula cannot carry the unit#eq("q_d", `M_d / (100 "mm")`, as-unit: "kN/m")the number kept, the unit replaced | |
| optional | What is printed of the name and the answer. display-equation: "value-unit"«14.06 kNm» without the symboldisplay-equation: "none"the formula alone, no name and no answer | |
| optional | What is printed of the formula, between the name and the answer. display-formula: "variable"M = q·l²/8 = 14.06 kNmdisplay-formula: "variable-value-unit"in letters, then in numbers with their units | |
| optional | How the answer is emphasised. style: "double"the answer a section ends onstyle: "bold"an answer the rest goes on with | |
| Label and description | ||
| optional | What the answer is, in words. label: "Bemessungswert"the label, placed as label-position: sayslabel: "Biegemoment in Feldmitte"a footnote from level 2 | |
| optional | Where the answer's label goes. label-position: "before"«Bemessungswert: R_d = …»label-position: "after"after the answer, after a dash | |
| optional | Why the answer is what it is. descr: "Mittelwert der Feuchteklassen 1 und 2"the reason for a choicedescr: "in Feldmitte"where the answer holds | |
| optional | Where the answer's description goes. descr-position: "after"in brackets, after the answerdescr-position: "footnote"in the line's footnote | |
| Citation | ||
| optional | The norm the formula comes from. norm: "SIA 265"a normnorm: "Sherpa"a manufacturer's catalogue | |
| optional | The clause or table the formula comes from. norm-section: "2.2.5"a clausenorm-section: "ETA-12/0197"a technical approval | |
| optional | Where the formula's citation goes. norm-position: "line-right"in the right-hand column, the line set apartnorm-position: "in-line"after the answer, in grey | |
| Other | ||
| optional | The answer of a formula Woodcore cannot evaluate. value: 12.5for an integral: nothing is checkedvalue: 0.35an answer read off a chart | |
| optional | What the answer is to the calculation; #var-table sorts by it. Default: compute.role: "result"listed among #var-table's resultsrole: "data"a computed datum, listed with the inputs | |
| optional | The name Woodcore finds the calculation by; once per domain, with those of #var and #verify.id: "eq-R_d"the line Woodcore rewrites at the exportid: "A_net"found by typst query too | |
| optional | The line's level of detail. An argument written wins. level: 0computed and stored, not printed: an intermediate valuelevel: 3also the formula in numbers, the description and citation | |
| Written by name | ||
name-calc:, name-visible: and equation: write the key, symbol and formula by name. norm-ref: is norm-section:'s former name. | ||
Lines to copy
Minimal call
#eq("R_d", `k_dens dot R_k`)Complete call
#eq("R_d", `k_dens dot R_k`, name-calc: none, name-visible: none, equation: none, unit: auto, as-unit: none, value: auto, display-formula: auto, display-equation: auto, style: auto, role: auto, label: none, label-position: auto, descr: none, descr-position: auto, norm: none, norm-section: none, norm-ref: "", norm-position: auto, id: none, level: auto)Examples
#var("R_k", 7, "kN")
#var("k_dens", 0.806, level: 0)
#var("eta_w", 0.8, level: 0)
#var("gamma_M", 1.7, level: 0)
#eq("R_d", `k_dens dot eta_w / gamma_M dot R_k`, style: "bold", norm: "Sherpa", norm-section: "ETA-12/0197")Level of detail
#var("M_Ed", 1.254, "kNm")
#var("a", 120, "mm")
#eq("F", `M_Ed / a`, style: "double")Level of detail
#var("N_d", 50, "kN", level: 0)
#var("A", 56000, "mm²", level: 0)
#eq("sigma", `N_d / A`, display-formula: "variable-value-unit", display-equation: "variable-value-unit")
#eq("sigma2", "sigma", `N_d / A`, display-formula: "variable", display-equation: "variable")The three levels print the same page.
#var("b", 100, "mm", level: 0)
#var("h", 200, "mm", level: 0)
#eq("A", `b dot h`, level: 0)
#var("N", 12, "kN", level: 0)
#eq("sigma", `N / A`)Level of detail
#var("M_d", 4.2, "kNm", level: 0)
#eq("M_N", `M_d`, unit: "Nmm")
#eq("q_d", `M_d / (100 "mm")`, as-unit: "kN/m")Level of detail
#var("g_k", 1.2, "kN/m²", level: 0)
#eq("G_1_Ed", "G_(1,Ed)", `1.35 * g_k`, unit: "kN/m²")Level of detail
#var("R_k", 7, "kN", level: 0)
Mit #var("gamma_M", 1.7, "") wird #eq("R_d", `R_k / gamma_M`, label: "Bemessungswert", norm: "SIA 265", norm-section: "2.2.5", level: 3).
#eq("R_d2", "R_(d,2)", `R_k / 1.7`, label: "Bemessungswert", label-position: "before", norm: "SIA 265", norm-section: "2.2.5", norm-position: "line-right", level: 3)Defined in lib/formula.typ:1645