latex2html.ini 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621
  1. #
  2. # This pre-pre-processor subroutine handles $ signs in the left column
  3. # of the Examples environment. latex2html scans very early for math
  4. # delimiters like $, even before special handler subroutines are called.
  5. # Similarly, one occurence of % needs to be handled.
  6. #
  7. sub pre_pre_process {
  8. local($contents) = "";
  9. local($body);
  10. local($rest);
  11. ## some special cases
  12. # handle percent sign
  13. s/\\begin\{Command\}\[percent\]\{%\}/\\begin{Command}[percent]{\\%}/;
  14. # $m > n$ in CHOOSE
  15. s/\$m > n\$/m > n/;
  16. # $\pi/2$ in TAN
  17. s/\$\\pi\/2\$/PI\/2/g;
  18. ## END of special cases
  19. ## Handle Bigexample environment (insert verbatim env)
  20. while (/\\begin\{Bigexample\}(.+?)\\end\{Bigexample\}/s) {
  21. $contents .= $`;
  22. $body = "\\begin{Bigexample}\n\\begin{verbatim}\n" . $& . "\\end{verbatim}\n\\end{Bigexample}\n" ;
  23. $_ = $';
  24. $contents .= $body;
  25. }
  26. $_ = $contents . $_;
  27. ## Handle Examples environment
  28. while (/\\begin\{Examples\}(.+?)\\end\{Examples\}/s) {
  29. $contents .= $`;
  30. $body = $&;
  31. $_ = $';
  32. # special case $ or \$ just at end of column
  33. $body =~ s/(^|[^\\])\$(\s*)(&|\\\\)/$1\\\$$2$3/sg;
  34. $contents .= $body;
  35. }
  36. $_ = $contents . $_;
  37. }
  38. sub post_post_process {
  39. s/<TITLE>No Title<\/TITLE>/<TITLE>REDUCE Reference Manual.<\/TITLE>/;
  40. s/<BODY/<BODY BGCOLOR="#ffffff"/;
  41. }
  42. &ignore_commands(<<_IGNORED_COMMANDS_)
  43. documentclass # [] # {} # []
  44. NeedsTeXFormat#{}#[]
  45. NEWdescription#{}
  46. NEWfeature#{}
  47. quad
  48. textcompwordmark
  49. null
  50. _IGNORED_COMMANDS_
  51. &process_commands_in_tex(<<__RAW_ARG_CMDS_);
  52. textcircled # {}
  53. textvisiblespace
  54. textparagraph
  55. __RAW_ARG_CMDS_
  56. #%ignore = ('TEX',1,%ignore);
  57. %ignore = ('INFO',1,%ignore);
  58. #sub do_env_INFO {}
  59. sub do_env_TEX {}
  60. sub do_cmd_REDUCE {
  61. join("","REDUCE",shift);
  62. }
  63. sub do_cmd_IFTEX {
  64. local($_) = @_;
  65. local($texpart) = &missing_braces unless (
  66. (s/$next_pair_pr_rx/$texpart = $2;''/eo)
  67. ||(s/$next_pair_rx/$texpart = $2;''/eo));
  68. local($nontexpart) = &missing_braces unless (
  69. (s/$next_pair_pr_rx/$nontexpart = $2;''/eo)
  70. ||(s/$next_pair_rx/$nontexpart = $2;''/eo));
  71. $nontexpart . $_;
  72. }
  73. sub do_cmd_name {
  74. # local($_) = @_;
  75. # local($rest) = $_;
  76. # $rest =~ s/$next_pair_pr_rx//o;
  77. # join('',"<tt>",$&,"</tt>",$rest);
  78. &styled_text_chunk('TT','','font','','', '', @_);
  79. }
  80. sub do_cmd_nameindex {
  81. local($_) = @_;
  82. local($br_id,$name);
  83. $name = &missing_braces unless (
  84. (s/$next_pair_pr_rx/($br_id, $name) = ($1, $2);''/eo)
  85. ||(s/$next_pair_rx/($br_id, $name) = ($1, $2);''/eo));
  86. &anchor_label($name,$CURRENT_FILE,'');
  87. join('',"<TT>" . &make_index_entry($br_id,$str) . "</TT>",$_);
  88. }
  89. #sub do_cmd_hyperref {
  90. # local($_) = @_;
  91. # local($rest) = $_;
  92. # $rest =~ s/$next_pair_pr_rx//o;
  93. # join('',"<tt>",$&,"</tt>",$rest);
  94. #}
  95. sub do_cmd_nameref {
  96. local($_) = @_;
  97. &process_ref($cross_ref_mark,$cross_ref_mark,1);
  98. }
  99. sub do_cmd_key {
  100. local($_) = @_;
  101. local($rest) = $_;
  102. $rest =~ s/$next_pair_pr_rx//o;
  103. join('',"<KBD>",$&,"</KBD>",$rest);
  104. }
  105. sub do_cmd_arg {
  106. local($_) = @_;
  107. local($rest) = $_;
  108. $rest =~ s/$next_pair_pr_rx//o;
  109. join('',"<i>",$&,"</i>",$rest);
  110. }
  111. #sub do_cmd_key {
  112. # local($_) = @_;
  113. # local($rest) = $_;
  114. # $rest =~ s/$next_pair_pr_rx//o;
  115. # join('',"<i>",$&,"</i>",$rest);
  116. #}
  117. sub do_cmd_repeated {
  118. '<SUP>+</SUP>';
  119. }
  120. sub do_cmd_optional {
  121. '<SUP>*</SUP>';
  122. }
  123. sub do_cmd_meta {
  124. local($_) = @_;
  125. local($rest) = $_;
  126. $rest =~ s/$next_pair_pr_rx//o;
  127. join('',"<i>",$&,"</i>",$rest);
  128. }
  129. sub do_env_Syntax {
  130. local($_) = @_;
  131. # print STDERR "\nEntering Syntax with body: $_\n";
  132. s/(^|[^\\]) /$1~/g;
  133. s/$tex2html_deferred_rx\\par$tex2html_deferred_rx2//go; # get rid of empty input lines
  134. s/$tex2html_envs_rx\\\(/(/go; s/\\\(/(/go;
  135. s/\\\)$tex2html_envs_rx/)/go; s/\\\)/)/go;
  136. # print STDERR "\nSyntax: after translating \\(\\): $_\n";
  137. $_ = &translate_commands(&translate_environments($_));
  138. # print STDERR "\nExiting Syntax with body: $_\n";
  139. "<P>\n<FONT SIZE=\"+1\">\n&nbsp;&nbsp;&nbsp;&nbsp;$_\n</FONT><P>";
  140. }
  141. sub do_newitemEnv {
  142. local($type,$_) = @_;
  143. local($optional_ref_key) = &get_next_optional_argument;
  144. local($br_id,$name);
  145. $name = &missing_braces unless (
  146. (s/$next_pair_pr_rx/($br_id, $name) = ($1, $2);''/eo)
  147. ||(s/$next_pair_rx/($br_id, $name) = ($1, $2);''/eo));
  148. $name =~ s/\\_/_/g;
  149. $name =~ s/$dol_mark/\$/go;
  150. local($nameu) = $name;
  151. $nameu = "\U$name\E" unless $name =~ /^<.+>$/;
  152. &make_index_entry($br_id,$name);
  153. # &make_index_entry($br_id,"$type!$name");
  154. local($ref_key) = ($optional_ref_key || $name);
  155. $_ = &translate_commands(&translate_environments($_));
  156. local($header) = <<XXX;
  157. <TABLE COLS=2 WIDTH=100%>
  158. <TR>
  159. <TD ALIGN=LEFT NOWRAP><FONT SIZE="+2"><B>$nameu</B></FONT></TD>
  160. <TD ALIGN=RIGHT NOWRAP><FONT SIZE="+2"><B>$type</B></FONT></TD>
  161. </TR>
  162. </TABLE>
  163. XXX
  164. return &anchor_label("\L$ref_key\Q",$CURRENT_FILE,$header . $_);
  165. }
  166. sub do_env_Command {
  167. &do_newitemEnv("Command",@_);
  168. }
  169. sub do_env_Operator {
  170. &do_newitemEnv("Operator",@_);
  171. }
  172. sub do_env_Function {
  173. &do_newitemEnv("Function",@_);
  174. }
  175. sub do_env_Switch {
  176. &do_newitemEnv("Switch",@_);
  177. }
  178. sub do_env_Variable {
  179. &do_newitemEnv("Variable",@_);
  180. }
  181. sub do_env_Declaration {
  182. &do_newitemEnv("Declaration",@_);
  183. }
  184. sub do_env_Package {
  185. &do_newitemEnv("Concept",@_);
  186. }
  187. sub do_env_Concept {
  188. &do_newitemEnv("Concept",@_);
  189. }
  190. sub do_env_Constant {
  191. &do_newitemEnv("Constant",@_);
  192. }
  193. sub do_env_Type {
  194. &do_newitemEnv("Type",@_);
  195. }
  196. sub do_env_info {
  197. &do_newitemEnv("info",@_);
  198. }
  199. sub do_env_Introduction {
  200. &do_newitemEnv("Introduction",@_);
  201. }
  202. sub do_env_Bigexample {
  203. local($_) = @_;
  204. join('',"<H3>Example</H3>\n",&translate_commands(&translate_environments($_)));
  205. }
  206. sub do_env_Comments {
  207. local($_) = @_;
  208. join('',"<H3>Comments</H3>\n",$_);
  209. }
  210. sub do_env_Related {
  211. join('',"<H3>Related Information</H3>\n",&do_env_description);
  212. }
  213. $match_rfrac = "<!-- START rfrac#(\\d+) -->(.+)<!-- END rfrac#\\1 -->";
  214. $match_rfrac_cell = "<(TD|TD VALIGN=.+)>(.+?)</TD>";
  215. $match_rfrac_row_upper = "<TR ALIGN=CENTER>\n\\s+$match_rfrac_cell<!-- UPPER rfrac#\\1 -->\n\\s+</TR>";
  216. $match_rfrac_row_middle = "<TR ALIGN=CENTER>\n\\s+$match_rfrac_cell<!-- MIDDLE rfrac#\\1 -->\n\\s+</TR>";
  217. $match_rfrac_row_lower = "<TR ALIGN=CENTER>\n\\s+$match_rfrac_cell<!-- LOWER rfrac#\\1 -->\n\\s+</TR>";
  218. $match_rfrac_body = "<!-- START rfrac#(\\d+) -->\n<TABLE VALIGN=MIDDLE>\n\\s+$match_rfrac_row_upper\n\\s+$match_rfrac_row_middle\n\\s+$match_rfrac_row_lower\n</TABLE>\n<!-- END rfrac#\\1 -->";
  219. sub condense_rfracs {
  220. local($cell) = @_;
  221. return $cell unless ($cell =~ /$match_rfrac/so);
  222. local(@lines) = split(/<P>/,$cell);
  223. foreach (@lines) {
  224. $_ = &condense_line_with_rfrac($_);
  225. }
  226. $cell = join("<P>",@lines);
  227. return $cell;
  228. }
  229. sub extract_rfrac_parts {
  230. local($body) = @_;
  231. # print STDERR "\nExtracting parts from: $body\n";
  232. $body =~ /$match_rfrac_body/so;
  233. my($num,$bar,$den) = ($3,$5,$7);
  234. # print STDERR "\nParts:\nNum: $num\nBar: $bar\nDen: $den\n";
  235. $num = &condense_line_with_rfrac($num);
  236. $den = &condense_line_with_rfrac($den);
  237. # print STDERR "\nCondensed parts:\nNum: $num\nBar: $bar\nDen: $den\n";
  238. return($num,$bar,$den);
  239. }
  240. sub condense_line_with_rfrac {
  241. local($cell) = @_;
  242. return ("$cell<!-- WIDTH=" . &count_width($cell) . " -->")
  243. unless ($cell =~ /$match_rfrac/so);
  244. # print STDERR "\ncell with standalone rfrac's: $cell\n";
  245. my $restcell = $cell;
  246. my(@upperparts,@middleparts,@lowerparts);
  247. my $totalwidth = 0;
  248. while ($restcell =~ s/$match_rfrac/$2/so) {
  249. my $before_rfrac = $`;
  250. my $after_rfrac = $';
  251. my $rfrac_proper = $&;
  252. if ($before_rfrac) {
  253. push @upperparts,"&nbsp;";
  254. push @middleparts,$before_rfrac;
  255. push @lowerparts,"&nbsp;";
  256. $totalwidth += &count_width($before_rfrac);
  257. }
  258. my($num,$bar,$den) = &extract_rfrac_parts($rfrac_proper);
  259. my($numwidth,$denwidth,$width) = (0,0,0);
  260. $num =~ s/<!-- WIDTH=(\d+) -->$/$numwidth=$1;''/e;
  261. $den =~ s/<!-- WIDTH=(\d+) -->$/$denwidth=$1;''/e;
  262. if ($numwidth && $denwidth) {
  263. # recalculate width
  264. $width = 2 + ($numwidth > $denwidth ? $numwidth : $denwidth);
  265. # print STDERR "\nSetting bar width to 2+max($numwidth,$denwidth) = $width\n";
  266. $bar = "-" x (2*$width);
  267. }
  268. push @upperparts,$num;
  269. push @middleparts,$bar;
  270. push @lowerparts,$den;
  271. $totalwidth += length($bar)/2;
  272. $restcell = $after_rfrac;
  273. }
  274. if ($restcell ) {
  275. push @upperparts,"&nbsp;";
  276. push @middleparts,$restcell;
  277. push @lowerparts,"&nbsp;";
  278. $totalwidth += &count_width($restcell);
  279. }
  280. # now put the bits together
  281. my $i;
  282. $cell = "<TABLE VALIGN=MIDDLE>\n <TR ALIGN=CENTER>\n";
  283. for ($i = 0; $i <= $#upperparts; $i++) {
  284. $cell .= " <TD>$upperparts[$i]</TD>\n";
  285. }
  286. $cell .= " </TR>\n <TR ALIGN=CENTER>\n";
  287. for ($i = 0; $i <= $#middleparts; $i++) {
  288. $cell .= " <TD>$middleparts[$i]</TD>\n";
  289. }
  290. $cell .= " </TR>\n <TR ALIGN=CENTER>\n";
  291. for ($i = 0; $i <= $#lowerparts; $i++) {
  292. $cell .= " <TD>$lowerparts[$i]</TD>\n";
  293. }
  294. $cell .= " </TR>\n</TABLE><!-- WIDTH=$totalwidth -->\n";
  295. # print STDERR "\ncell with replaced rfrac's: $cell\n";
  296. return $cell;
  297. }
  298. sub do_env_Examples {
  299. local($_) = @_;
  300. local($colspec) = "ll";
  301. # print STDERR "\nEntering do_env_Examples\n";
  302. s/\\\\\s*\[([^]]+)\]/\\\\/g; # TKM - get rid of [N.n pc] on end of rows...
  303. s/\\newline\s*\[([^]]+)\]/\\newline/g;
  304. s/\n\s*\n/\n/g; # Remove empty lines (otherwise will have paragraphs!)
  305. local($i,@colspec,$char,$cols,$cell,$htmlcolspec,$frames,$rules);
  306. local(@rows,@cols,$border);
  307. local($colspan,$cellcount);
  308. $border = ""; $frame = "";
  309. ($htmlcolspec,$frames,$rules,$cols,@colspec) =
  310. &translate_colspec($colspec, 'TD');
  311. $frames .= "t" if ( s/^\s*\\hline// );
  312. $frames .= "b" if ( s/\\hline\s*$// );
  313. $rules .= "r" if ( /\\[ch]line/ );
  314. if ( $frames || $rules ) {
  315. $border = " BORDER";
  316. $rule = " RULES=NONE";
  317. $frame = " FRAME=$frameoptions{$frames}" if ($frames);
  318. $rule = " RULES=GROUPS" if ($rules);
  319. };
  320. @rows = split(/\\\\/);
  321. $#rows-- if ( $rows[$#rows] =~ /^\s*$/ );
  322. local($return) = "<H3>Examples</H3>\n<TABLE COLS=$cols$border$frame$rule$_[1]>\n";
  323. $return .= "$htmlcolspec\n";
  324. $return .= "<TBODY>\n" if ( $rules =~ /r/ );
  325. foreach (@rows) {
  326. # print STDERR "\nNext row: >>$_<<\n";
  327. next if /^\s*$/;
  328. if ( s/^(\s*\\hline\s*)+//g ) {
  329. $return .= "</TBODY><TBODY>\n";
  330. };
  331. $return .= "<TR>";
  332. ($leftcol,$rightcol) = split(/$html_specials{'&'}/o);
  333. $leftcolspec = $colspec[0];
  334. # handle left column
  335. $colspan = 0;
  336. $leftcol =~ s/;SPMquot;/&#34;/g;
  337. $leftcol =~ s/~/&#126;/g;
  338. # $leftcol =~ s/\{/&#123;/g;
  339. # $leftcol =~ s/\}/&#125;/g;
  340. # May modify $leftcolspec
  341. # print STDERR "\nleftcol before translate: $leftcol\n";
  342. $leftcell = &translate_commands(&translate_environments($leftcol));
  343. # print STDERR "\nleftcell after translate: $leftcell\n";
  344. if ( $colspan ) {
  345. for ( $cellcount = 0; $colspan > 0; $colspan-- ) {
  346. $colspec[$i++] =~ s/<TD/$cellcount++;"<TD"/ge;
  347. }
  348. $i--;
  349. $leftcolspec =~ s/>$content_mark/ COLSPAN=$cellcount$&/;
  350. };
  351. $leftcolspec =~ s/$content_mark/<TT>$leftcell<\/TT>/;
  352. $return .= $leftcolspec;
  353. next if $colspan > 1;
  354. # handle right column
  355. $rightcolspec = $colspec[1];
  356. $colspan = 0;
  357. # print STDERR "\nrightcol before translate: $rightcol\n";
  358. $rightcell = "\&nbsp;"x4 . '<TT>----&gt;</TT>' . "\&nbsp;"x4 .
  359. &translate_commands(&translate_environments($rightcol)) if $rightcol;
  360. # print STDERR "\nrightcell after translate: $rightcell\n";
  361. while ($rightcell =~ /\^$any_next_pair_pr_rx/o) {
  362. # print STDERR "\nrightcell with superscript: $rightcell\n";
  363. $rightcell =~ s/\^$any_next_pair_pr_rx/<SUP>$2<\/SUP>/go;
  364. # print STDERR "result is: $rightcell\n";
  365. }
  366. # try to handle rfrac's
  367. $rightcell = &condense_rfracs($rightcell);
  368. if ( $colspan ) {
  369. for ( $cellcount = 0; $colspan > 0; $colspan-- ) {
  370. $colspec[$i++] =~ s/<TD/$cellcount++;"<TD"/ge;
  371. }
  372. $i--;
  373. $rightcolspec =~ s/>$content_mark/ COLSPAN=$cellcount$&/;
  374. };
  375. $rightcolspec =~ s/$content_mark/$rightcell/;
  376. $return .= $rightcolspec;
  377. $return .= "</TR>\n";
  378. };
  379. $return .= "</TBODY>\n" if ( $rules =~ /r/ );
  380. $return .= "</TABLE>\n";
  381. # print STDERR "\nExamples returns: $return\n";
  382. $return;
  383. }
  384. $rfrac_counter = 0;
  385. sub do_cmd_rfrac {
  386. local($_) = @_;
  387. local($num,$den);
  388. local($num) = &missing_braces unless (
  389. (s/$next_pair_pr_rx/$num = $2;''/eo)
  390. ||(s/$next_pair_rx/$num = $2;''/eo));
  391. local($den) = &missing_braces unless (
  392. (s/$next_pair_pr_rx/$den = $2;''/eo)
  393. ||(s/$next_pair_rx/$den = $2;''/eo));
  394. # print STDERR "\nEntering rfrac with args: $num,$den\n";
  395. local($numwidth,$denwidth) = (&count_width($num),&count_width($den));
  396. local($width) = 2 + ($numwidth > $denwidth ? $numwidth : $denwidth);
  397. local($bar) = "-" x (2*$width);
  398. $rfrac_counter++;
  399. $_ = <<RFRAC . $_;
  400. <!-- START rfrac#$rfrac_counter -->
  401. <TABLE VALIGN=MIDDLE>
  402. <TR ALIGN=CENTER>
  403. <TD>$num</TD><!-- UPPER rfrac#$rfrac_counter -->
  404. </TR>
  405. <TR ALIGN=CENTER>
  406. <TD VALIGN=BASELINE>$bar</TD><!-- MIDDLE rfrac#$rfrac_counter -->
  407. </TR>
  408. <TR ALIGN=CENTER>
  409. <TD>$den</TD><!-- LOWER rfrac#$rfrac_counter -->
  410. </TR>
  411. </TABLE>
  412. <!-- END rfrac#$rfrac_counter -->
  413. RFRAC
  414. # print STDERR "\nExiting rfrac with args: $_\n";
  415. $_;
  416. }
  417. sub count_width {
  418. local($_) = @_;
  419. s/&\w+;/ /g;
  420. s/--/ /g;
  421. s/<TD>(.+?)<\/TD>/$1/;
  422. s/<TT>(.+?)<\/TT>/$1/;
  423. s/\^$any_next_pair_pr_rx/$2/g;
  424. s/<SUP>(.+?)<\/SUP>/$1/;
  425. length;
  426. }
  427. sub do_cmd_explanationi {
  428. local($_) = @_;
  429. local($text) = &missing_braces unless (
  430. (s/$next_pair_pr_rx/$text = $2;''/eo)
  431. ||(s/$next_pair_rx/$text = $2;''/eo));
  432. local($dmy1,$dmy2,$dmy3,$dmy4);
  433. $colspan = 2;
  434. local($celltag) = "TD";
  435. ($dmy1,$dmy2,$dmy3,$dmy4,$leftcolspec) = &translate_colspec("p{0.95\textwidth}", $celltag);
  436. "<I>$text</I>";
  437. }
  438. sub do_cmd_explanation {
  439. &do_cmd_explanationi;
  440. }
  441. sub do_cmd_explanationo {
  442. &styled_text_chunk('EM','em','font','variant','','', @_);
  443. }
  444. sub do_env_multilineinput {
  445. local($_) = @_;
  446. s/$tex2html_deferred_rx\\par$tex2html_deferred_rx2/\n<P>\n<P>\n/go;
  447. # s/\n/\n<P>\n/mg;
  448. # s/ /&nbsp;/mg;
  449. $leftcolspec =~ s/<TD VALIGN=BASELINE /<TD VALIGN=BOTTOM /;
  450. "<PRE>\n$_\n</PRE>";
  451. }
  452. sub do_env_multilineoutput {
  453. local($_) = @_;
  454. s/$next_pair_rx//o;
  455. # print STDERR "Body of multilineoutput:\n$_\n";
  456. s/$tex2html_deferred_rx\\par$tex2html_deferred_rx2/\n<P>\n<P>\n/go;
  457. # print STDERR "Body of multilineoutput(2):\n$_\n";
  458. # s/\n/\n<P>\n/mg;
  459. # s/ /&nbsp;/mg;
  460. s/-/--/g;
  461. # print STDERR "Body of multilineoutput(3):\n$_\n";
  462. "<PRE>\n" . &translate_commands($_) . "\n</PRE>";
  463. }
  464. ##
  465. ## correct crazy handling of itemlabels
  466. ##
  467. sub do_env_itemize {
  468. local($_) = @_;
  469. $itemize_level++;
  470. #RRM - catch nested lists
  471. &protect_useritems(*_);
  472. $_ = &translate_environments($_);
  473. # if (/^\s*$item_description_rx/) {
  474. local($bullet)='&nbsp;';
  475. SWITCH: {
  476. if ($itemize_level==1) {
  477. $bullet .= "*";
  478. last SWITCH; }
  479. if ($itemize_level==2) {
  480. $bullet .= "-";
  481. last SWITCH; }
  482. if ($itemize_level==3) {
  483. $bullet .= "*";
  484. last SWITCH; }
  485. }
  486. $itemize_level--;
  487. if (/\s*$item_description_rx/) {
  488. # Contains user defined optional labels
  489. &do_env_description($_, " COMPACT", $bullet)
  490. } else { &list_helper($_,'UL'); }
  491. }
  492. 1;