Refactor templates for consistency and clarity.
This commit is contained in:
10
.zed/settings.json
Normal file
10
.zed/settings.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"lsp": {
|
||||
"tinymist": {
|
||||
"settings": {
|
||||
"exportPdf": "onSave",
|
||||
"outputPath": "$root/$dir/$name"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -47,7 +47,8 @@
|
||||
#align(left)[#text(lang: "en")[
|
||||
- Pigment: 30
|
||||
- Sol-1: 60
|
||||
- Super Disp.: 10]]
|
||||
- Super Disp.: 10
|
||||
]]
|
||||
|
||||
تستها شامل:
|
||||
- بررسی کیفیت سطح
|
||||
|
||||
@@ -51,10 +51,14 @@
|
||||
|
||||
#report-table(
|
||||
columns: (1.3fr, 2.2fr),
|
||||
[*کد نمونه*], [*نتیجه*],
|
||||
[KRBR-1201T], [شدت رنگ بیشتر],
|
||||
[KRBR-1202T], [شدت رنگ بیشتر],
|
||||
[ICJ/408], [شدت رنگ بیشتر],
|
||||
[*کد نمونه*],
|
||||
[*نتیجه*],
|
||||
[KRBR-1201T],
|
||||
[شدت رنگ بیشتر],
|
||||
[KRBR-1202T],
|
||||
[شدت رنگ بیشتر],
|
||||
[ICJ/408],
|
||||
[شدت رنگ بیشتر],
|
||||
)
|
||||
|
||||
بین نمونههای قهوهای، ICJ/408 بیشترین شدت رنگ را دارد. کد KRBR-1202T به نمونه رفرنس نزدیکتر است.
|
||||
@@ -63,12 +67,18 @@
|
||||
|
||||
#report-table(
|
||||
columns: (1.3fr, 2.2fr),
|
||||
[*کد نمونه*], [*نتیجه*],
|
||||
[KRBG-1600T], [تم رنگ تیرهتر],
|
||||
[KRHN-1700T], [تم رنگ تیرهتر],
|
||||
[KRGY-1900T], [تم رنگ تیرهتر],
|
||||
[KRGY-1901T], [مشابه رفرنس (کمی تیرهتر)],
|
||||
[KRYL-1400T], [زردی بیشتر],
|
||||
[*کد نمونه*],
|
||||
[*نتیجه*],
|
||||
[KRBG-1600T],
|
||||
[تم رنگ تیرهتر],
|
||||
[KRHN-1700T],
|
||||
[تم رنگ تیرهتر],
|
||||
[KRGY-1900T],
|
||||
[تم رنگ تیرهتر],
|
||||
[KRGY-1901T],
|
||||
[مشابه رفرنس (کمی تیرهتر)],
|
||||
[KRYL-1400T],
|
||||
[زردی بیشتر],
|
||||
)
|
||||
|
||||
#colbreak()
|
||||
@@ -77,13 +87,20 @@
|
||||
|
||||
#report-table(
|
||||
columns: (1.3fr, 2.2fr),
|
||||
[*کد نمونه*], [*نتیجه*],
|
||||
[ICJ/610], [تم سبز],
|
||||
[ICJ/EH600], [تم قهوهای],
|
||||
[ICJ/EH630], [تم قهوهای],
|
||||
[ICJ/EH680], [کمترین شدت رنگ، تم قهوهای],
|
||||
[KRBL-1300T], [تم سبز],
|
||||
[KRBL-1314T], [بیشترین شدت رنگ],
|
||||
[*کد نمونه*],
|
||||
[*نتیجه*],
|
||||
[ICJ/610],
|
||||
[تم سبز],
|
||||
[ICJ/EH600],
|
||||
[تم قهوهای],
|
||||
[ICJ/EH630],
|
||||
[تم قهوهای],
|
||||
[ICJ/EH680],
|
||||
[کمترین شدت رنگ، تم قهوهای],
|
||||
[KRBL-1300T],
|
||||
[تم سبز],
|
||||
[KRBL-1314T],
|
||||
[بیشترین شدت رنگ],
|
||||
)
|
||||
]
|
||||
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
company: "کیمیا رازی",
|
||||
title: "گزارش تست مواد اولیه",
|
||||
subtitle: "دپارتمان جوهر",
|
||||
destinations: (none),
|
||||
destinations: none,
|
||||
purpose: none,
|
||||
authors: ("دیاکو سلطانپور"),
|
||||
authors: "دیاکو سلطانپور",
|
||||
date: "",
|
||||
doc,
|
||||
) = {
|
||||
@@ -28,27 +28,34 @@
|
||||
|
||||
set text(
|
||||
font: font,
|
||||
size: fontsize
|
||||
size: fontsize,
|
||||
)
|
||||
set page(
|
||||
paper: "a4",
|
||||
header:
|
||||
context {if counter(page).get().first() > 1 [
|
||||
header: context {
|
||||
if counter(page).get().first() > 1 [
|
||||
#grid(
|
||||
gutter: 5pt,
|
||||
columns: (4.2%, 25%, 3%, 20%),
|
||||
grid.cell(align: right, stroke: 1pt, image(height: 19pt,"kimia razi logo bw.png")),
|
||||
grid.cell(align: right, stroke: 1pt, image(
|
||||
height: 19pt,
|
||||
"kimia razi logo bw.png",
|
||||
)),
|
||||
align: top + right,
|
||||
title,
|
||||
"|",
|
||||
subtitle,
|
||||
grid.hline(start: 0),)]},
|
||||
grid.hline(start: 0),
|
||||
)]
|
||||
},
|
||||
background: place(
|
||||
dx: -54%,
|
||||
dy: 63.5%,
|
||||
rotate(
|
||||
-90deg,
|
||||
text(13pt,font: "IRZar",
|
||||
text(
|
||||
13pt,
|
||||
font: "IRZar",
|
||||
// TODO: do not use grid. use #text and fr if possible
|
||||
grid(
|
||||
columns: (15%, 25%, 40%, 5%),
|
||||
@@ -57,17 +64,18 @@
|
||||
context [
|
||||
#h(1fr) #company #h(2fr)|],
|
||||
[#h(2fr) #title #h(4fr)|],
|
||||
[#h(2fr)#destinations.map(destination => destination.name).join("\n") #h(2fr)],
|
||||
grid.cell(fill: black,
|
||||
align: center,
|
||||
stroke: 1pt,
|
||||
text(fill: white,
|
||||
context(counter(page).display("۱/۱", both: true,)))),
|
||||
[#h(2fr)#(
|
||||
destinations.map(destination => destination.name).join("\n")
|
||||
) #h(2fr)],
|
||||
grid.cell(fill: black, align: center, stroke: 1pt, text(
|
||||
fill: white,
|
||||
context (counter(page).display("۱/۱", both: true)),
|
||||
)),
|
||||
grid.hline(start: 0),
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
set document(
|
||||
title: title,
|
||||
@@ -106,7 +114,7 @@
|
||||
show heading: it => [
|
||||
#set align(right)
|
||||
#counter(heading).display(
|
||||
it.numbering
|
||||
it.numbering,
|
||||
) #it.body
|
||||
#v(10pt)
|
||||
]
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
company: "کیمیا رازی",
|
||||
title: "گزارش تست مواد اولیه",
|
||||
subtitle: "دپارتمان جوهر",
|
||||
destinations: (none),
|
||||
destinations: none,
|
||||
purpose: none,
|
||||
authors: ("دیاکو سلطانپور"),
|
||||
authors: "دیاکو سلطانپور",
|
||||
date: "",
|
||||
doc,
|
||||
) = {
|
||||
@@ -28,27 +28,34 @@
|
||||
|
||||
set text(
|
||||
font: font,
|
||||
size: fontsize
|
||||
size: fontsize,
|
||||
)
|
||||
set page(
|
||||
paper: "a4",
|
||||
header:
|
||||
context {if counter(page).get().first() > 1 [
|
||||
header: context {
|
||||
if counter(page).get().first() > 1 [
|
||||
#grid(
|
||||
gutter: 5pt,
|
||||
columns: (4.2%, 25%, 3%, 20%),
|
||||
grid.cell(align: right, stroke: 1pt, image(height: 19pt,"kimia razi logo bw.png")),
|
||||
grid.cell(align: right, stroke: 1pt, image(
|
||||
height: 19pt,
|
||||
"kimia razi logo bw.png",
|
||||
)),
|
||||
align: top + right,
|
||||
title,
|
||||
"|",
|
||||
subtitle,
|
||||
grid.hline(start: 0),)]},
|
||||
grid.hline(start: 0),
|
||||
)]
|
||||
},
|
||||
background: place(
|
||||
dx: -54%,
|
||||
dy: 63.5%,
|
||||
rotate(
|
||||
-90deg,
|
||||
text(13pt,font: "IRZar",
|
||||
text(
|
||||
13pt,
|
||||
font: "IRZar",
|
||||
// TODO: do not use grid. use #text and fr if possible
|
||||
grid(
|
||||
columns: (15%, 25%, 40%, 5%),
|
||||
@@ -57,33 +64,48 @@
|
||||
context [
|
||||
#h(1fr) #company #h(2fr)|],
|
||||
[#h(2fr) #title #h(4fr)|],
|
||||
[#h(2fr)#destinations.map(destination => destination.name).join("\n") #h(2fr)],
|
||||
grid.cell(fill: black,
|
||||
align: center,
|
||||
stroke: 1pt,
|
||||
text(fill: white,
|
||||
context(counter(page).display("۱/۱", both: true,)))),
|
||||
[#h(2fr)#(
|
||||
destinations.map(destination => destination.name).join("\n")
|
||||
) #h(2fr)],
|
||||
grid.cell(fill: black, align: center, stroke: 1pt, text(
|
||||
fill: white,
|
||||
context (counter(page).display("۱/۱", both: true)),
|
||||
)),
|
||||
grid.hline(start: 0),
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
set document(
|
||||
title: title,
|
||||
author: authors.map(author => author.name),
|
||||
)
|
||||
// ===== TITLE SECTION =====
|
||||
block(width: 100%)[
|
||||
#grid(
|
||||
columns: (auto, auto, 1fr),
|
||||
align: top,
|
||||
[
|
||||
#align(right)[
|
||||
#set par(leading: 0.9em, spacing: 0em)
|
||||
#text(21pt, font: font, weight: "bold", strong(company))
|
||||
#if subtitle != none and subtitle != "" {
|
||||
text(14pt, " | " + subtitle)
|
||||
}
|
||||
#linebreak()
|
||||
#text(14pt, strong(title))
|
||||
]
|
||||
],
|
||||
[],
|
||||
[#align(left, image(
|
||||
"template_files/kimia razi logo bw.png",
|
||||
height: 1.8cm,
|
||||
))],
|
||||
)
|
||||
]
|
||||
line(length: 100%)
|
||||
|
||||
set align(right)
|
||||
if subtitle != none {
|
||||
text(align(center,{strong(company)}))
|
||||
}
|
||||
text(18pt, align(center,{strong(title)}))
|
||||
set text(13pt, font: "IRLotus")
|
||||
if subtitle != none {
|
||||
text(align(center,{subtitle}))
|
||||
}
|
||||
align(center, line(length: 100%))
|
||||
// set heading(numbering: "۱.۱- ")
|
||||
set math.equation(numbering: "(1)")
|
||||
set footnote(numbering: "۱.")
|
||||
@@ -118,15 +140,13 @@
|
||||
#let test_result_table(cols) = {
|
||||
block(
|
||||
breakable: false,
|
||||
align(center,
|
||||
table(
|
||||
align(center, table(
|
||||
columns: (auto,) * (cols.first().len()),
|
||||
inset: 8pt,
|
||||
stroke: 0.5pt,
|
||||
fill: (x, y) => if y == 0 { luma(230) },
|
||||
..cols.flatten(),
|
||||
)
|
||||
)
|
||||
)),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -179,7 +199,13 @@
|
||||
// "۹",
|
||||
// "Esmaltes",
|
||||
// )
|
||||
#let general_info_table(received_date, report_date, sample_type, sample_count, supplier) = {
|
||||
#let general_info_table(
|
||||
received_date,
|
||||
report_date,
|
||||
sample_type,
|
||||
sample_count,
|
||||
supplier,
|
||||
) = {
|
||||
grid(
|
||||
columns: (auto, auto),
|
||||
inset: 10pt,
|
||||
@@ -197,8 +223,7 @@
|
||||
#let received_samples_table(rows) = {
|
||||
block(
|
||||
breakable: false,
|
||||
align(center,
|
||||
table(
|
||||
align(center, table(
|
||||
columns: (auto, auto, auto, auto),
|
||||
align: right,
|
||||
stroke: 0.5pt,
|
||||
@@ -209,8 +234,7 @@
|
||||
[*کد داخلی*],
|
||||
[*شماره سند*],
|
||||
..rows.flatten(),
|
||||
)
|
||||
)
|
||||
)),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -5,16 +5,16 @@
|
||||
)
|
||||
|
||||
#let destination-names(destinations) = {
|
||||
if destinations == none { "" }
|
||||
else { destinations.map(d => d.name).join(" - ") }
|
||||
if destinations == none { "" } else {
|
||||
destinations.map(d => d.name).join(" - ")
|
||||
}
|
||||
}
|
||||
|
||||
#let report-meta-row(label-width, label, value) = grid(
|
||||
columns: (label-width, 1fr),
|
||||
gutter: (2em, 0pt),
|
||||
align: right + top,
|
||||
[#label],
|
||||
[#strong(value)],
|
||||
[#label], [#strong(value)],
|
||||
)
|
||||
|
||||
#let report-meta-label-width = 8em
|
||||
@@ -41,24 +41,28 @@
|
||||
set page(
|
||||
margin: (left: 2cm, right: 2cm, top: 2.5cm, bottom: 2.5cm),
|
||||
paper: "a4",
|
||||
header:
|
||||
context {if counter(page).get().first() > 1 [
|
||||
header: context {
|
||||
if counter(page).get().first() > 1 [
|
||||
#grid(
|
||||
gutter: 5pt,
|
||||
columns: (auto, 1fr, auto, auto),
|
||||
grid.cell(align: right, stroke: 1pt, image(height: 19pt,"template_files/kimia razi logo bw.png")),
|
||||
grid.cell(align: right, stroke: 1pt, image(
|
||||
height: 19pt,
|
||||
"template_files/kimia razi logo bw.png",
|
||||
)),
|
||||
align: top + right,
|
||||
company,
|
||||
"|",
|
||||
subtitle,
|
||||
grid.hline(start: 0),)]},
|
||||
grid.hline(start: 0),
|
||||
)]
|
||||
},
|
||||
background: place(
|
||||
dx: -64%,
|
||||
dy: 73%,
|
||||
rotate(
|
||||
-90deg,
|
||||
text(13pt, font: fonts.sidebar,
|
||||
grid(
|
||||
text(13pt, font: fonts.sidebar, grid(
|
||||
columns: (30%, 30%, 5%),
|
||||
rows: 20pt,
|
||||
align: top,
|
||||
@@ -74,15 +78,13 @@
|
||||
side_authors = authors.first().name + " و ..."
|
||||
}
|
||||
#h(1fr) #side_authors #h(4fr)],
|
||||
grid.cell(fill: black,
|
||||
align: center,
|
||||
stroke: 1pt,
|
||||
text(fill: white,
|
||||
context(counter(page).display("۱/۱", both: true,)))),
|
||||
grid.cell(fill: black, align: center, stroke: 1pt, text(
|
||||
fill: white,
|
||||
context (counter(page).display("۱/۱", both: true)),
|
||||
)),
|
||||
grid.hline(start: 0),
|
||||
)
|
||||
)
|
||||
)
|
||||
)),
|
||||
),
|
||||
),
|
||||
numbering: "۱",
|
||||
)
|
||||
@@ -104,7 +106,10 @@
|
||||
]
|
||||
],
|
||||
[],
|
||||
[#align(left, image("template_files/kimia razi logo bw.png", height: 1.8cm))],
|
||||
[#align(left, image(
|
||||
"template_files/kimia razi logo bw.png",
|
||||
height: 1.8cm,
|
||||
))],
|
||||
)
|
||||
]
|
||||
set align(right)
|
||||
@@ -115,9 +120,17 @@
|
||||
#set par(leading: 0.9em, spacing: 0em)
|
||||
#stack(
|
||||
spacing: 14pt,
|
||||
report-meta-row(report-meta-label-width, [مقصد:], destination-names(destinations)),
|
||||
report-meta-row(
|
||||
report-meta-label-width,
|
||||
[مقصد:],
|
||||
destination-names(destinations),
|
||||
),
|
||||
report-meta-row(report-meta-label-width, [هدف مأموریت:], purpose),
|
||||
report-meta-row(report-meta-label-width, [تیم اعزامی:], authors.map(author => author.name).join(" - ")),
|
||||
report-meta-row(
|
||||
report-meta-label-width,
|
||||
[تیم اعزامی:],
|
||||
authors.map(author => author.name).join(" - "),
|
||||
),
|
||||
report-meta-row(report-meta-label-width, [تاریخ:], date),
|
||||
)
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user