Commands › Calculating in the report
#unit Calculating in the report
Sets the unit computed answers of one dimension are printed in.
#unit(,
:
)Hover an argument: what it does. Hover its value: every possible value. A click keeps the bubble open.
writtenrequiredThe unit. It must have a dimension.
scopeoptional · default "next"How far it reaches.
scopeoptional · default "next""next"the next line only"domain"the rest of the domain"document"the rest of the documentHover a value: its call and what it prints.
#var("F", 12, "kN", level: 0)
#var("A", 2400, "mm²", level: 0)
#domain("a", label: "A")[
#unit("kN/cm²", scope: "next")
#eq("sigma_1", `F / A`)
#eq("sigma_2", `2 dot F / A`)
]
#eq("sigma_3", `3 dot F / A`)What it prints
#var("F", 12, "kN", level: 0)
#var("A", 2400, "mm²", level: 0)
#domain("a", label: "A")[
#unit("kN/cm²", scope: "domain")
#eq("sigma_1", `F / A`)
#eq("sigma_2", `2 dot F / A`)
]
#eq("sigma_3", `3 dot F / A`)What it prints
#var("F", 12, "kN", level: 0)
#var("A", 2400, "mm²", level: 0)
#domain("a", label: "A")[
#unit("kN/cm²", scope: "document")
#eq("sigma_1", `F / A`)
#eq("sigma_2", `2 dot F / A`)
]
#eq("sigma_3", `3 dot F / A`)What it prints
Compiled once by Woodcore's engine, on the examples' frozen data.
The essentials
One dimension
#unit("kN") reaches forces only; other answers keep theirs.Answers onlyA value written or read from the export keeps its unit.
Stress or loadN/mm² and kN/m² are one dimension: the default serves the stress.
Arguments
| Argument | Status | What it does, and examples |
|---|---|---|
| The line's arguments | ||
| required | The unit. It must have a dimension. #unit("kN")forces in kN#unit("kN/m²")area loads rather than stresses"%"refused: dimensionless | |
| optional | How far it reaches. scope: "document"the whole rest of the documentscope: "domain"the rest of the #domain it stands in | |
Defaults: mm, mm², mm³, mm⁴, s, kN, kNm, N/mm², kN/m, kg, °.
Lines to copy
Minimal call
#unit("kN")Complete call
#unit("kN", scope: "next")Examples
#var("F", 12, "kN")
#var("A", 2400, "mm²")
#unit("N/mm²")
#eq("sigma", `F / A`)#var("M", 4.2, "kNm")
#var("l", 3, "m")
#unit("N", scope: "document")
#eq("V", `M / l`)
#eq("V_2", `2 * M / l`)Defined in lib/formula.typ:1807