📄 tmac.doc.old
字号:
...\" Interactive Commands Macro.\".de Ic.ie \\n(.$==0 \{\. tm Usage: .Ic Interactive Commands(s) ... \\*(Pu.\}.el \{\. ds sV \\*(iC. nr cF \\n(.f. ie "\\*(iM"" .ds f1 \&\\*(sV. el .as f1 \&\\*(sV. nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9. ft \\n(cF.\}...\".\" Interactive Command Modifiers (flags).\".de Cm.ie \\n(.$==0 \{\. tm Usage: .Cm Interactive Command Modifier(s) ... \\*(Pu.\}.el \{\. ds sV \\*(cM. nr cF \\n(.f. ie "\\*(iM"" .ds f1 \&\\*(sV. el .as f1 \&\\*(sV. nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9. ft \\n(cF.\}...\".de Li.ie \\n(.$==0 \{\. tm Usage: .Li literal ... \\*(Pu. \}.el \{\. ds sV \\*(lI. nr cF \\n(.f. ie "\\*(iM"" .ds f1 \&\\*(sV. el .as f1 \&\\*(sV. nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9. ft \\n(cF.\}...\" If in nroff or any other case where the default font.\" is constant width, and literal means zilch, single quote instead..ie n \{\.de Ql. ie \\n(.$==0 \{\. tm Usage: .Ql literal ... \\*(Pu. \}. el \{\. Sq \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9. \}...\}.el \{\.de Ql. ie \\n(.$==0 \{\. tm Usage: .Ql literal ... \\*(Pu. \}. el \{\. Li \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9. \}...\}.\".de Nm.ie \\n(.$==0 \{\. if "\\*(n1"" .tm Usage: .Nm Name(s) ... \\*(Pu. ie !"\\*(iM"" .as f1 \&\\*(nM\\*(n1\\$1\fP. el \&\\*(nM\\*(n1\\$1\fP.\}.el \{\. ds sV \\*(nM. nr cF \\n(.f. if \\n(nS \{\. rs. in -\\n(iSu. ie \\n(nS>1 .br. el \{\. sW \\$1. nr iS ((\\n(sW+1)*\\n(fW)u. \}. in +\\n(iSu. ti -\\n(iSu. nr nS \\n(nS+1. \}. if "\\*(n1"" .ds n1 \\$1. ie "\\*(iM"" .ds f1 \&\\*(sV. el .as f1 \&\\*(sV. nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9. ft \\n(cF.\}...\".de Pa.ie \\n(.$==0 \{\\&\\*(pA~\fP.\}.el \{\. ds sV \\*(pA. nr cF \\n(.f. ie "\\*(iM"" .ds f1 \&\\*(sV. el .as f1 \&\\*(sV. nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9. ft \\n(cF.\}...\".de Sy.ie \\n(.$==0 \{\. tm Usage: .Sy Symbolic Text ... \\*(Pu. \}.el \{\. ds sV \\*(sY. nr cF \\n(.f. ie "\\*(iM"" .ds f1 \&\\*(sV. el .as f1 \&\\*(sV. nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9. ft \\n(cF.\}...\".de Ms.ie \\n(.$==0 \{\. tm Usage: .Ms Math Symbol ... \\*(Pu. \}.el \{\. ds sV \\*(sY. nr cF \\n(.f. ie "\\*(iM"" .ds f1 \&\\*(sV. el .as f1 \&\\*(sV. nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9. ft \\n(cF.\}...\".de Va.ie \\n(.$==0 \{\. tm Usage: .Va variable_name(s) ... \\*(Pu.\}.el \{\. ds sV \\*(vA. nr cF \\n(.f. ie "\\*(iM"" .ds f1 \&\\*(sV. el .as f1 \&\\*(sV. nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9. ft \\n(cF.\}...\".de nB.hy 0.if \\n(.$==0 .tm Usage error: called with empty arguments (empty quotes)?.ie \\n(.$>1 \{\. rZ \\$1. ie \\n(rZ .as f1 \&\f\\n(cF\\$1\fP. el .as f1 \&\\$1. rZ \\$2. if !\\n(rZ \{\. ie !"\\*(iM""\{\.\" I surrender. if "\\*(iM"Tp" .as f1 \&\ \&. if "\\*(iM"Dp" .as f1 \&\ \&. if "\\*(iM"Op" .as f1 \&\ \&. if "\\*(iM"Cx" .as f1 \&\ \&. if "\\*(iM"Dq" .as f1 \& \&. if "\\*(iM"Sq" .as f1 \& \&. if "\\*(iM"Pq" .as f1 \& \&. if "\\*(iM"Aq" .as f1 \& \&. \}. el .as f1 \& \&. \}. nB \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9.\}.el \{\. rZ \\$1. ie \\n(rZ .as f1 \&\f\\n(cF\\$1. el .as f1 \&\\$1\f\\n(cF. if "\\*(iM"" \{\&\\*(f1. ds f1. \}. hy.\}...de fB.hy 0.if \\n(.$==0 .tm Usage error: called with empty arguments (empty quotes)?.ie \\n(.$>1 \{\. rZ \\$1. ie \\n(rZ .as f1 \&\f\\n(cF\\$1\fP. el \{\. ie "\\$1"-" .as f1 \&\-\-. el .as f1 \&\-\\$1. \}. rZ \\$2. if !\\n(rZ \{\. ie !"\\*(iM""\{\.\" I surrender. if "\\*(iM"Tp" .as f1 \&\ \&. if "\\*(iM"Dp" .as f1 \&\ \&. if "\\*(iM"Op" .as f1 \&\ \&. if "\\*(iM"Cx" .as f1 \&\ \&. if "\\*(iM"Dq" .as f1 \& \&. if "\\*(iM"Sq" .as f1 \& \&. if "\\*(iM"Pq" .as f1 \& \&. if "\\*(iM"Aq" .as f1 \& \&. \}. el .as f1 \& \&. \}. fB \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9.\}.el \{\. rZ \\$1. ie \\n(rZ .as f1 \&\f\\n(cF\\$1. el \{\. ie "\\$1"-" .as f1 \&\-\-\f\\n(cF. el .as f1 \&\-\\$1\f\\n(cF. \}. if "\\*(iM"" \{\&\\*(f1. ds f1. \}. hy.\}...\".\" Single quoted Items.\" eF, sB g[0-9] and f2.de Sq.nr eF 0.ie \\n(.$==0 \{\. ie "\\*(iM"" \&\\*(sL\&\\*sR. el .as f1 \&\\*(sL\&\\*(sR.\}.el \{\. ie "\\*(iM"" \{\. ds f1 \&\\*(sL. ds iM Sq. \}. el .as f1 \&\\*(sL. sB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9. ie \\n(eF>0 .\\*(g1 \\*(g2 \\*(g3 \\*(g4 \\*(g5 \\*(g6 \\*(g7 \\*(g8. el .as f1 \\*(g0. as f1 \\*(sR. if !"\\*(f2"" .as f1 \\*(f2. if "\\*(iM"Sq" \{\\&\\*(f1. ds f1. ds iM. \}. ds f2. rm g0 g1 g2 g3 g4 g5 g6 g7 g8 g9. nr eF 0.\}...\".\" Double quoted Items.de Dq.nr Ef 0.ie \\n(.$==0 \{\. ie "\\*(iM"" \&\\*(Lq\&\\*(Rq. el .as f1 \&\\*(Lq\&\\*(Rq.\}.el \{\. ie "\\*(iM"" \{\. ds f1 \&\\*(Lq. ds iM Dq. \}. el .as f1 \&\\*(Lq. Sb \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9. ie \\n(Ef>0 .\\*(k1 \\*(k2 \\*(k3 \\*(k4 \\*(k5 \\*(k6 \\*(k7 \\*(k8. el .as f1 \\*(k0. as f1 \\*(Rq. if !"\\*(f4"" .as f1 \\*(f4. if "\\*(iM"Dq" \{\\&\\*(f1. ds f1. ds iM. \}. ds f4. rm k0 k1 k2 k3 k4 k5 k6 k7 k8 k9. nr Ef 0.\}...\".\" Parenthesis quoted Items.de Pq.nr pQ 0.ie \\n(.$==0 \{\. ie "\\*(iM"" \&(\&). el .as f1 \&(\&).\}.el \{\. ie "\\*(iM"" \{\. ds f1 \&(. ds iM Pq. \}. el .as f1 \&(. pB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9. ie \\n(pQ>0 .\\*(y1 \\*(y2 \\*(y3 \\*(y4 \\*(y5 \\*(y6 \\*(y7 \\*(y8. el .as f1 \\*(y0. as f1 \&). if !"\\*(f3"" .as f1 \\*(f3. if "\\*(iM"Pq" \{\\&\\*(f1. ds f1. ds iM. \}. ds f3. rm y0 y1 y2 y3 y4 y5 y6 y7 y8 y9. nr pQ 0.\}...\" eF, sB g[0-9] and f2.de sB.hy 0.ie \\n(.$==0 .tm Sick Logic: macro sB.el \{\. ie \\n(eF>=1 .nr eF \\n(eF+1. el \{\. mN \\$1. if \\n(mN .nr eF \\n(eF+1. \}. rZ \\$1. ie \\n(rZ .as f2 \\$1. el \{\. ie \\n(eF<1 .as g\\n(eF \\$1. el .as g\\n(eF \\$1. \}. if \\n(.$>1 \{\. rZ \\$2. if \\n(rZ==0 \{\. if \\n(eF<1 \{\. as g\\n(eF \& \&. \}. \}. sB \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9. \}.\}...de Sb.hy 0.ie \\n(.$==0 .tm Sick Logic: macro Sb.el \{\. ie \\n(Ef>=1 .nr Ef \\n(Ef+1. el \{\. mN \\$1. if \\n(mN .nr Ef \\n(Ef+1. \}. rZ \\$1. ie \\n(rZ .as f4 \\$1. el \{\. ie \\n(Ef<1 .as k\\n(Ef \\$1. el .as k\\n(Ef \\$1. \}. if \\n(.$>1 \{\. rZ \\$2. if \\n(rZ==0 \{\. if \\n(Ef<1 \{\. as k\\n(Ef \& \&. \}. \}. Sb \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9. \}.\}...de pB.hy 0.ie \\n(.$==0 .tm Sick Logic: macro pB.el \{\. ie \\n(pQ>=1 .nr pQ \\n(pQ+1. el \{\. mN \\$1. if \\n(mN .nr pQ \\n(pQ+1. \}. rZ \\$1. ie \\n(rZ .as f3 \\$1. el \{\. ie \\n(pQ<1 .as y\\n(pQ \\$1. el .as y\\n(pQ \\$1. \}. if \\n(.$>1 \{\. rZ \\$2. if \\n(rZ==0 \{\. if \\n(pQ<1 \{\. as y\\n(pQ \& \&. \}. \}. pB \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9. \}.\}...de aQ.hy 0.ie \\n(.$==0 .tm Bad Syntax: .Aq.el \{\. ie \\n(aQ>=1 .nr aQ \\n(aQ+1. el \{\. mN \\$1. if \\n(mN .nr aQ \\n(aQ+1. \}. rZ \\$1. ie \\n(rZ .as aZ \\$1. el \{\. ie \\n(aQ<1 .as a\\n(aQ \\$1. el .as a\\n(aQ \\$1. \}. if \\n(.$>1 \{\. rZ \\$2. if \\n(rZ==0 \{\. if \\n(aQ<1 \{\. as a\\n(aQ \& \&. \}. \}. aQ \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9. \}.\}...\" Angle Bracket Quoted Items.de Aq.nr aQ 0.ie \\n(.$==0 \{\. ie "\\*(iM"" \&<\&>. el .as f1 \&<\&>.\}.el \{\. ie "\\*(iM"" \{\. ds f1 \&<. ds iM Aq. \}. el .as f1 \&<. aQ \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8. ie \\n(aQ>0 .\\*(a1 \\*(a2 \\*(a3 \\*(a4 \\*(a5 \\*(a6 \\*(a7 \\*(a8. el .as f1 \\*(a0. as f1 \&>. if !"\\*(aZ"" .as f1 \\*(aZ. if "\\*(iM"Aq" \{\\&\\*(f1. ds f1. ds iM. \}. ds aZ. rm a0 a1 a2 a3 a4 a5 a6 a7 a8. nr aQ 0.\}...\" macro Name test, return macro register value if true.if \n(.g .ig.de mN.nr mN 0.sW \\$1.if \\n(sW==2 \{\. if \\n(\\$1 .nr mN \\n(\\$1.\}...if !\n(.g .ig.de mN.nr mN 0.if \A'\\$1' \{\. sW \\$1. if \\n(sW==2 \{\. if \\n(\\$1 .nr mN \\n(\\$1. \}.\}...\" Punctuation test (using z registers), return 1 if true.if \n(.g .ig.de rZ.nr rZ 0.sW \\$1.if \\n(sW==1 \{\. if \\n(z\\$1==1 \{\. nr rZ 1. \}.\}...if !\n(.g .ig.de rZ.nr rZ 0.if \A'\\$1' \{\. sW \\$1. if \\n(sW==1 \{\. if \\n(z\\$1==1 \{\. nr rZ 1. \}. \}.\}...\".\" sW returns number of characters in a string.if t \{\.nr fW \w'\fC,'.de sW.nr sW \w'\fC\\$1'.\}.if n \{\.nr fW \w'0'.de sW.nr sW \w'\\$1'.\}.ie \\n(sW>=\\n(fW \{\. ie \\n(sW%\\n(fW .nr sW (\\n(sW/\\n(fW)+1. el .nr sW \\n(sW/\\n(fW.\}.el .nr sW 0...\" Option Expression -.\" TODO - add line overflow check (right!).nr eP 0.ds e1.nr oE 0.nr hP 0.ds hP.nr Ep 0.de Op.hy 0.if "\\*(iM"" \{\. ds iM Op. ds f1 \&.\}.as f1 \&\\*(lB.\" .tm Op: \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9.dO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9.ie !"\\$1"Cx" .oE.el .nr oE \\n(oE+1...\".\" just for mike, with every bite of garlic in mind (oops, i mean burp)..\" dO: go dOwn an argument vector and test each argument to see if.\" a macro name or punctuation. stash in respective place along.\" with its arguments..nr oO 0.nr oP 0.nr aO 0.de dO.mN \\$1.ie \\n(mN \{\. if \\n(oP \{\. if \\n(hP \{\. nr oZ 1. oZ. Oz. \}. if \\n(e1==1 \{\.\\*(e1 \\*(e2 \\*(e3 \\*(e4 \\*(e5 \\*(e6 \\*(e7 \\*(e8 \\*(e9. \}. uO. if !(\\n(oO:\\n(aO) .as f1 \& \&. \}. ie "\\$1"Op" \{\. as f1 \&\\*(lB. nr aO \\n(aO+1. \}. el \{\. nr eP \\n(eP+1. ds e\\n(eP \\$1. nr e\\n(eP 1. \}.\}.el \{\.\" .tm dO: $1: \\$1: eP \\n(eP e[\\n(eP]: \\*(e\\n(ePEE. rZ \\$1. ie \\n(rZ \{\.\" .tm dO:rZ: $1: \\$1: eP \\n(eP e[\\n(eP]: \\*(e\\n(eP. nr hP \\n(hP+1. ds h\\n(hP \\$1. \}. el \{\.\" .tm dO:word $1: \\$1: eP \\n(eP e[\\n(eP]: \\*(e\\n(ePEE. if \\n(eP==0:\\n(e\\n(eP==1 .nr eP \\n(eP+1. if \\n(eZ .as e\\n(eP \& \&. as e\\n(eP " \&\\$1.\" . ds e\\n(eP \&\\$1. nr eZ \\n(eZ+1. \}.\}.nr oP 1.ie \\n(.$>1 \{\. dO \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9.\}.el \{\. ie \\n(e1 \{\.\\*(e1 \\*(e2 \\*(e3 \\*(e4 \\*(e5 \\*(e6 \\*(e7 \\*(e8 \\*(e9. \}. el \{\. as f1 \\*(e1. \}.\}...\" handle old style arguments such as the arg -Idir.\" in adb, .Oo is a toggle..de Oo.ie \\n(oO .nr oO 0.el .nr oO 1...\" stash punctuation.de oZ.if \\n(hP>=\\n(oZ \{\. nr eP \\n(eP+1. ds e\\n(eP \\*(h\\n(oZ. nr oZ \\n(oZ+1. oZ.\}...\" clean up punctuation vector.de Oz.if \\n(hP>0 \{\. rm h\\n(hP. nr hP \\n(hP-1. Oz.\}...\" uO: go back up created vector cleaning it up along the way.de uO.if \\n(eP>0 \{\. rm e\\n(eP. rr e\\n(eP
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -