home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / linuxdoc-sgml-1.1 / rep / grops / mapping < prev    next >
Encoding:
Text File  |  1995-05-03  |  9.4 KB  |  568 lines

  1.  
  2. % qwertz replacement file
  3. % translates into groff, using ms macros
  4. % manpages can be processed using the man macros
  5.  
  6. % Author:  Tom Gordon
  7.  
  8.  
  9. % Groff dependencies are few.  To port to another roff: 
  10. % 1. Check and modify, if necessary, font changes.  (e.g. In psroff the
  11. % same fonts have other names.)
  12. % 2. Check the code for including Encapsulated PostScript, generated
  13. % for eps elements.
  14. % 3. Also make versions of general.grops and math.grops, which are sed
  15. % scripts translating character entities into groff character references.
  16.  
  17.  
  18. <qwertz>    +    ".nr PS 11\n"
  19.  
  20.             ".nr PI 3n\n"
  21.             ".ds CF \\\\n\%\n"    
  22.             ".ds CH \\&\n"
  23.             ".ds dR $\n"   % dollar, to avoid EQN conflicts
  24.             
  25.             % Footnote style
  26.             ".nr FF 1\n"
  27.  
  28.             % James Clark's trick to prevent unintended paragraph
  29.             % breaks
  30.  
  31.             ".tr \\&\n"
  32.  
  33.             % horizontal line
  34.             ".de hl\n"
  35.             ".br\n"
  36.             "\\l'\\\\n(.lu-\\\\n(.iu'\n"
  37.             "..\n"
  38.  
  39.             % paragraph spacing
  40.             ".if n .nr PD 1v\n"
  41.             
  42.             % h is 1 if first paragraph after heading
  43.  
  44.             ".nr h 0\n" 
  45.  
  46.             % initialize heading level
  47.             
  48.             ".nr il 1\n"    
  49.  
  50.             % Number registers for list
  51.  
  52.             ".nr bi 0\n"  % initialize begin items
  53.             ".nr ll 0\n"  % list level, stores current level
  54.             ".nr el 0\n"  % current enumeration level
  55.  
  56.             % Not all list levels are enumerations, as 
  57.             % itemizations can be embedded within enumerations
  58.             % and vice versa
  59.             
  60.             % type of list level is in \n(t\n(ll, where
  61.             % 0 : itemize, 1 : enumerate, 2: description
  62.  
  63.             % enumerator for an enumeration level is in
  64.             % \n(e\n(el -- i.e. \n(e1=2 means current item of
  65.             % enumeration level 1 is 2
  66.             
  67.             % context-sensitive paragraph macro
  68.  
  69.  
  70. ".de Pp\n"
  71. ".ie \\\\n(ll>0 \\{\\\n"        % within list?
  72. ".ie \\\\n(bi=1 \\{\\\n"   % first par element of item?
  73. ".nr bi 0\n"     % reset bi flag
  74. % if itemization, mark with a bullet
  75. ".if \\\\n(t\\\\n(ll=0 \\{.IP \\\\(bu\\}\n" % itemize
  76. %  if enumeration: increment and print enumerator
  77. % for this enumeration level
  78. ".if \\\\n(t\\\\n(ll=1 \\{.IP \\\\n+(e\\\\n(el.\\}\n"
  79. % if first par element of descrip, do nothing
  80. ".\\}\n"  
  81. ".el .sp \n"        % subsequent par element of item
  82. ".\\}\n"
  83. ".el \\{\\\n"                 % not within list
  84. ".ie \\\\nh=1 \\{\\\n"    % first par after heading
  85. ".LP\n"    
  86. ".nr h 0\n"    % reset h flag
  87. ".\\}\n"            
  88. ".el .PP \n"   
  89. ".\\}\n"
  90. "..\n"    
  91.  
  92.             
  93.             
  94.             % for each level, a number register is created
  95.             % to store its type and current item number, where
  96.             % -1=bullet of an itemized list.
  97.  
  98.             % Format of list level enumerators
  99.  
  100.             ".ds f1 1\n"
  101.             ".ds f2 a\n"
  102.             ".ds f3 i\n"
  103.             ".ds f4 A\n"
  104.  
  105.             % Number registers for theorems
  106.             ".nr def 0\n"
  107.             ".nr prop 0\n"
  108.             ".nr lemma 0\n"
  109.             ".nr coroll 0\n"
  110.             ".nr proof 0\n"
  111.             ".nr theorem 0\n"
  112.  
  113.             % Math
  114.  
  115.             ".nr eqlabel 0\n" % equation counter
  116.             ".EQ\ndelim ($$)\n.EN\n"
  117.             ".ds nequiv { \"relation\" \"\\o'/\\(=='\" }\n"
  118.             ".ds nsub { \"relation\" \"\\o'/\\(sb'\" }\n"
  119.             ".ds nsube { \"relation\" \"\\o'/\\(ib'\" }\n"
  120.             ".ds nsup { \"relation\" \"\\o'/\\(sp'\" }\n"
  121.             ".ds nsupe { \"relation\" \"\\o'/\\(ip'\" }\n"
  122.             ".ds nvDash { \"relation\" \"\\z\\(br\\o'/='\"}\n"
  123.             ".ds nvdash { \"relation\" \"\\z\\(br\\o'/\\(en'\"}\n"
  124.         
  125.  
  126.             % Reference commands
  127.  
  128. % redefine superscript strings so that refer tags look like [this]
  129.  
  130.             ".ds \[. \[\n"
  131.             ".ds .\] \]\n"
  132.  
  133. </qwertz>
  134.  
  135. % set initial level of headings, in register il
  136.  
  137. <article>        +    ".nr il 0"        +
  138. </article>    
  139.  
  140. <report>        +     ".nr il 1"        +
  141. </report>    +    ".bp\n"
  142.             ".rm LH\n.rm RH\n"
  143.             ".TC"            +
  144.  
  145. <book>        +    ".nr il 1"        +
  146. </book>        +    ".rm LH\n.rm RH\n"
  147.             ".bp\n"
  148.             ".TC"            +
  149.  
  150. <notes>        
  151. </notes>
  152.  
  153. <manpage>    +    ".nr il -1"        +
  154. </manpage>    
  155.  
  156. <titlepag>    
  157. </titlepag>
  158.  
  159. <title>        +    ".TL"            +
  160. </title>    
  161.  
  162. <subtitle>    +    ".br\n"
  163.             ".ft R\n"
  164.             ".SM"        +
  165. </subtitle>    +    ".LG"            +
  166.  
  167. <author>
  168. </author>
  169.  
  170. <name>        +    ".AU"            +
  171. </name>
  172.  
  173. <and>        
  174. </and>
  175.  
  176. <thanks>            "\\**\n"    
  177.             ".FS"            +
  178. </thanks>    +    ".FE"            +
  179.  
  180. <inst>        +    ".AI"            +
  181. </inst>
  182.  
  183. <newline>    +    ".br"            +
  184. </newline>
  185.  
  186. <label>        
  187. </label>    
  188.  
  189. <header>    
  190. </header>    
  191.  
  192. <lhead>        +    ".EH '"
  193. </lhead>        "'''"        +
  194.  
  195. <rhead>        +    ".OH '''"
  196. </rhead>        "'"            +
  197.  
  198. <comment>    +    ".PP\n.ft HI"        +
  199. </comment>    +    ".ft P"            +
  200.  
  201. <abstract>    +    ".AB"            +
  202. </abstract>    +    ".AE"            +
  203.  
  204. <appendix>    +     ".af H1 A"        +
  205. </appendix>
  206.  
  207. % limitation: no list of figures or tables.  A table of contents
  208. % is always generated for books and reports. Thus these next three tags
  209. % are no-ops
  210.  
  211. <toc>        
  212. </toc>
  213.  
  214. <lof>    
  215. </lof>
  216.  
  217. <lot>    
  218. </lot>
  219.  
  220. <chapt>        +    ".bp\n"    
  221.             ".NH \\n(il "        +
  222. </chapt>
  223.  
  224. <sect>        +    ".NH 1+\\n(il"         +
  225. </sect>
  226.  
  227. <sect1>        +    ".NH 2+\\n(il"     +
  228. </sect1>
  229.  
  230. <sect2>        +    ".NH 3+\\n(il"        +
  231. </sect2>
  232.  
  233. <sect3>        +    ".NH 4+\\n(il"        +
  234. </sect3>    
  235.  
  236. <sect4>        +    ".NH 5+\\n(il"        +
  237. </sect4>
  238.  
  239. <heading>        ".ds h "
  240. </heading>    +    "\\*h\n"
  241.             ".XS \\n%\n"
  242.             "\\*(SN \\*h\n"
  243.             ".XE\n"        
  244.             ".nr h 1\n"  % set heading flag to true
  245.  
  246. <p>        +    ".Pp"            +
  247. </p>
  248.  
  249. <itemize>    +    ".nr ll +1\n"       % increment list level
  250.             ".nr t\\n(ll 0\n"    % set type of level to itemize
  251. </itemize>    +    ".nr ll -1"    +  % decrement list level
  252.     
  253.  
  254. <enum>        +    ".nr ll +1\n"        % increment list level
  255.             ".nr el +1\n"        % increment enumeration level
  256.             ".nr t\\n(ll 1\n"   % set type of level to enum
  257.             ".nr e\\n(el 0 1\n" % initialize enumerator
  258.             ".af e\\n(el \\*(f\\n(el\n" % style of enumerator
  259.             ".if \\n(ll>1 .RS"  +
  260. </enum>        +    ".if \\n(ll>1 .RE\n"
  261.             ".br\n"            
  262.             ".nr el -1\n"        % decrement enumeration level
  263.             ".nr ll -1"    +   % decrement list level 
  264.  
  265. <descrip>    +    ".RS\n"
  266.             ".nr ll +1\n"        % increment list level
  267.             ".nr t\\n(ll 2\n"   % set type of level to descrip
  268. </descrip>    +    ".nr ll -1\n"        % decrement list level
  269.             ".RE"        +
  270.  
  271. % number register bi means "begin item".  Used in the .P macro to print
  272. % bullets or numbers at beginning of first paragraph of an item.
  273. % If bi=1 then the paragraph is the first one of the item.
  274.  
  275. <item>        +    ".nr bi 1"        +
  276. </item>    
  277.  
  278. <tag>        +    ".IP \"\\fB"
  279. </tag>            "\\fP\"\n"
  280.             ".nr bi 1"            +
  281.  
  282. <cite>        +    ".\[\n[ID]\n.\]"    +
  283. </cite>    
  284.  
  285. <ncite>        +    ".\[\n[ID]\n.\]\n([NOTE])"
  286. </ncite>
  287.  
  288. <footnote>        "\\**\n"
  289.             ".FS"            +
  290. </footnote>    +    ".FE"            +
  291.  
  292. <sq>            "\\*Q"
  293. </sq>            "\\*U"
  294.  
  295. <lq>        +    ".RS\n"
  296.             ".nr LL \\n(LL-\\n(PI"    +
  297. </lq>        +    ".nr LL \\n(LL+\\n(PI\n"
  298.             ".RE"            +
  299.  
  300. <em>            "\\fI"            
  301. </em>             "\\fP"            
  302.  
  303. <bf>            "\\fB"            
  304. </bf>            "\\fR"            
  305.  
  306. <it>            "\\fI"            
  307. </it>            "\\fR"        
  308.  
  309. <sf>            "\\f(HR"        
  310. </sf>            "\\fR"            
  311.  
  312. <sl>            "\\f(HI"        
  313. </sl>            "\\fR"            
  314.  
  315. <tt>            "\\f(CR"
  316. </tt>            "\\fR"
  317.  
  318.  
  319. <ref>            "??"
  320. </ref>
  321.  
  322. <pageref>        "??"
  323. </pageref>
  324.  
  325. <x>    
  326. </x>
  327.  
  328. <mc>            
  329. </mc>
  330.  
  331. <biblio>    +    ".\[\n"
  332.             "$LIST$\n"
  333.             ".\]"            +
  334. </biblio>
  335.  
  336. <code>        +    ".EQ\ndelim off\n.EN\n"
  337.             ".DS L\n"
  338.             ".hl\n"
  339.             ".ft CR\n"
  340.              ".eo"            +
  341.  
  342. </code>        +    ".ec\n"
  343.             ".hl\n"
  344.             ".DE\n"
  345.              ".EQ\ndelim ($$)\n.EN\n"
  346.             ".ft P\n"
  347.             ".LP"    + % continue previous paragraph
  348.  
  349. <verb>        +    ".EQ\ndelim off\n.EN\n"
  350.             ".DS L\n"
  351.             ".ft CR\n"
  352.              ".eo"            +
  353.  
  354. </verb>        +    ".ec\n"
  355.             ".DE\n"
  356.              ".EQ\ndelim ($$)\n.EN\n"
  357.             ".ft P\n"
  358.             ".LP"    +  % continue previous paragraph
  359.  
  360. % theorems and such
  361.  
  362. <def>        +    ".sp\n"
  363.             ".nr def \\n\[def\]+1\n"
  364.             ".B \"Definition \\n\[def\] \"" +
  365. </def>        +    ".ft P\n.sp"         +
  366.  
  367. <prop>        +    ".sp\n"
  368.             ".nr prop \\n\[prop\]+1\n"
  369.             ".B \"Proposition \\n\[prop\] \"" +
  370. </prop>        +    ".ft P\n.sp"         +
  371.  
  372.  
  373. <lemma>        +    ".sp\n"
  374.             ".nr lemma \\n\[lemma\]+1\n"
  375.             ".B \"Lemma \\n\[lemma\] \""    +
  376. </lemma>    +    ".ft P\n.sp"         +
  377.  
  378. <coroll>    +    ".sp\n"
  379.             ".nr coroll \\n\[coroll\]+1\n"
  380.             ".B \"Corolloary \\n\[coroll\] \"" +
  381. </coroll>    +    ".ft P\n.sp"         +
  382.  
  383. <proof>        +    ".sp\n"
  384.             ".nr proof \\n\[proof\]+1\n"
  385.             ".B \"Proof \\n\[proof\] \""    +
  386. </proof>    +    ".ft P\n.sp"         +
  387.  
  388. <theorem>    +    ".sp\n"
  389.             ".nr theorem \\n\[theorem\]+1\n"
  390.             ".B \"Theorem \\n\[theorem\] \"" +
  391. </theorem>    +    ".ft P\n.sp"         +
  392.  
  393. <thtag>        +     ".B\n("
  394. </thtag>        ")\n.I"            +
  395.  
  396. % mathematics 
  397.  
  398. <f>            "$"            
  399. </f>            "$"            
  400.  
  401. <dm>        +    ".DS L\n"    
  402.             ".EQ"            +
  403. </dm>        +    ".EN\n"
  404.             ".DE"            +
  405.  
  406. <eq>        +    ".DS L\n"    
  407.             ".nr eqlabel \\n\[eqlabel\]+1\n"
  408.             ".EQ \\n\[eqlabel\]"        +
  409. </eq>        +    ".EN\n"
  410.             ".DE"            +
  411.  
  412. <fr>            
  413. </fr>        
  414.  
  415. <nu>            "{"
  416. </nu>            "} over "
  417.  
  418. <de>            "{"
  419. </de>            "}"
  420.  
  421. <lim>            
  422. </lim>
  423.  
  424. <op>
  425. </op>
  426.  
  427. <ll>            " from {"
  428. </ll>            "}"
  429.  
  430. <ul>            " to {"
  431. </ul>            "}"
  432.  
  433. <opd>
  434. </opd>
  435.  
  436. <pr>            " prod "
  437. </pr>
  438.  
  439. <in>            " int "
  440. </in>
  441.  
  442. <sum>            " sum "
  443. </sum>        
  444.  
  445. % limitation: eqn only does square roots!
  446.  
  447. <root>            " sqrt {"
  448. </root>            "}"
  449.  
  450. <ar>        +    ".TS\n"
  451.             "center, tab(|), delim ($$); \n"
  452.             "[ca]."            +
  453. </ar>        +    ".TE"            +
  454.  
  455. <arr>           "\n"            
  456. </arr>
  457.  
  458. <arc>           "|"
  459. </arc>
  460.  
  461.  
  462. <sup>            " sup {"
  463. </sup>            "}"
  464.  
  465. <inf>            " sub {"
  466. </inf>            "}"
  467.  
  468.  
  469. <unl>            "{"
  470. </unl>            "} under "
  471.  
  472. <ovl>            "{"
  473. </ovl>            "} bar "
  474.  
  475. <rf>            " bold{"
  476. </rf>            "}"
  477.  
  478. <v>            "{"
  479. </v>            "} vec "
  480.  
  481. % limitation: no calligraphic characters, using helvetica italics instead.  Is there a better font?
  482.  
  483. <fi>            "\\f(HI"    
  484. </fi>            "\\fP"    
  485.  
  486. <phr>            " roman }"
  487. </phr>            "}"
  488.  
  489.  
  490. <tu>        +    ".br"        +
  491. </tu>
  492.  
  493. % figures
  494.  
  495. <figure>    % +    ".KF"            +
  496. </figure>    % +    ".KE"            +
  497.  
  498. <eps>        +      ".if t .PSPIC [file].ps\n"
  499.             ".if n .sp 4"          +
  500. </eps>                    
  501.                 
  502. % Are TeX units properly handled by this translation of ph?
  503.  
  504. <ph>        +    ".sp [VSPACE]"        +
  505. </ph>    
  506.  
  507. <caption>    +    ".sp\n.ce"        +
  508. </caption>
  509.  
  510. % tables
  511.  
  512. <table>        +    ".KF\n.R"        +
  513. </table>    +    ".KE"            +
  514.  
  515. <tabular>    +    ".TS\n"
  516.             "center, tab(|), delim ($$);\n"
  517.             "[ca]."            +
  518. </tabular>    +    ".TE"            +
  519.  
  520. <rowsep>        "\n"            +
  521. </rowsep>
  522.  
  523. <colsep>        "|"
  524. </colsep>
  525.  
  526. <hline>        +    "_"            +
  527. </hline>
  528.  
  529. <slides>    +     ".nr PS 18"        +
  530. </slides>
  531.  
  532. <slide>    
  533. </slide>    +    ".bp\n\\&"            +
  534.  
  535. % letters -- replacement for email, using mh format.
  536.  
  537. <letter>    +    ".nf"    +
  538. </letter>    +
  539.  
  540. <from>        +     "From: "
  541. <to>        +    "To: "
  542.  
  543. <address>    +    ".de Ad\n"
  544. </address>    +    ".."    +
  545.  
  546. <email>            " <"
  547. </email>        ">"
  548.  
  549. <subject>    +    "Subject: "
  550.  
  551. <sref>        +    "Sref: "
  552. <rref>        +    "In-Reply-To: "
  553.  
  554. <cc>        +    "cc: "
  555.  
  556. <opening>    +    ".fi\n.LP"    +
  557.  
  558. <closing>    +    ".LP"        +
  559.  
  560. <encl>        +    ".XP\n"
  561.             "encl: "
  562.  
  563. <ps>        +    ".LP\np.s."
  564.  
  565.  
  566. % end of roff replacement file
  567.  
  568.