Refactor heading display logic in product test template
This commit is contained in:
@@ -109,8 +109,6 @@
|
|||||||
))],
|
))],
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
line(length: 100%)
|
|
||||||
|
|
||||||
// set heading(numbering: "۱.۱- ")
|
// set heading(numbering: "۱.۱- ")
|
||||||
set math.equation(numbering: "(1)")
|
set math.equation(numbering: "(1)")
|
||||||
set footnote(numbering: "۱.")
|
set footnote(numbering: "۱.")
|
||||||
@@ -118,11 +116,24 @@
|
|||||||
set footnote.entry(indent: 0em)
|
set footnote.entry(indent: 0em)
|
||||||
set align(right)
|
set align(right)
|
||||||
|
|
||||||
show heading: it => [
|
show heading: it => context {
|
||||||
#set align(right)
|
let y = here().position().y
|
||||||
#it.body
|
let body-top = if counter(page).get().first() > 1 {
|
||||||
#v(10pt)
|
page.margin.top + 28pt
|
||||||
]
|
} else {
|
||||||
|
page.margin.top
|
||||||
|
}
|
||||||
|
let not-at-top = y > body-top + 12pt
|
||||||
|
[
|
||||||
|
#if not-at-top and it.level <= 2 [
|
||||||
|
#line(length: 100%)
|
||||||
|
#v(8pt)
|
||||||
|
]
|
||||||
|
#set align(right)
|
||||||
|
#it.body
|
||||||
|
#v(10pt)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
set text(spacing: 100%)
|
set text(spacing: 100%)
|
||||||
set par(
|
set par(
|
||||||
|
|||||||
Reference in New Issue
Block a user