summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanilasar <danila.sar@yandex.ru>2025-01-05 01:52:27 +0400
committerdanilasar <danila.sar@yandex.ru>2025-01-05 01:52:27 +0400
commit3abc2293ee79f0e7a57a21f25f1b7e2caae0aab8 (patch)
tree48a8588d2615eeeac84eebae72fd4eedb9ba2f5b
parentc52cc48036bdbfa84bdabea6e32972ad78a772d3 (diff)
фикс: временное исправление красных строк
-rw-r--r--conf.typ67
1 files changed, 14 insertions, 53 deletions
diff --git a/conf.typ b/conf.typ
index eb03436..787b4f9 100644
--- a/conf.typ
+++ b/conf.typ
@@ -14,7 +14,6 @@
*/
-
#let strings = (
title: (
minobrnauki: "МИНОБРНАУКИ РОССИИ\nФедеральное государственное бюджетное образовательное учреждение\nвысшего образования\n",
@@ -438,60 +437,22 @@
set figure(supplement: "Рис.")
set quote(block: true)
+ // todo проверить надёжность
+ // отвечает за красные строки там, где их нет, но они должны быть
+ show heading: it => {
+ it
+ ""
+ context v(-par.spacing - measure("").height)
+ }
+ show selector.or(heading, table, grid, figure): it => {
+ it
+ ""
+ context v(-par.spacing - measure("").height)
+ }
+
// Вывод самого документа
- (self.document.first_line_indentation)(self, doc)
+ doc
},
- /*
- * Подставляет красные строки в начала абзацев
- */
- first_line_indentation:
- (
- self,
- doc,
- last-is-heading: false, // space and parbreak are ignored
- indent-already-added: false,
- ) => {
- for (i, elem) in doc.children.enumerate() {
- let element = elem.func()
- if element == text {
- let previous-elem = doc.children.at(i - 1)
- if i == 0 or last-is-heading or previous-elem.func() == parbreak {
- if not indent-already-added {
- indent-already-added = true
- h(indent)
- }
- }
- elem
- } else if element == heading {
- indent-already-added = false
- last-is-heading = true
- elem
- } else if element == space {
- elem
- } else if element == parbreak {
- indent-already-added = false
- elem
- } else if element == sequence {
- (self.document.first_line_indentation)(
- self,
- elem,
- last-is-heading: last-is-heading,
- indent-already-added: indent-already-added,
- )
- } else if element == styled {
- styled((self.document.first_line_indentation)(
- self,
- elem.child,
- last-is-heading: last-is-heading,
- indent-already-added: indent-already-added,
- ), elem.styles)
- } else {
- indent-already-added = false
- last-is-heading = false
- elem
- }
- }
- }
),
/*