WoodcoreMake the numbers vibe

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.

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

ArgumentStatusWhat 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 Nmm
unit: ""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 symbol
display-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 kNm
display-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 on
style: "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: says
label: "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 choice
descr: "in Feldmitte"where the answer holds
optional
Where the answer's description goes.
descr-position: "after"in brackets, after the answer
descr-position: "footnote"in the line's footnote
Citation
optional
The norm the formula comes from.
norm: "SIA 265"a norm
norm: "Sherpa"a manufacturer's catalogue
optional
The clause or table the formula comes from.
norm-section: "2.2.5"a clause
norm-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 apart
norm-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 checked
value: 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 results
role: "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 export
id: "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 value
level: 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

Example 1
#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
The page eq produces, level 2
Example 2
#var("M_Ed", 1.254, "kNm")
#var("a", 120, "mm")
#eq("F", `M_Ed / a`, style: "double")
Level of detail
The page eq produces, level 2
Example 3
#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.

The page eq produces, level 2
Example 4
#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
The page eq produces, level 2
Example 5
#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
The page eq produces, level 2
Example 6
#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
The page eq produces, level 2
Example 7
#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)
The page eq produces, level 2

Defined in lib/formula.typ:1645