fixed right aligned warning signs
This commit is contained in:
parent
9faf959212
commit
241898eb38
1 changed files with 49 additions and 17 deletions
66
main.typ
66
main.typ
|
|
@ -10,10 +10,10 @@
|
|||
title: ("Die Methan-Mamba"),
|
||||
title_fontsize: (25pt),
|
||||
signs_gridlength: 9,
|
||||
ghs_signs: (1,2,3,4,5,),
|
||||
fire_signs: (1,),
|
||||
warning_signs: (1,1,1),
|
||||
mandatory_actions_signs: (1,1,1,),
|
||||
ghs_signs: (1,2,2),
|
||||
fire_signs: (1,2,3,4,1,1,2,2,2,2,23,4,5,1,),
|
||||
warning_signs: (1,6,2),
|
||||
mandatory_actions_signs: (),
|
||||
tablebreak_bias: (6),
|
||||
step_descriptions: ("adwa", "asdwa"),
|
||||
step_image_paths: (),
|
||||
|
|
@ -24,8 +24,8 @@
|
|||
materials: ((amount: "20", name: "fischascwd"),(amount: "20", name: "fischascwd")),
|
||||
chemicals: ((amount: "20", name: "fischascwd"),(amount: "20", name: "fischascwd")),
|
||||
safety_notices: ("asdw",),
|
||||
observation: ["asdwa",],
|
||||
interpretation: [],
|
||||
observation: ["Hier gibt es etwas zu sehen",],
|
||||
interpretation: ["Hier sind die Gründe dafür"],
|
||||
doc
|
||||
) = {
|
||||
|
||||
|
|
@ -127,8 +127,29 @@ let figures = image_paths.map(path => block(
|
|||
|
||||
|
||||
let signgrid = (range(0, signs_gridlength).map(_ => 1fr))
|
||||
let fillerrow1 = calc.clamp(0,signs_gridlength - ghs_signs.len(),1000)
|
||||
let fillerrow2 = calc.clamp(0,signs_gridlength - (fire_signs.len() + warning_signs.len() + mandatory_actions_signs.len()),1000)
|
||||
|
||||
//Convert signs to images
|
||||
let ghs_signs = ghs_signs.map(x => ghs(x))
|
||||
|
||||
let other_signs = (fire_signs.map(x => fire-sign(x)) +
|
||||
warning_signs.map(x => warning-sign(x)) +
|
||||
mandatory_actions_signs.map(x => mandatory-actions-sign(x)))
|
||||
|
||||
//Calculate rows needed
|
||||
let num_ghsrows = calc.ceil(ghs_signs.len() / signs_gridlength)
|
||||
let num_othersigns = calc.ceil(other_signs.len() / signs_gridlength)
|
||||
|
||||
// fill with emptys to fill from right to left
|
||||
for x in range(0, signs_gridlength * num_ghsrows - ghs_signs.len() ) {
|
||||
ghs_signs.insert(signs_gridlength * (num_ghsrows - 1), [])
|
||||
}
|
||||
|
||||
for x in range(0, signs_gridlength * num_othersigns - other_signs.len() ) {
|
||||
other_signs.insert(signs_gridlength * (num_othersigns - 1), [])
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
grid(
|
||||
columns: (1fr, 1fr),
|
||||
|
|
@ -143,18 +164,13 @@ grid(
|
|||
grid(
|
||||
columns: signgrid,
|
||||
rows: auto,
|
||||
..(grid.cell(y: 0)[],) * fillerrow1,
|
||||
..(ghs_signs.map(x => ghs(x)))
|
||||
..(ghs_signs)
|
||||
),
|
||||
|
||||
grid(
|
||||
inset: (left: 1.5pt,right: 1.5pt,top: 1.5pt,bottom: 0pt),
|
||||
columns: signgrid,
|
||||
rows: auto,
|
||||
..(grid.cell(y: 0)[],) * fillerrow2,
|
||||
..(fire_signs.map(x => fire-sign(x)) +
|
||||
warning_signs.map(x => warning-sign(x)) +
|
||||
mandatory_actions_signs.map(x => mandatory-actions-sign(x)))
|
||||
..(other_signs)
|
||||
)
|
||||
))
|
||||
|
||||
|
|
@ -201,13 +217,14 @@ grid(
|
|||
|
||||
),
|
||||
grid(
|
||||
rows: (auto,),
|
||||
text("Übersicht", weight: "bold"),
|
||||
v(0.4cm),
|
||||
|
||||
my-subfig(
|
||||
..figures,
|
||||
columns: (auto, auto),
|
||||
),
|
||||
v(0.1cm)
|
||||
),
|
||||
)
|
||||
|
||||
|
|
@ -238,6 +255,7 @@ grid(
|
|||
text("Observation", weight: "bold"),
|
||||
v(0.4cm),
|
||||
observation,
|
||||
v(0.2cm),
|
||||
),
|
||||
)
|
||||
|
||||
|
|
@ -249,7 +267,21 @@ grid(
|
|||
rows: (auto),
|
||||
text("Interpretation", weight: "bold"),
|
||||
v(0.4cm),
|
||||
interpretation
|
||||
interpretation,
|
||||
v(0.2cm),
|
||||
),
|
||||
)
|
||||
|
||||
grid(
|
||||
columns: (1fr),
|
||||
stroke: (bottom:0.5pt + black),
|
||||
inset: (top: 0pt, bottom: 5pt, left: 5pt, right: 5pt),
|
||||
grid(
|
||||
rows: (auto),
|
||||
text("Entsorgung", weight: "bold"),
|
||||
v(0.4cm),
|
||||
str(num_ghsrows),
|
||||
v(0.2cm),
|
||||
),
|
||||
)
|
||||
// Safety Notices
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue