From d831434e95c6a3b33a8af04e630d34f078d26e4f Mon Sep 17 00:00:00 2001 From: Patryk Niedźwiedziński Date: Tue, 15 Jun 2021 23:30:05 +0200 Subject: Init --- tmac.toc | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 tmac.toc (limited to 'tmac.toc') diff --git a/tmac.toc b/tmac.toc new file mode 100644 index 0000000..ca6e29a --- /dev/null +++ b/tmac.toc @@ -0,0 +1,48 @@ +.\" generate toc +.de toc.gen +. nr toc.i \\$1 +. br +. mk +. nr toc.ll (\\n[.l]u-\w'\\*[toc.\\n[toc.i].name]') +. nr toc.ll (\\n[toc.ll]u-\w'\\n[toc.\\n[toc.i].num]') +. ad l +. post.url "#toc.\\n[toc.i]" "\\*[toc.\\n[toc.i].name]" +\v'-0em'\l'\\n[toc.ll]u.' +. br +. rt +. ad r +. br +\\n[toc.\\n[toc.i].num] +. nr toc.i +1 +. if !(\\n[toc.i]=\\n[toc.total]) \{\ +. sp 0.5 +. toc.gen \\n[toc.i] +. \} +.. +.\" add to toc +.de toc.mark +. post.mark "\\$*" +. post.name "toc.\\n[toc.idx]" +. tm INDEX.ds toc.\\n[toc.idx].name \\$* +. tm INDEX.nr toc.\\n[toc.idx].num \\n[.%] +. nr toc.idx +1 +. tm INDEX.nr toc.total \\n[toc.idx] +. tm INDEX.nr toc.init 1 +.. +.\" wraper for toc +.de toc +. nr toc.oldad \\n(.j +. if \\n[toc.init] \{\ +. sp +. ce +.ft B +.ps +2 +\\*[toc.tl] +.ft R +.sp 2 +. toc.gen 0 +. \} +. br +. ad \\n[toc.oldad] +.. +.ds toc.tl TABLE OF CONTENTS -- cgit 1.4.1