| … | |
… | |
| 81 | my $strings = $self->{strings}; |
81 | my $strings = $self->{strings}; |
| 82 | my $dir = $self->{dir}; |
82 | my $dir = $self->{dir}; |
| 83 | my $url = $self->{url}; |
83 | my $url = $self->{url}; |
| 84 | my $basename = $self->{basename}; |
84 | my $basename = $self->{basename}; |
| 85 | |
85 | |
|
|
86 | # if the string came in with delimiters, chop them off and set the mode |
|
|
87 | # based on whether they were \[ .. \] or \( ... \). this means that if |
|
|
88 | # the string has delimiters, the mode *argument* is ignored. |
|
|
89 | if ($string =~ s/^\\\[(.*)\\\]$/$1/) { |
|
|
90 | $mode = "display"; |
|
|
91 | } elsif ($string =~ s/^\\\((.*)\\\)$/$1/) { |
|
|
92 | $mode = "inline"; |
|
|
93 | } |
|
|
94 | # otherwise, leave the string and the mode alone. |
|
|
95 | |
| 86 | my $imageNum = @$strings + 1; |
96 | my $imageNum = @$strings + 1; |
| 87 | my $imageURL = "$url/$basename.$imageNum.png"; |
97 | my $imageURL = "$url/$basename.$imageNum.png"; |
| 88 | my $imageTag = "<img src=\"$imageURL\" align=\"middle\" alt=\"$string\">"; |
98 | my $imageTag = "<img src=\"$imageURL\" align=\"middle\" alt=\"$string\">"; |
| 89 | |
99 | |
| 90 | if ($mode eq "display") { |
100 | if ($mode eq "display") { |