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.
keyrequiredThe name calculations cite: letters, digits and _.
symboloptionalThe math source printed in the name's place.
valueoptional · default noneThe number. Left out, the line prints a variable already noted.
valueoptional · default nonenoneFree text, for example:
#var("k_dens", 0.806)unitoptional · default noneThe value's unit. On a line printing a variable again, the unit for that line alone.
unitoptional · default nonenoneFree text, for example:
#var("q_k", 1.729, "kN/m²")domainoptional · default noneWhere the value is read instead of written.
domainoptional · default nonenonea value written here("calcul", "cas")a calculation of the export and its case"id"a #domain of the report, aboveHover a value: its call and what it prints.
#var("s_k", 1.4, "kN/m²")What it prints
#var("s_k", domain: ("snow-load", "SL"))What it prints
#domain("ende", level: 0)[#var("F", 0.55, "kN")]
The force is #var("F", domain: "ende").What it prints
Compiled once by Woodcore's engine, on the examples' frozen data.
displayoptional · default autoWhat the line prints.
displayoptional · 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("M_d", 14.06, "kNm", display: auto)What it prints
Prints the same as "variable-value-unit".
#var("M_d", 14.06, "kNm", display: "none")What it prints
Nothing is printed.
#var("M_d", 14.06, "kNm", display: "variable")What it prints
#var("M_d", 14.06, "kNm", display: "value")What it prints
#var("M_d", 14.06, "kNm", display: "value-unit")What it prints
#var("M_d", 14.06, "kNm", display: "variable-value-unit")What it prints
Prints the same as auto.
Compiled once by Woodcore's engine, on the examples' frozen data.
styleoptional · default autoHow the line 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("M_d", 14.06, "kNm", style: auto)What it prints
Prints the same as "normal".
#var("M_d", 14.06, "kNm", style: "normal")What it prints
Prints the same as auto.
#var("M_d", 14.06, "kNm", style: "bold")What it prints
#var("M_d", 14.06, "kNm", style: "underline")What it prints
#var("M_d", 14.06, "kNm", style: "double")What it prints
Compiled once by Woodcore's engine, on the examples' frozen data.
labeloptional · default noneWhat the value is, in words.
labeloptional · default nonenoneFree text, for example:
label: "Expositionsbeiwert"label-positionoptional · default autoWhere the 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("M_d", 14.06, "kNm", label: "Design moment", label-position: auto)What it prints
Prints the same as "footnote".
#var("M_d", 14.06, "kNm", label: "Design moment", label-position: "none")What it prints
#var("M_d", 14.06, "kNm", label: "Design moment", label-position: "before")What it prints
#var("M_d", 14.06, "kNm", label: "Design moment", label-position: "after")What it prints
#var("M_d", 14.06, "kNm", 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 this value.
descroptional · default nonenoneFree text, for example:
descr: "Aus dem Katalog des Herstellers"descr-positionoptional · default autoWhere the 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("M_d", 14.06, "kNm", descr: "at midspan", descr-position: auto)What it prints
Prints the same as "none".
#var("M_d", 14.06, "kNm", descr: "at midspan", descr-position: "none")What it prints
Prints the same as auto.
#var("M_d", 14.06, "kNm", descr: "at midspan", descr-position: "after")What it prints
#var("M_d", 14.06, "kNm", descr: "at midspan", descr-position: "footnote")What it prints
Compiled once by Woodcore's engine, on the examples' frozen data.
normoptional · default noneThe norm cited.
normoptional · default nonenoneFree text, for example:
norm: "SIA 265"norm-sectionoptional · default noneThe clause or table cited.
norm-sectionoptional · default nonenoneFree text, for example:
norm-section: "6.5.5.2"norm-positionoptional · default autoWhere the 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("M_d", 14.06, "kNm", norm: "SIA 265", norm-section: "4.2.3", norm-position: auto)What it prints
Prints the same as "none".
#var("M_d", 14.06, "kNm", norm: "SIA 265", norm-section: "4.2.3", norm-position: "none")What it prints
Prints the same as auto.
#var("M_d", 14.06, "kNm", norm: "SIA 265", norm-section: "4.2.3", norm-position: "in-line")What it prints
#var("M_d", 14.06, "kNm", norm: "SIA 265", norm-section: "4.2.3", norm-position: "line-right")What it prints
#var("M_d", 14.06, "kNm", 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.
roleoptional · default autoWhat the value is to the calculation;
#var-table sorts by it. Default: data.roleoptional · default autoautodata, for #var"data"a datum"compute"an intermediate value"result"a resultHover a value: its call and what it prints.
#var("M_d", 14.06, "kNm", label: "Design moment", role: auto)What it prints
The role does not change the line: it tells #var-table where to file it.
#var("M_d", 14.06, "kNm", label: "Design moment", role: "data")What it prints
The role does not change the line: it tells #var-table where to file it.
#var("M_d", 14.06, "kNm", label: "Design moment", role: "compute")What it prints
The role does not change the line: it tells #var-table where to file it.
#var("M_d", 14.06, "kNm", 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 line by, wherever it is moved. Once per domain.
idoptional · default nonenoneFree text, for example:
id: "q_k1"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 line2also the label3also the description and citationHover a value: its call and what it prints.
#var("M_d", 14.06, "kNm", 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("M_d", 14.06, "kNm", label: "Design moment", descr: "at midspan", norm: "SIA 265", norm-section: "4.2.3", level: 0)What it prints
Nothing is printed.
#var("M_d", 14.06, "kNm", label: "Design moment", descr: "at midspan", norm: "SIA 265", norm-section: "4.2.3", level: 1)What it prints
#var("M_d", 14.06, "kNm", 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("M_d", 14.06, "kNm", 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
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 elsewhere
domain: reads a value of the export or of a #domain of the report.Hide
level: 0 stores the value and prints nothing: a factor the page does not show.Arguments
| Argument | Status | What 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 symboldisplay: "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 onstyle: "bold"in bold, the whole line | |
| Label and description | ||
| optional | What the value is, in words. label: "Expositionsbeiwert"the label, printed as label-position sayslabel: "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 fromdescr: "Feuchteklasse 1"the choice that sets it | |
| optional | Where the description goes. descr-position: "after"in brackets, after the linedescr-position: "footnote"in the line's footnote, with the label | |
| Citation | ||
| optional | The norm cited. norm: "SIA 265"a normnorm: "Sherpa"a manufacturer's catalogue | |
| optional | The clause or table cited. norm-section: "6.5.5.2"a clausenorm-section: "Tabelle 8"a tablenorm-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 columnnorm-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 resultsrole: "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 exportid: "R_k"found by typst query too | |
| optional | The line's level of detail. An argument written wins. level: 0stored, not printedlevel: 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
#var("R_k", 7, "kN")The three levels print the same page.
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.
#var("q_k11", "q_(k,11)", 1.729, "kN/m²")The three levels print the same page.
#var("s_k", domain: ("snow-load", "SL"))Level of detail
#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
#var("s_k", domain: ("snow-load", "SL"))Level of detail
#domain("Ende")[ #var("F", 0.55, "kN") ]
#var("F", domain: "Ende")The three levels print the same page.
#var("s_k", 1.394, "kN/m²", domain: ("snow-load", "SL"))Level of detail
#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)#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.
#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
#var("R_d", 4.969, "kN", style: "bold")The three levels print the same page.
#var("W_y_erf", "W_(y,erf)", 12.5, "cm³")The three levels print the same page.
Defined in lib/formula.typ:1381