From 3abc2293ee79f0e7a57a21f25f1b7e2caae0aab8 Mon Sep 17 00:00:00 2001 From: danilasar Date: Sun, 5 Jan 2025 01:52:27 +0400 Subject: =?UTF-8?q?=D1=84=D0=B8=D0=BA=D1=81:=20=D0=B2=D1=80=D0=B5=D0=BC?= =?UTF-8?q?=D0=B5=D0=BD=D0=BD=D0=BE=D0=B5=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BA=D1=80=D0=B0=D1=81?= =?UTF-8?q?=D0=BD=D1=8B=D1=85=20=D1=81=D1=82=D1=80=D0=BE=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conf.typ | 67 ++++++++++++++-------------------------------------------------- 1 file changed, 14 insertions(+), 53 deletions(-) (limited to 'conf.typ') 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 - } - } - } ), /* -- cgit v1.2.3