Jose' Matos wrote:
> On Wednesday 19 May 2004 02:30, Chris Karakas wrote:
> 

Hello Jose',

> 
>   regarding the CDATA or not CDATA inside equations if I try to insert an 
> inequality inside the equation the docbook output is:
> ...
>   < alt >\[
> E< mc^{2} \]
> 
>   </ alt >
> ...
>   without the CDATA jade complains:
> 
> jade:f1.sgml:33:4:E: character "^" not allowed in attribute specification 
> list
> jade:f1.sgml:33:4:E: element "MC" undefined
> jade:f1.sgml:36:11:E: end tag for "EQUATION" which is not finished
> 
>   don't you get this?
> 
> 

Indeed, I get this. I had never tried an inequality, so I was caught by surprise!

However, it turned out that the solution is simple: you should write the SGML entities 
of < and > instead of the brackets themselves! I adapted my scripts to do this:

First, the sedscr script 

http://www.karakas-online.de/mySGML/sedscr

inserts a newline after the $ that follows an < alt > tag. Then, the awkscr_math 
script 

http://www.karakas-online.de/mySGML/awkscr_math

transforms < and > inside alt tags (but excluding the lines where the tags themslves 
happen to be - the line of the starting alt tag containing only the alt tag itself due 
sedscr's inserted newline) to their SGML entities.

See

http://www.karakas-online.de/mySGML/explain-sgml-math-code-correction.html

I have added some inequalities for you in 

http://www.karakas-online.de/mySGML/lyx-writing-mathematics.html

:-D

to see that it works.

If you look at the equation-list.sgml file:

http://www.karakas-online.de/mySGML/equation-list.sgml

you will see that the inequalities inside the alt tags now contain the *numeric* 
entities:

> < texequation
fileref="images/math/19259.png"
> \[
a & # 60 ; b & # 62 ; c,\]
  < /texequation

How come? Well, this is done by the unescape() function of the texmath2pngbmp.pl 
script:

http://www.karakas-online.de/mySGML/texmath2pngbmp.pl

sub unescape {
    $eqn =~ s/ & # 38 ; / & /g;
    $eqn =~ s/ & # 62 ; /\ >/g;
    $eqn =~ s/& # 60 ; /\< /g > 

<  and > are represented by their respective SGML entities inside the alt tags. 

Thus, the only thing you have to do is replace < and > with their entities instead of 
including  the alt part in CDATA!

Chris

-- 
Regards

Chris Karakas
http://www.karakas-online.de

Reply via email to