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

📄 tmac.m

📁 早期freebsd实现
💻 M
📖 第 1 页 / 共 4 页
字号:
.\"	Version:.ds RE 1.16.igCopyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.mgm is written by J鰎gen H鋑g (jh@efd.lth.se)mgm is free software; you can redistribute it and/or modify it underthe terms of the GNU General Public License as published by the FreeSoftware Foundation; either version 2, or (at your option) any laterversion.mgm is distributed in the hope that it will be useful, but WITHOUT ANYWARRANTY; without even the implied warranty of MERCHANTABILITY orFITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public Licensefor more details.You should have received a copy of the GNU General Public License alongwith groff; see the file COPYING.  If not, write to the Free SoftwareFoundation, 675 Mass Ave, Cambridge, MA 02139, USA.Almost complete. The letter format is not included.Maybe as a separate package.Should be better as time goes.Please send bugreports with examples to jh@efd.lth.se.Naming convention stolen from mgs.Local names	module*nameExtern names	module@nameEnv.var		environ:nameIndex		array!index...warn.\" ####### init ######.\"	Contents level [0:7], contents saved if heading level <= Cl.nr Cl 2.\"	Eject page between LIST OF XXXX if Cp == 0.nr Cp 0.\"	Debugflag.if !r D .nr D 0.\"	Eject after floating display is output [0:1].nr De 0.\"	Floating keep output [0;5].nr Df 5.\"	space before and after display if == 1 [0:1].nr Ds 1.\"	Eject page.nr Ej 0.\"	Eqation lable adjust 0=left, 1=right.nr Eq 0.\"	Em dash string.ds EM \-.\"	Footnote spacing.nr Fs 1.\"	H1-H7	heading counters.nr H1 0 1.nr H2 0 1.nr H3 0 1.nr H4 0 1.nr H5 0 1.nr H6 0 1.nr H7 0 1.\"	Heading break level [0:7].nr Hb 2.\"	heading centering level, [0:7].nr Hc 0.\"	header format.ds HF 2 2 2 2 2 2 2.\"	heading temp. indent [0:2].\"	0 -> 0 indent, left margin.\"	1 -> indent to right , like .P 1.\"	2 -> indent to line up with text part of preceding heading.nr Hi 1.\"	header pointsize.ds HP 0 0 0 0 0 0 0.\"	heading space level [0:7].nr Hs 2.\"	heading numbering type.\"	0 -> multiple (1.1.1 ...).\"	1 -> single.nr Ht 0.\"	Unnumbered heading level.nr Hu 2.\"	hyphenation in body.\"	0 -> no hyphenation.\"	1 -> hyphenation 14 on.nr Hy 1.\"	text for toc, selfexplanatory. Look in the new variable section.ds Lf LIST OF FIGURES.nr Lf 1.ds Lt LIST OF TABLES.nr Lt 1.ds Lx LIST OF EXHIBITS.nr Lx 1.ds Le LIST OF EQUATIONS.nr Le 0.\"	List indent, used by .AL.nr Li 6.\"	List space, if listlevel > Ls then no spacing will occur around lists..nr Ls 99.\"	Numbering style [0:5].if !r N .nr N 0.\"	numbered paragraphs.\"	0 == not numbered.\"	1 == numbered in first level headings..nr Np 0.\"	Format of figure,table,exhibit,equation titles..\"	0= ". ", 1=" - ".nr Of 0.\"	Page-number, normally same as %..nr P 0.\"	paragraph indent.nr Pi 5.\"	paragraph spacing.nr Ps 1.\"	paragraph type.\"	0 == left-justified.\"	1 == indented .P.\"	2 == indented .P except after .H, .DE or .LE..nr Pt 0.\"	Reference title.ds Rp REFERENCES.\"	Display indent.nr Si 5.\".ds Tm \(tm.\".\"---------------------------------------------.\"	Internal global variables.\".\" These two are for cover macro .MT.\" Change @langage in the national file..ds @cur-lib /usr/local/lib/groff/tmac.\" .ds @language.\".\"	Current pointsize and vertical space, always in points..nr @ps 10.nr @vs 12.\"	Page length.ie r L .nr @pl \n[L].el .nr @pl 11i.\"	page width.ie r W .nr @ll \n[W].el .nr @ll 6i.\"	page offset.ie r O .nr @po \n[O].el .nr @po 1i.\".\" cheating....pl \n[@pl]u.ll \n[@ll]u.lt \n[@ll]u.po \n[@po]u.nr @cur-ll \n[@ll].\".\" non-zero if escape mechanism is turned off. Used by VERBON/OFF.nr @verbose-flag 0.\"---------------------------------------------.\"	New variables.\".\" Appendix name.ds App APPENDIX.\" print appendixheader, 0 == don't.nr Aph 1.\".\" header prespace level. If level <= Hps, then two lines will be printed.\" before the header instead of one..nr Hps 1.\".\" These variables controls the number of lines preceding .H..\" Hps1 is the number of lines when level > Hps.nr Hps1 0.5v.if n .nr Hps1 1v.\".\" Hps2 is the number of lines when level >= Hps.nr Hps2 1v.if n .nr Hps2 2v.\".\" flag for mkindex.if !r Idxf .nr Idxf 0.\"	Change these in the national configuration file.ds Lifg Figure.ds Litb TABLE.ds Liex Exhibit.ds Liec Equation.ds Licon CONTENTS.\".\" Lsp controls the height of an empty line. Normally 0.5v.\" Normally used for nroff compatibility..nr Lsp 0.5v.if n .nr Lsp 1v.ds MO1 January.ds MO2 February.ds MO3 March.ds MO4 April.ds MO5 May.ds MO6 June.ds MO7 July.ds MO8 August.ds MO9 September.ds MO10 October.ds MO11 November.ds MO12 December.\" for GETR.ds Qrf See chapter \\*[Qrfh], page \\*[Qrfp]..\"	test for mgm macro. This can be used if the text must test.\"	what macros is used..\".\" section-page if Sectp > 0.nr Sectp 0.if (\n[N]=3):(\n[N]=5) \{\.	nr Sectp 1.	nr Ej 1.\}.\" section-figure if Sectf > 0.nr Sectf 0.if \n[N]=5 .nr Sectf 1.\".\" argument to .nm in .VERBON..ds Verbnm "1.\" indent for VERBON.nr Verbin 5n.\".nr .mgm 1.\".\"---------------------------------------------.\" set local variables..ie d @language .mso mm/\\*[@language]_locale.el .mso mm/locale.\"---------------------------------------------.if \n[D] .tm Groff mm, version \*[RE]..\" ####### module init ######.\"	reset all things.de init@reset.ie \\n[misc@adjust] 'ad.el 'na.ie \\n[Hy] 'hy 14.el 'nh'in 0'ti 0'ps \\n[@ps]'vs \\n[@vs]...de @error.tm ******************.tm ERROR:(\\n[.F]) input line \\n[.c]:\\$*.if \\n[D] .backtrace.tm ******************.ab...\" ####### module debug #################################.de debug.tm \\$1:\\n[.F]:\\n[c.] ll=\\n[.l] vs=\\n[.v] ps=\\n[.s],\\n[.ps] \in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]...de debug-all.nr debug*n 1n.nr debug*m 1m.tm \\$1:\\n[.F]:\\n[c.] ll=\\n[.l] vs=\\n[.v] ps=\\n[.s] in=\\n[.i]\ ad=\\n[.j] fi=\\n[.u] pl=\\n[.p] page=\\n[%] .o=\\n[.o].tm _______ .d=\\n[.d] .f=\\n[.f] .h=\\n[.h] .k=\\n[.k] .n=\\n[.n]\ .p=\\n[.p] .t=\\n[.t] .z=\\n[.z] nl=\\n[nl] dn=\\n[dn] n=\\n[debug*n]...\" ####### module par #################################.nr par@ind-flag 1	\" indent on following P if Pt=2.nr hd*last-pos -1.nr hd*last-hpos -1.nr par*number 0 1.af par*number 01.nr par*num-count 0 1.af par*num-count 01.\"	reset numbered paragraphs, arg1 = headerlevel.de par@reset-num.if \\$1<3 .nr par*num-count 0.if (\\$1=1)&(\\n[Np]=1) .nr par*number 0...\"------------.\" paragraph.de P.\"	skip P if previous heading.ie !((\\n[nl]=\\n[hd*last-pos]):(\\n[nl]=(\\n[hd*last-pos]-.5v))) \{\.	if \\n[D]>2 .tm Paragraph .	par@doit \\$*.\}.el .if !(\\n[hd*last-hpos]=\\n[.k]) \{\.	if \\n[D]>2 .tm Paragraph .	par@doit \\$*.\}.nr par@ind-flag 1...de par@doit.SP (u;\\n[Ps]*\\n[Lsp]).ie  \\n[.$] \{\.	if \\$1=1 .ti +\\n[Pi]n.\}.el \{\.	if \\n[Pt]=1 .ti +\\n[Pi]n.	if (\\n[Pt]=2)&\\n[par@ind-flag] .ti +\\n[Pi]n.\}.if \\n[Np] \{\\\n[H1].\\n+[par*number]\ \ \c.\" $$$ 'br.\}...\" ####### module line #######################################.de SP.br.if !r line*lp\\n[.z] .nr line*lp\\n[.z] 0.if !r line*ac\\n[.z] .nr line*ac\\n[.z] 0.ie \\n[.$] .nr line*temp (v;\\$1).el .nr line*temp 1v.\".ie \\n[line*lp\\n[.z]]=\\n[.d] \{\.	\" go here if no output since the last .SP.	nr line*output \\n[line*temp]-\\n[line*ac\\n[.z]].	if \\n[line*output]<0 .nr line*output 0.	nr line*ac\\n[.z] +\\n[line*output].\}.el \{\.	nr line*ac\\n[.z] \\n[line*temp].	nr line*output \\n[line*temp].	\" no extra space in the beginning of a page.	if (\\n[.d]<0):(\\n[pg*head-mark]=\\n[.d]) .nr line*output 0.\}.if \\n[line*output] .sp \\n[line*output]u.nr line*lp\\n[.z] \\n[.d]...\" ######## module misc ###############.nr misc@adjust 14.de SA.if \\n[.$] \{\.	if \\$1-1 .@error "SA: bad arg: \\$1".	nr misc@adjust 0\\$1.\}.ie \\n[misc@adjust] 'ad.el 'na...\"-------------.\" switch environment, keep all important settings..de misc@ev-keep.nr misc*ll \\n[.l].ev \\$1.ll \\n[misc*ll]u.lt \\n[misc*ll]u...\"-------------.\" .misc@push stackname value.de misc@push.ie d misc*st-\\$1 .ds misc*st-\\$1 \\$2 \\*[misc*st-\\$1].el .ds misc*st-\\$1 \\$2...\"-------------.\" .misc@pop stackname.\" value returned in the string misc*pop.de misc@pop.misc@pop-set misc*st-\\$1 \\*[misc*st-\\$1]...\"-------------.de misc@pop-set.ds misc*st-name \\$1.shift.if \\n[.$]<1 .@error "stack \\*[misc*st-name] empty".ds misc*pop \\$1.shift.ds \\*[misc*st-name] \\$*...\"-------------.\" .misc@pop-nr stackname varname.de misc@pop-nr.misc@pop \\$1.nr \\$2 \\*[misc*pop]...\"-------------.\" .misc@pop-ds stackname varname.de misc@pop-ds.misc@pop \\$1.ds \\$2 \\*[misc*pop]...\"-----------.\" reset tabs.de TAB.ta T 5n...\"-------------.\" .PGFORM linelength [ pagelength [ pageoffset ] ].de PGFORM.\" Break here to avoid problems with new linesetting of the previous line..\" Hope this doesn't break anything else :-).br.if !''\\$1' .nr @ll \\$1.if !''\\$2' .nr @pl \\$2.if !''\\$3' .nr @po \\$3.ll \\n[@ll]u.lt \\n[@ll]u.po \\n[@po]u.pl \\n[@pl]u.nr @cur-ll \\n[@ll].in 0.pg@move-trap...\"-------------.\" .MOVE y [[x] linelength].\" move to line y, indent to x.de MOVE.if !\\n[.$] .@error "MOVE y [x]: no arguments".if \\n[nl]<0 \c.\" move to Y-pos.sp |(v;\\$1).\" calc linelength.ie \\n[.$]>2 .nr pg*i (n;\\$3).el \{\.	ie \\n[.$]>1 .nr pg*i (n;\\n[@ll]u-\\$2).	el .nr pg*i \\n[@ll]u.\}.\" move to X-pos, if any.if !''\\$2' .po \\$2.\" set linelength.ll \\n[pg*i]u...\"-------------.de SM.if !\\n[.$] .@error "SM: no arguments".if \\n[.$]=1 \s-1\\$1\s0.if \\n[.$]=2 \s-1\\$1\s0\\$2.if \\n[.$]=3 \\$1\s-1\\$2\s0\\$3...\"-------------.nr misc*S-ps \n[@ps].nr misc*S-vs \n[@vs].nr misc*S-ps1 \n[@ps].nr misc*S-vs1 \n[@vs].ds misc*a.ds misc*b.de S.ie !\\n[.$] \{\.	ds misc*a P.	ds misc*b P.\}.el \{\.	ie \\n[.$]=1 .ds misc*b D.	el \{\.		ie \w@\\$2@=0 .ds misc*b C.		el .ds misc*b \\$2.	\}.	ie \w@\\$1@=0 .ds misc*a C.	el .ds misc*a \\$1.\}.\".\" set point size.if !'\\*[misc*a]'C' \{\.	ie '\\*[misc*a]'P' .nr @ps \\n[misc*S-ps].	el \{\.		ie '\\*[misc*a]'D' .nr @ps 10.		el .nr @ps \\*[misc*a].	\}.\}.\".\" set vertical spacing.if !'\\*[misc*b]'C' \{\.	ie '\\*[misc*b]'P' .nr @vs \\n[misc*S-vs].	el \{\.		ie '\\*[misc*b]'D' .nr @vs \\n[@ps]+2.		el .nr @vs \\*[misc*b].	\}.\}'ps \\n[@ps]'vs \\n[@vs].if \\n[D]>1 .tm point-size \\n[@ps] (\\n[.s]), vertical spacing \\n[@vs] (\\n[.v]).nr misc*S-ps \\n[misc*S-ps1].nr misc*S-vs \\n[misc*S-vs1].nr misc*S-ps1 \\n[@ps].nr misc*S-vs1 \\n[@vs]...\"------------.de HC.ev 0.hc \\$1.ev.ev 1.hc \\$1.ev.ev 2.hc \\$1.ev...\"------------.de RD.di misc*rd'fl.rd \\$1.br.di.ie !''\\$3' \{\.	di misc*rd2.	ds \\$3 "\\*[misc*rd].	br.	di.\}.if !''\\$2' .rn misc*rd \\$2.rm misc*rd misc*rd2...\"------------.\" VERBON [flag [pointsize [font]]].\"	flag.\"	bit	function.\"	0	escape on.\"	1	add an empty line before verbose text.\"	2	add an empty line after verbose text.\"	4	numbered lines (controlled by the string Verbnm).\"	8	indent text by the numbervariable Verbin..de VERBON.nr misc*verb 0\\$1.if (0\\n[misc*verb]%4)/2 .SP \\n[Lsp]u.br.misc@ev-keep misc*verb-ev.nf.if (0\\n[misc*verb]%16)/8 .nm \\*[Verbnm].ie !'\\$3'' .ft \\$3.el .ft CR.ss 12.ta T 8u*\w@n@u.if 0\\$2 \{\.	ps \\$2.	vs \\$2.\}.if (0\\n[misc*verb]%32)/16 .in +\\n[Verbin]u.if !(0\\n[misc*verb]%2) \{\.	eo.	nr @verbose-flag 1		\" tell pageheader to set ec/eo.\}...de VERBOFF.ec.if (0\\n[misc*verb]%8)/4 .SP \\n[Lsp]u.if (0\\n[misc*verb]%16)/8 .nm.if (0\\n[misc*verb]%32)/16 .in.ev.nr @verbose-flag 0...\" ######## module acc #################.\"-----------.\" accents. These are copied from mgs, written by James Clark..de acc@over-def.ds \\$1 \Z'\v'(u;\w'x'*0+\En[rst]-\En[.cht])'\\h'(u;-\En[skw]+(-\En[.w]-\w'\\$2'/2)+\En[.csk])'\\$2'...de acc@under-def.ds \\$1 \Z'\v'\En[.cdp]u'\h'(u;-\En[.w]-\w'\\$2'/2)'\\$2'...acc@over-def ` \`.acc@over-def ' \'.acc@over-def ^ ^.acc@over-def ~ ~.acc@over-def : \(ad.acc@over-def ; \(ad.acc@under-def , \(ac.\" ######## module uni #################.\" unimplemented macros.de OK.tm "OK: not implemented"...de PM.tm "PM: not implemented"...\" ######## module hd #################.\" support for usermacro.nr hd*h1-page 1	\" last page-number for level 1 header..nr hd*htype 0.ds hd*sect-pg.ds hd*mark.ds hd*suf-space.nr hd*need 0.aln ;0 hd*htype.als }0 hd*mark.als }2 hd*suf-space.aln ;3 hd*need.\"-------------.\" .hd@split varable index name val1 val2 ....de hd@split.if \\$2>(\\n[.$]-3) .@error "\\$3 must have at least \\$2 values (\\*[\\$3])..nr hd*sp-tmp \\$2+3.ds \\$1 \\$[\\n[hd*sp-tmp]]...de HU.H 0 "\\$1"...\"-------------.de H.if !r hd*cur-bline .nr hd*cur-bline \\n[nl].br.ds@print-float 2\"	$$$ could be wrong....\" terminate all lists.LC 0.init@reset.nr hd*level 0\\$1.nr hd*arg1 0\\$1.if !\\n[hd*level] .nr hd*level \\n[Hu].\".\"	clear lower counters.nr hd*i 1 1.while \\n+[hd*i]<8 .if \\n[hd*level]<\\n[hd*i] .nr H\\n[hd*i] 0 1.\".\"	Check if it's time for new page. Only if text has.\"	appeared before..if \\n[Ej]&(\\n[Ej]>=\\n[hd*level])&(\\n[nl]>\\n[hd*cur-bline]) .pg@next-page.\".\" increment current counter.nr H\\n[hd*level] +1.\".\" if level==1 -> prepare for new section..if \\n[hd*level]=1 .rr hd*h1-page.\".\".\" hd*mark is the text written to the left of the header..ds hd*mark \\n[H1]..\".if \\n[hd*level]>1 .as hd*mark \\n[H2].\".nr hd*i 2 1.while \\n+[hd*i]<8 .if \\n[hd*level]>(\\n[hd*i]-1) .as hd*mark .\\n[H\\n[hd*i]].if \\n[Ht] .ds hd*mark \\n[H\\n[hd*level]]..\".\" toc-mark is sent to the table of contents.ds hd*toc-mark \\*[hd*mark].as hd*mark \ \ \"			add spaces between mark and heading.if !\\n[hd*arg1] \{\.	ds hd*mark\"		no mark for unnumbered.	ds hd*toc-mark.\}.\".if \\n[D]>1 .tm At header \\*[hd*toc-mark] "\\$2".nr hd*htype 0				\" hd*htype = check break and space.					\" 0 = run-in, 1 = break only, 2 = space.if \\n[hd*level]<=\\n[Hb] .nr hd*htype 1.if \\n[hd*level]<=\\n[Hs] .nr hd*htype 2.					\" two spaces if hd*htype == 0.ie (\\n[hd*htype]=0)&(\w@\\$2@) .ds hd*suf-space "  \".el .ds hd*suf-space.nr hd*need 2v				\" hd*need = header need space.if \\n[hd*htype]<2 .nr hd*need +\\n[Lsp]u \"	add some extra space.\"---------- user macro HX ------------.\" User exit macro to override numbering..\" May change hd*mark (}0), hd*suf-space (}2) and hd*need (;3).\" Can also change Hps1/2..if d HX .HX \\n[hd*level] \\n[hd*arg1] "\\$2\\$3"

⌨️ 快捷键说明

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