⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tmac.m

📁 早期freebsd实现
💻 M
📖 第 1 页 / 共 4 页
字号:
.	di.\}.el \{\.	da ft*div.	ft*tmp-div.	di.	nr ft*note-size +\\n[dn].\}.rm ft*tmp-div.ev.pg@move-trap...\"-----------------.\" print footnotes, see pg@footer.de ft@print.ev ft*print-ev'nf'in 0.ll 100i.ft*div.br.ev.rm ft*div.nr ft*note-size 0.pg@move-trap...\"-----------------.\" check if any pending footnotes, see pg@header.de ft@check-old.if d ft*next-div \{\.	ev ft*ev.	ft@init.	ft@init-footnote.	nf.	in 0.	da ft*div.	ft*next-div.	di.	nr ft*note-size +\\n[dn].	rm ft*next-div.	ev.	nr ft*exist 0.	pg@move-trap.\}...\"########### module display ###################.nr ds*wide 0\"		>0 if wide displays wanted.nr ds*fnr 0 1\"	floating display counter.nr ds*o-fnr 1\"	floating display counter, already printed.nr ds*snr 0 1\"	static display counter.nr ds*lvl 0 1\"	display level.nr ds*float-busy 0\"	>0 if printing float.nr ds*ffloat 0\"	>0 if DF, 0 if DS.\" static display start.\" nested DS/DE is allowed. No limit on depth..de DS.br.ds@start 0 DS \\$@...\" floating display start.\" nested DF/DE is not allowed..de DF.if \\n[ds*lvl] .@error "DF:nested floating is not allowed. Use DS.".ds@start 1 DF \\$@...\"---------------.nr ds*format 0\"	dummy value for .En/.EQ.nr ds*format! 0\"	no indent.nr ds*format!0 0\"	no indent.nr ds*format!L 0\"	no indent.nr ds*format!I 1\"	indent.nr ds*format!1 1\"	indent.nr ds*format!C 2\"	center each line.nr ds*format!2 2\"	center each line.nr ds*format!CB 3\"	center as block.nr ds*format!3 3\"	center as block.nr ds*format!R 4\"	right justify each line.nr ds*format!4 4\"	right justify each line.nr ds*format!RB 5\"	right justify as block.nr ds*format!5 5\"	right justify as block.\"---------------.nr ds*fill! 0\"	no fill.nr ds*fill!N 0\"	no fill.nr ds*fill!0 0\"	no fill.nr ds*fill!F 1\"	fill on.nr ds*fill!1 1\"	fill on.\"---------------.de ds@start.nr ds*ffloat \\$1.ds ds*type \\$2.shift 2.nr ds*lvl +1.\" get format of the display.ie \\n[.$] \{\.	ie r ds*format!\\$1 .nr ds*format \\n[ds*format!\\$1].	el .@error "\\*[ds*type]:wrong format:\\$1".\}.el .nr ds*format 0.\" fill or not to fill, that is the....nr ds*fill 0.ie \\n[.$]>1 \{\.	ie r ds*fill!\\$2 .nr ds*fill \\n[ds*fill!\\$2].	el .@error "\\*[ds*type]:wrong fill:\\$2".\}.nr ds*rindent 0.if \\n[.$]>2 .nr ds*rindent \\$3.\".\"---------------.nr ds*old-ll \\n[.l].misc@push ds-ll \\n[.l].misc@push ds-form \\n[ds*format].misc@push ds-ffloat \\n[ds*ffloat].nr ds*i \\n[.i].nr ds*ftmp \\n[.f].misc@ev-keep ds*ev!\\n+[ds*snr].ft \\n[ds*ftmp].\".init@reset'in \\n[ds*i]u.di ds*div!\\n[ds*snr].\".ll \\n[ds*old-ll]u.lt \\n[ds*old-ll]u.if \\n[ds*rindent] \{\.	ll -\\n[ds*rindent]n.	lt -\\n[ds*rindent]n.\}.if \\n[ds*wide] \{\.	ll \\n[@ll]u.	lt \\n[@ll]u.\}.\".ie \\n[ds*fill] 'fi.el 'nf.\".if \\n[ds*format]=1 \{\.	ll -\\n[Si]n.	lt -\\n[Si]n'	in +\\n[Si]n.\}.if (\\n[ds*format]=3):(\\n[ds*format]=5) 'in 0...\"---------------.de DE.if \\n-[ds*lvl]<0 .@error "DE: no corresponding DS or DF".br.if \\n[ds*ffloat] .SP \\n[Lsp]u.di.nr ds*width \\n[dl].nr ds*height \\n[dn].misc@pop-nr ds-ll ds*old-ll.misc@pop-nr ds-form ds*format.misc@pop-nr ds-ffloat ds*ffloat.if (\\n[ds*format]>=2)&(\\n[ds*width]>\\n[ds*old-ll]) \{\.	@error "DE: display too wide for current line-length".\}.\" prepare copy to floating display.if \\n[ds*ffloat] .di ds*fdiv!\\n+[ds*fnr].\"'in 0'nf.if \\n[ds*format]=2 'ce 9999.if \\n[ds*format]=3 'in (u;(\\n[ds*old-ll]-\\n[ds*width])/2).if \\n[ds*format]=4 'rj 9999.if \\n[ds*format]=5 'in (u;\\n[ds*old-ll]-\\n[ds*width]).\".ie !\\n[ds*ffloat] \{\.	\".	\"	Print static display.	\"	Eject page if display will fit one page and.	\"	there are less than half of the page left..	nr ds*i \\n[pg*foot-trap]-\\n[pg*header-size]v-\\n[pg*extra-header-size]v.	if (\\n[ds*height]>\\n[ds*i])&(\\n[.t]<(\\n[ds*i]/2)) \{\.		ne \\n[.t]u+1v.	\}.	if (\\n[ds*height]<\\n[ds*i])&(\\n[.t]<(\\n[ds*height])) \{\.		ne \\n[.t]u+1v.	\}.	if \\n[Ds] .SP \\n[Lsp]u.\}.el .SP \\n[Lsp]u.ds*div!\\n[ds*snr].ie !\\n[ds*ffloat] .if \\n[Ds] .SP \\n[Lsp]u.el \{\.	SP \\n[Lsp]u.	di.\}.if \\n[ds*format]=2 'ce 0.if \\n[ds*format]=4 'rj 0.rm ds*div!\\n[ds*snr].nr ds*snr -1.nr par@ind-flag 0.\"		move div to the floating display list.ev.if \\n[ds*ffloat] \{\.	nr ds*fsize!\\n[ds*fnr] \\n[dn].	\" print float if queue is empty and the display fits into.	\" the current page.	if (\\n[ds*fnr]>\\n[ds*o-fnr])&(\\n[ds*height]<\\n[.t]) \{\.		ds@print-float 1.	\}.\}...\"-------------.\" called by end-of-text.de ds@eot-print.if \\n[ds*o-fnr]<=\\n[ds*fnr] \{\.	if \\n[D]>2 .tm Print remaining displays..\" still some floats left, make non-empty environment.	misc@ev-keep ne.	init@reset\c.	ds@print-float 3.	ev.\}...\"---------------.\" print according to Df and De..\" .ds@print-float type.\"	type	called from.\"	1	.DE.\"	2	end of section.\"	3	end of document.\"	4	beginning of new page.\".de ds@print-float.if \\n[Df]>5 .@error "Df=\\n[Df], max value is 5".if !\\n[ds*float-busy] \{\.	nr ds*float-busy 1.\" at .DE.	if (\\$1=1)&((\\n[Df]%2)=1) \{\.		if \\n[.t]>\\n[ds*fsize!\\n[ds*fnr]] \{\.			\" Df = 1,3 or 5.			ds@print-one-float.		\}.	\}.\" print all if Df<2 and end of section.	if (\\$1=2)&(\\n[Df]<2) .ds@print-all-floats.\" print all if end of document. Where should they go instead?.	if \\$1=3 .ds@print-all-floats.\" new page.	if (\\$1=4)&(\\n[Df]>1) \{\.		if \\n[Df]=2 .ds@print-one-float.		if \\n[Df]=3 .ds@print-one-float.		if \\n[Df]>3 \{\.			ie \\n[De] .ds@print-all-floats.			el .ds@print-this-page.		\}.	\}.	nr ds*float-busy 0.\}...\"---------------.\" print a floating diversion.de ds@output-div.ev ds*fev.in 0.nf.ds*fdiv!\\n[ds*o-fnr].ev.rm ds*fdiv!\\n[ds*o-fnr].rm ds*fsize!\\n[ds*o-fnr].rm ds*fformat!\\n[ds*o-fnr].nr ds*o-fnr +1...\"---------------.\" print one floating display if there is one..de ds@print-one-float.if \\n[ds*o-fnr]<=\\n[ds*fnr] \{\.	if \\n[.t]<\\n[ds*fsize!\\n[ds*o-fnr]] .pg@next-page.	ds@output-div.	if \\n[De] .pg@next-page.\}...\"---------------.\" print all queued floats..\" if De>0 do a page eject between the floats..de ds@print-all-floats.while \\n[ds*o-fnr]<=\\n[ds*fnr] \{\.	if \\n[.t]<\\n[ds*fsize!\\n[ds*o-fnr]] .pg@next-page.	ds@output-div.	if \\n[De] .pg@next-page.\}...\"---------------.\" print as many floats as will fit on the current page.de ds@print-this-page.while \\n[ds*o-fnr]<=\\n[ds*fnr] \{\.	if \\n[.t]<\\n[ds*fsize!\\n[ds*o-fnr]] .break.	ds@output-div.\}...\"########### module list ###################.\" .LI text-indent mark-indent pad type [mark [LI-space [LB-space] ] ].\".nr li*tind 0.nr li*mind 0.nr li*pad 0.nr li*type 0.ds li*mark 0.nr li*li-spc 0.nr li*lvl 0 1.nr li*cur-vpos 0.\"--------------------------.\"	the major list-begin macro..\"	If type == -1 a 'break' will occur..de LB.if \\n[.$]<4 .@error "LB: not enough arguments, min 4".misc@push cind \\n[.i].misc@push tind \\n[li*tind].misc@push mind \\n[li*mind].misc@push pad \\n[li*pad].misc@push type \\n[li*type].misc@push li-spc \\n[li*li-spc].ds li*mark-list!\\n[li*lvl] \\*[li*mark].nr li*lvl +1.\".nr li*tind (n;0\\$1)\"			text-indent.nr li*mind (n;0\\$2)\"			mark-indent.nr li*pad (n;0\\$3)\"			pad.nr li*type 0\\$4\"			type.ds li*mark \\$5\"			mark.ie !'\\$6'' .nr li*li-spc \\$6\"	LI-space.el .nr li*li-spc 1.ie !'\\$7'' .nr li*lb-spc \\$6\"	LB-space.el .nr li*lb-spc 0.\" init listcounter.nr li*cnt!\\n[li*lvl] 0 1.\" assign format.af li*cnt!\\n[li*lvl] 1.if \\n[li*type] .if !'\\*[li*mark]'' .af li*cnt!\\n[li*lvl] \\*[li*mark].\".if \\n[li*lb-spc] .SP (u;\\n[li*lb-spc]*\\n[Lsp]).in +\\n[li*tind]u...\"---------------.de LI.if \\n[li*lvl]<1 .@error "LI:no lists active".if \\n[li*li-spc]&(\\n[Ls]>=\\n[li*lvl]) .SP (u;\\n[li*li-spc]*\\n[Lsp]).ne 2v.\".ds li*c-mark \\*[li*mark].nr li*cnt!\\n[li*lvl] +1.if \\n[li*type]=1 .ds li*c-mark \\n[li*cnt!\\n[li*lvl]]..if \\n[li*type]=2 .ds li*c-mark \\n[li*cnt!\\n[li*lvl]]).if \\n[li*type]=3 .ds li*c-mark (\\n[li*cnt!\\n[li*lvl]]).if \\n[li*type]=4 .ds li*c-mark [\\n[li*cnt!\\n[li*lvl]]].if \\n[li*type]=5 .ds li*c-mark <\\n[li*cnt!\\n[li*lvl]]>.if \\n[li*type]=6 .ds li*c-mark {\\n[li*cnt!\\n[li*lvl]]}.if \\n[.$]=1 .ds li*c-mark \\$1.if \\n[.$]=2 .ds li*c-mark \\$1\ \\*[li*c-mark].if '\\*[li*c-mark]'\ ' .ds li*c-mark.\".\" determine where the text begins.nr li*text-begin \\n[li*tind]>?\w@\\*[li*c-mark]\ @.\".\" determine where the mark begin.ie !\\n[li*pad] .nr li*in \\n[li*mind].el .nr li*in \\n[li*text-begin]-\\n[li*pad]-\w@\\*[li*c-mark]@.if !\\n[li*in] .nr li*in 0.\".ti -\\n[li*tind]u.\" no indentation if hanging indent.if (\w@\\*[li*c-mark]@=0)&((\\n[.$]=0):(\w@\\$1@=0)) .nr li*text-begin 0\Z'\&\h'\\n[li*in]u'\\*[li*c-mark]'\h'\\n[li*text-begin]u'\&\c.if \\n[li*type]=-1 .br...\".\"-------------.de li@pop.nr li*lvl -1.misc@pop-nr cind li*tmp.in \\n[li*tmp]u.misc@pop-nr tind li*tind.misc@pop-nr mind li*mind.misc@pop-nr pad li*pad.misc@pop-nr type li*type.misc@pop-nr li-spc li*li-spc.ds li*mark \\*[li*mark-list!\\n[li*lvl]]...de LE.if \\n[li*lvl]<1 .@error "LE:mismatched".li@pop.if '\\$1'1' .SP \\n[Lsp]u...\"-------------.\"	list status clear..de LC.if !\\n[.$]=1 .@error "LC: no argument".if \\$1>\\n[li*lvl] .@error "LC: incorrect argument: \\$1 (too big)".while \\n[li*lvl]>\\$1 .li@pop.nr par@ind-flag 0...\"-------------.de AL.if \\n[.$]>3 .@error "AL: too many arguments".if \\n[D]>2 .tm AL $*.ie \\n[.$]<=1 .LB \\n[Li] 0 2 1 "\\$1".el \{\.	ie \\n[.$]=2 .LB 0\\$2 0 2 1 "\\$1".	el \{\.		ie !'\\$2'' .LB \\$2 0 2 1 "\\$1" 0 1.		el .LB \\n[Li] 0 2 1 "\\$1" 0 1.	\}.\}...de ML.if \\n[.$]>3 .@error "ML: too many arguments".if \\n[D]>2 .tm ML $*.nr li*ml-width \w@\\$1@u+1n.if \\n[.$]<2 .LB \\n[li*ml-width]u 0 1 0 "\\$1".if \\n[.$]=2 .LB 0\\$2 0 1 0 "\\$1".if \\n[.$]=3 \{\.	ie '\\$2'' .LB \\n[li*ml-width]u 0 1 0 "\\$1" 0 1.	el .LB \\n[Li] 0 1 0 "\\$1" 0 1.\}...de VL.if \\n[D]>2 .tm VL $*.if \\n[.$]>3 .@error "VL: too many arguments".if \\n[.$]<1 .@error "VL: missing text-indent".ie \\n[.$]<3 .LB 0\\$1 0\\$2 0 0.el .LB 0\\$1 0\\$2 0 0 \& 0 1...\"	Bullet (for .BL).de BL.if \\n[D]>2 .tm BL $*.ds BU \s-2\(bu\s0.if \\n[.$]>2 .@error "BL: too many arguments".if \\n[.$]<1 .LB \\n[Pi] 0 1 0 \\*[BU].if \\n[.$]=1 .LB 0\\$1 0 1 0 \\*[BU].if \\n[.$]=2 \{\.	ie '\\$1'' .LB \\n[Pi] 0 1 0 \\*[BU] 0 1.	el .LB 0\\$1 0 1 0 \\*[BU] 0 1.\}...de DL.if \\n[D]>2 .tm DL $*.if \\n[.$]>2 .@error "DL: too many arguments".if \\n[.$]<1 .LB \\n[Pi] 0 1 0 \(em.if \\n[.$]=1 .LB 0\\$1 0 1 0 \(em.if \\n[.$]=2 \{\.	ie '\\$1'' .LB \\n[Pi] 0 1 0 \(em 0 1.	el .LB 0\\$1 0 1 0 \(em 0 1.\}...de RL.if \\n[D]>2 .tm RL $*.if \\n[.$]>2 .@error "RL: too many arguments".if \\n[.$]<1 .LB 6 0 2 4.if \\n[.$]=1 .LB 0\\$1 0 2 4.if \\n[.$]=2 \{\.	ie '\\$1'' .LB 6 0 2 4 1 0 1.	el .LB 0\\$1 0 2 4 1 0 1.\}...\" Broken Variable List. As .VL but text begin on the next line.de BVL.if \\n[D]>2 .tm BVL $*.if \\n[.$]>3 .@error "BVL: too many arguments".if \\n[.$]<1 .@error "BVL: missing text-indent".ie \\n[.$]<3 .LB 0\\$1 0\\$2 0 -1.el .LB 0\\$1 0\\$2 0 -1 \& 0 1...\" ####### module tbl #######################################.\" This module is copied from groff_ms and modified for mgm..\" Yes, it does not resemble the original anymore :-)..\" Don't know if I missed something important..\" Groff_ms is written by James Clark..nr tbl*have-header 0.nr tbl*header-written 0.de TS.br.if ''\\n[.z]' .SP.if '\\$1'H' .di tbl*header-div...de tbl@top-hook.if \\n[tbl*have-header] \{\.	ie \\n[.t]-\\n[tbl*header-ht]-1v .tbl@print-header.	el .sp \\n[.t]u.\}...de tbl@bottom-hook.if \\n[tbl*have-header] \{\.	nr T. 1.\" draw bottom and side lines of boxed tables..	T#.\}.nr tbl*header-written 0...de tbl@print-header.ev tbl*ev'nf.tbl*header-div.ev.mk #T.nr tbl*header-written 1...de TH.ie '\\n[.z]'tbl*header-div' \{\.	nr T. 0.	T#.	br.	di.	nr tbl*header-ht \\n[dn].	ne \\n[dn]u+1v.	nr tbl*have-header 1.	ie '\\$1'N' .if !\\n[tbl*header-written] .tbl@print-header.	el .tbl@print-header.\}.el .@error ".TH without .TS H"...de TE.ie '\\n(.z'tbl*header-div' .@error ".TS H but no .TH before .TE".el \{\.	nr tbl*have-header 0.\}.\" reset tabs.TAB...de T&...\" ####### module pic #######################################.de PS.nr pic*in 0.br.SP .5.ie \\n[.$]<2 .@error "PS: bad arguments. Probably not processed with pic.".el \{\.	if !\\n[ds*lvl] .ne (u;\\$1)+1v.\" should be contained between .DS/.DE.if r ds*format \{\.		if \\n[ds*lvl]&((\\n[ds*format]=2):(\\n[ds*format]=3)) \{\.			nr pic*in \\n[.i].\" .		in +(u;\\n[.l]-\\n[.i]-\\$2/2).		\}.	\}.\}...de PE.init@reset.SP .5...\" ####### module eq #######################################.\" .nr eq*number 0 1.de EQ.ds eq*lable "\\$1.di eq*div.misc@ev-keep eq*ev.in 0.nf...de EN.br.di.ta.\" equation with lable..if \\n[dl] \{\.	br.	chop eq*div.	ie (\\n[Eq]%2) \{\.		\"	lable to the left.		if \\n[ds*format]<2 \{\.			ta (u;(\\n[.l]/7)+\\n[.i]) \\n[.l]u\" L\\*[eq*lable]\t\\*[eq*div]\t\&.		\}.		if (\\n[ds*format]=2):(\\n[ds*format]=3) \{\.			ta (u;(\\n[.l]-\\n[.i])/2+\\n[.i])C \\n[.l]u\" C\\*[eq*lable]\t\\*[eq*div]\t\&.		\}.		if \\n[ds*format]>3 \{\.			ta \\n[.l]uR\"	R\\*[eq*lable]\t\\*[eq*div].		\}.	\}.	el \{\.		\"	lable to the right.		if \\n[ds*format]<2 \{\.			ta \\n[.l]uR\" L\\*[eq*div]\t\\*[eq*lable].		\}.		if (\\n[ds*format]=2):(\\n[ds*format]=3) \{\.			ta (u;(\\n[.l]-\\n[.i])/2+\\n[.i])C \\n[.l]uR\" C\t\\*[eq*div]\t\\*[eq*lable].		\}.		if \\n[ds*format]>3 \{\.			ta (\\n[.l]u-\w@\\*[eq*lable]@u-1m)R \\n[.l]uR\" R\t\\*[eq*div]\t\\*[eq*lable].		\}.	\}.\}.TAB.ev...\"########### module toc ###################.\" table of contents.nr toc*slevel 1.nr toc*spacing \n[Lsp]u.nr toc*tlevel 2.nr toc*tab 0.\"-----------.\" Table of contents with friends (module lix).de TC.br.\" print any pending displays and references.ds@print-float 3.if \\n[ref*flag] .RP 0 1.\".if \w@\\$1@>0 .nr toc*slevel \\$1.if \w@\\$2@>0 .nr toc*spacing (u;\\$2*\\n[Lsp]).if \w@\\$3@>0 .nr toc*tlevel \\$3.if \w@\\$4@>0 .nr toc*tab \\$4.if \\n[pg*cols-per-page]>1 .1C.pg@clear-hd.pg@next-page.pg@clear-ft.\"-------------.if d Ci .toc@read-Ci \\*[Ci].nf.in 0.nr toc*pn 0 1.af toc*pn i.PF "''\\\\\\\\n+[toc*pn]''".nr toc*i 4 1.while \\n+[toc*i]<10 \{\.	if !'\\$\\n[toc*i]'' \{\.		ce\\$\\n[toc*i].		br.	\}.\}.if \\n[.$]<=4 .if d TX .TX.ie d TY .if \\n[.$]<=4 .TY.el \{\.	ce\\*[Licon].	br.	SP 3.\}.if d toc*list .toc*list.\" print LIST OF XXX.if d lix*dsfg .lix@print-ds fg "\\*[Lf]".if d lix*dstb .lix@print-ds tb "\\*[Lt]".if d lix*dsec .lix@print-ds ec "\\*[Le]".if d lix*dsex .lix@print-ds ex "\\*[Lx]"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -