WoodcoreMake the numbers vibe

Commands › Calculating in the report

#var Calculating in the report

Notes a value, prints it in the sentence and makes it usable by the calculations below.

#var(, , , ,
  : ,
  : , : ,
  : , : , : , : ,
  : , : , : ,
  : , : , : 
)

Hover an argument: what it does. Hover its value: every possible value. A click keeps the bubble open.

The essentials

In the sentencePrinted as a word: «b = 100 mm». A blank line starts a paragraph.
Print againWithout a value, #var prints a variable already noted, with its label and citation.
Read elsewheredomain: reads a value of the export or of a #domain of the report.
Hidelevel: 0 stores the value and prints nothing: a factor the page does not show.

Arguments

ArgumentStatusWhat it does, and examples
The line's arguments
required
The name calculations cite: letters, digits and _.
#var("b", 100, "mm")printed b, there being no symbol
"q_k1"no dash: a formula would read it as a subtraction
"k_dens"printed k with the subscript dens
optional
The math source printed in the name's place.
"q_k"q with the subscript k
"q_(k,11)"several subscripts: q subscript k,11
"W_(y,erf)"a word as subscript, no quotes needed
optional
The number. Left out, the line prints a variable already noted.
#var("k_dens", 0.806)without a unit
#var("R_d")prints R_d again, noted above
optional
The value's unit. On a line printing a variable again, the unit for that line alone.
#var("q_k", 1.729, "kN/m²")an area load
#var("R_d", unit: "N")R_d printed in N, the variable keeps its kN
optional
Where the value is read instead of written.
#var("s_k", domain: ("snow-load", "SL"))the export's snow load SL
#var("F", domain: "Ende")the F of the #domain «Ende», above
#var("s_k", 1.394, "kN/m²", domain: ("snow-load", "SL"))a value written, compared with the export's
What is printed
optional
What the line prints.
display: "value-unit"1.394 kN/m², without the symbol
display: "none"nothing printed, the value can still be used
optional
How the line is emphasised.
style: "double"ruled twice, for a value the rest relies on
style: "bold"in bold, the whole line
Label and description
optional
What the value is, in words.
label: "Expositionsbeiwert"the label, printed as label-position says
label: "Kapazität Sherpa XS"replaces that of a value read with domain:
optional
Where the label goes.
label-position: "after"«C_e = 1 — Exposure factor»
label-position: "before"«Exposure factor: C_e = 1»
optional
Why this value.
descr: "Aus dem Katalog des Herstellers"where the value comes from
descr: "Feuchteklasse 1"the choice that sets it
optional
Where the description goes.
descr-position: "after"in brackets, after the line
descr-position: "footnote"in the line's footnote, with the label
Citation
optional
The norm cited.
norm: "SIA 265"a norm
norm: "Sherpa"a manufacturer's catalogue
optional
The clause or table cited.
norm-section: "6.5.5.2"a clause
norm-section: "Tabelle 8"a table
norm-section: "ETA-12/0197"a technical approval
optional
Where the citation goes.
norm-position: "line-right"«SIA 265 6.5.5.2» in the right-hand column
norm-position: "in-line"after the line, in grey
Other
optional
What the value is to the calculation; #var-table sorts by it. Default: data.
role: "result"listed among #var-table's results
role: "compute"an intermediate value written by hand
optional
The name Woodcore finds the line by, wherever it is moved. Once per domain.
id: "q_k1"the line Woodcore rewrites at the export
id: "R_k"found by typst query too
optional
The line's level of detail. An argument written wins.
level: 0stored, not printed
level: 3with the description and citation
Written by name
name-calc:, name-visible:, value: and unit: write the key, symbol, value and unit by name. norm-ref: is norm-section:'s former name.

Lines to copy

Minimal call

#var("R_k", 7, "kN")

Complete call

#var("R_k", 7, "kN", name-calc: none, name-visible: none, value: none, unit: none, domain: none, display: 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")

The three levels print the same page.

The page var produces, level 2
Example 2
Der Querschnitt misst #var("b", 100, "mm") auf #var("h", 200, "mm"), bei #var("k_dens", 0.806).

The three levels print the same page.

The page var produces, level 2
Example 3
#var("q_k11", "q_(k,11)", 1.729, "kN/m²")

The three levels print the same page.

The page var produces, level 2
Example 4
#var("s_k", domain: ("snow-load", "SL"))
Level of detail
The page var produces, level 2
Example 5
#var("R_d", 5, "kN", norm: "SIA 265", norm-section: "6.5.5.2", level: 0)
Der Widerstand beträgt #var("R_d") oder #var("R_d", unit: "N").

Levels 1 and 2 print the same page.

Level of detail
The page var produces, level 2
Example 6
#var("s_k", domain: ("snow-load", "SL"))
Level of detail
The page var produces, level 2
Example 7
#domain("Ende")[ #var("F", 0.55, "kN") ]
#var("F", domain: "Ende")

The three levels print the same page.

The page var produces, level 2
Example 8
#var("s_k", 1.394, "kN/m²", domain: ("snow-load", "SL"))
Level of detail
The page var produces, level 2
Example 9
#var("R_k", 7, "kN", label: "Kapazität Sherpa XS", descr: "Aus dem Katalog des Herstellers", norm: "Sherpa", norm-section: "ETA-12/0197", label-position: "after", norm-position: "line-right", level: 3)
The page var produces, level 2
Example 10
#var("gamma_M", 1.7, label: "Teilsicherheitsbeiwert", label-position: "before", norm: "SIA 265", norm-section: "2.2.5", norm-position: "in-line")

The three levels print the same page.

The page var produces, level 2
Example 11
#var("k_dens", 0.806, level: 0)
#var("R_k", 7, "kN", level: 0)
#eq("R_d", `k_dens dot R_k`)
Level of detail
The page var produces, level 2
Example 12
#var("R_d", 4.969, "kN", style: "bold")

The three levels print the same page.

The page var produces, level 2
Example 13
#var("W_y_erf", "W_(y,erf)", 12.5, "cm³")

The three levels print the same page.

The page var produces, level 2

Defined in lib/formula.typ:1381