1# $Id: chemstr.perl,v 1.1 1998/08/24 09:48:46 RRM Exp $
2#
3#  chemstr.perl   by Ross Moore <ross@mpce.mq.edu.au>
4#
5# This file is part of the LaTeX2HTML support for the XyM-TeX package
6# for TeX and LaTeX by Shinsaku Fujita
7#
8# Change Log
9# ==========
10# $Log chemstr.perl,v $
11#
12
13package main;
14
15$XyMname = (($HTML_VERSION >= 3.0)? 'X<SUP><BIG>Y</BIG></SUP>M' : 'XyM');
16
17sub do_cmd_XyMTeX { join ('', $XyMname, $TeXname, @_[0]) }
18sub do_cmd_XyM { $XyMname . @_[0] }
19sub do_cmd_UPSILON {
20    local($br_idA) = ++$global{'max_id'};
21    local($br_idB) = ++$global{'max_id'};
22    join(''
23	, &translate_commands(&translate_environments(
24	    "\\begin$O$br_idA${C}math$O$br_idA$C\\Upsilon\\end$O$br_idB${C}math$O$br_idB$C"))
25	, @_[0]) }
26
27# These commands should not occur by themselves inline.
28# They should be inside other commands/environments which
29# specify the \begin{picture}....
30
31&ignore_commands( <<_IGNORED_CMDS_);
32rmoiety # {}
33lmoiety # {}
34putlatom # {} # {} # {}
35putratom # {} # {} # {}
36putlratom # {} # {} # {}
37Putlratom # {} # {} # {}
38setsixringv # {} # {} # {} # {} # {}
39setdecaringv # {} # {} # {} # {} # {}
40setfusedbond # {} # {} # {} # {} # {}
41setatombond # {} # {} # {}
42setsixringh # {} # {} # {} # {} # {}
43_IGNORED_CMDS_
44
45
46#
47# Each command is treated as generating a separate inlined image.
48# Perhaps these cannot occur inline ?
49
50&process_commands_in_tex ( <<_INLINE_CMDS_);
51#rmoiety # {}
52#lmoiety # {}
53_INLINE_CMDS_
54
55#  origpttrue  is used essentially only within the preamble, for all images,
56# or immediately after a group opening {
57# In the latter case, treat it as an image-request for the whole grouping
58
59sub do_cmd_origpttrue  { &process_cmd_origpt ('true',  @_[0]) }
60sub do_cmd_origptfalse { &process_cmd_origpt ('false', @_[0]) }
61
62sub process_cmd_origpt {
63    local($bool,$whats_next) = @_; $whats_next =~ s/^\s*//;
64    if (($whats_next) && !$PREAMBLE ) {
65	if ($env =~ /group/) {
66	    &do_env_tex2html_wrap("\\origpt$bool ". $whats_next);
67	} else {
68	    $latex_body .= "\n\n\\origpt$bool\n\n";
69	    $whats_next;
70	}
71    } else {
72	$whats_next;
73    }
74}
75
76$image_switch_rx .= '|origpttrue';
77
78
79&process_commands_nowrap_in_tex ( <<_NOWRAP_CMDS_);
80#origpttrue
81#origptfalse
82_NOWRAP_CMDS_
83
841;
85
86