From 0d1f04b92b1f3c369036c4c17af53e23e5d2be4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Tue, 22 Jun 2021 20:30:15 +0200 Subject: Add toc.tmac --- toc/Makefile | 2 ++ toc/example.pdf | Bin 0 -> 9350 bytes toc/example.t | 30 ++++++++++++++++++++++++++++++ toc/toc | 2 ++ toc/toc.tmac | 21 +++++++++++++++++++++ 5 files changed, 55 insertions(+) create mode 100644 toc/Makefile create mode 100644 toc/example.pdf create mode 100644 toc/example.t create mode 100755 toc/toc create mode 100644 toc/toc.tmac (limited to 'toc') diff --git a/toc/Makefile b/toc/Makefile new file mode 100644 index 0000000..216673b --- /dev/null +++ b/toc/Makefile @@ -0,0 +1,2 @@ +example.pdf: example.t + ./toc example.t | groff -Tps example.t | ps2pdf - > example.pdf diff --git a/toc/example.pdf b/toc/example.pdf new file mode 100644 index 0000000..5f47889 Binary files /dev/null and b/toc/example.pdf differ diff --git a/toc/example.t b/toc/example.t new file mode 100644 index 0000000..e725a98 --- /dev/null +++ b/toc/example.t @@ -0,0 +1,30 @@ +.so toc.tmac +. +.de H +. ft B +. ps +2p +. vs +1p +. sp 12p +\&\\$* +. br +. ft +. ps +. vs +. te .toce \\n% \\$* +.. +. +.de toce +. nr _ \\$1 +. shift +. tl '\\$*''\\n_' +.. +. +.sp |1i +.to +.sp 12p +This is a demonstration of toc.tmac. +.br +.H Introduction +.H Background +.H Results +.H Summary diff --git a/toc/toc b/toc/toc new file mode 100755 index 0000000..e8de341 --- /dev/null +++ b/toc/toc @@ -0,0 +1,2 @@ +#!/bin/sh +troff -rT=1 -zE "$@" 2>&1 diff --git a/toc/toc.tmac b/toc/toc.tmac new file mode 100644 index 0000000..83e05a0 --- /dev/null +++ b/toc/toc.tmac @@ -0,0 +1,21 @@ +.\" "/. +.\" toc.tmac "/. +.\" "/. +.\" Permission to use, copy, modify and/or "/. +.\" distribute this software for any purpose "/. +.\" with or without fee is hereby granted. "/. +.\" "/. +. +.eo +. +.\" to -- evaluate collected lines +.de to +. if \nT=0 .rd +.. +. +.\" te -- collect line +.de te +. if \nT>0 .tm \$* +.. +. +.ec -- cgit v1.2.3