summaryrefslogtreecommitdiffstats
path: root/g.tmac
diff options
context:
space:
mode:
authorGalin Simeonov <gts@volconst.com>2021-05-28 23:20:22 +0300
committerGalin Simeonov <gts@volconst.com>2021-05-28 23:20:22 +0300
commit312eb6e589c67f954ba676fb7a04ab8d06827033 (patch)
tree356d05b4ec7443d848ee670af102952bf9e09542 /g.tmac
parentee9d3272aa67de912eb1f015b62ba128fbb1a974 (diff)
downloadmg-312eb6e589c67f954ba676fb7a04ab8d06827033.tar.gz
added multi level headings
Diffstat (limited to 'g.tmac')
-rw-r--r--g.tmac37
1 files changed, 34 insertions, 3 deletions
diff --git a/g.tmac b/g.tmac
index 98693c5..fa5b6f5 100644
--- a/g.tmac
+++ b/g.tmac
@@ -5,7 +5,10 @@
\#########################################################################
.nr paragraph_indentation 2.3
\#########################################################################
-.nr heading_current_number 1
+.nr heading_current_number_1 0
+.nr heading_current_number_2 0
+.nr heading_current_number_3 0
+.nr heading_current_number_4 0
.ds heading_style DIGIT
\#########################################################################
.nr footnote_current_number 0
@@ -97,6 +100,7 @@
..
\#########################################################################
.de finish
+.main_diversion
.references
\#.plainpage end
..
@@ -135,9 +139,36 @@
\}
.el
.if '\\*[heading_style]'DIGIT' \{\
-\f[B] \\n[heading_current_number].
+\f[B]
+.if \\$2<=1 \{\
+.nr heading_current_number_1 +1
+.nr heading_current_number_2 0
+.nr heading_current_number_3 0
+.nr heading_current_number_4 0
+\\n[heading_current_number_1].
+\}
+.if '\\$2'2' \{\
+.nr heading_current_number_2 +1
+.nr heading_current_number_3 0
+.nr heading_current_number_4 0
+\\n[heading_current_number_1].
+\\n[heading_current_number_2].
+\}
+.if '\\$2'3' \{\
+.nr heading_current_number_3 +1
+.nr heading_current_number_4 0
+\\n[heading_current_number_1].
+\\n[heading_current_number_2].
+\\n[heading_current_number_3].
+\}
+.if '\\$2'4' \{\
+.nr heading_current_number_4 +1
+\\n[heading_current_number_1].
+\\n[heading_current_number_2].
+\\n[heading_current_number_3].
+\\n[heading_current_number_4].
+\}
\\$1 \f[]
-.nr heading_current_number +1
\}
.br
..