PageBox |
Presentation | FAQ | Reference | Customization | Runtime | Forms | Demo | Math | Verification | Downloads | Legal |
Advanced functions in Cuckoo
To create a horizontal rule (<hr/>) in the HTML page, create an empty paragraph in Horizontal style like this:
The <pre> element preserves the text format. Within a <pre> element all characters are interpreted literally and retained in display, including multiple spaces, tabs, carriage returns and linefeeds.
You can use two Word styles to create <pre> elements:
Preserve. Preserve is a character style and allows you to preserve the text format of a character string.
PreservePar. PreservePar is a paragraph style and allows you to preserve the text format of a multi-line area.
Cuckoo 0.0.5 and above support characters and styles used in Mathematics and Chemistry.
It leverages on Word and browser capabilities.
In Mathematics you often need to write things such as x2.
In Chemistry you often need to write things such as H2O.
Cuckoo leverages on Word Superscript and Subscript to display smaller characters above or below the normal characters.
If you don't yet have configured Word with Superscript and Subscript here is how to do it.
Open up the Tools... Customize menu and choose the All Commands category:
Scroll down to find the Subscript and Superscript options. Then click the desired option and drag it on the toolbar. Your toolbar should now contain x2 and x2:
Now if you want to write x2 type x as usual, click on x2 button, type 2 and click again on x2 to revert to normal mode.
Note:
Normally you don't need to configure Word because Subscript and Superscript are already saved in cuckoo.dot.
The Equation Editor comes with Microsoft Office or Works (including OEM editions). However it is not installed under a standard installation. Therefore you need to retrieve your installation CDROM and do a custom installation. Once the Equation Editor is installed, just follow the same procedure as for Superscript and Subscript:
Open up the Tools... Customize menu and choose the Insert category
Scroll down to find the Equation Editor option. Then click and drag the option on the toolbar. Your toolbar should now contain Öa
You can learn how to use the Equation Editor on spot.pcc.edu/academ/math/faculty/simonds/handouts/equation/ and on
www.rdg.ac.uk/SerDepts/su/Topic/WordProc/WoP2Kequ01/.
When Cuckoo finds an Equation in the document it generates a small .gif image and a <img> element.
A Font named Symbol supports Mathematical symbols and Greek characters in Word.
If you type 'a' with the Symbol font a a is displayed.
The Symbol font is the same as the Symbol font of browsers. You can find the codes of Greek and Mathematical characters here. However in Word Symbol characters are stored on two bytes, for instance F022 or -4074 for ".
Support of Greek and Mathematical characters is buggy. There is a gap between what should be supported and what really works and there are problems on browsers as well as in Word.
HTML 4.0 uses Unicode as its base character set and we should be able for instance to display " with ∀. Furthermore named entities were defined and we should be able to use ∀, arguably easier to remember.
Before HTML 4.0 the only solution was to use the Symbol font. We could code " with
<font face="Symbol">"</font> where 34 is 22 in decimal.
The math browser page shows how well your browser supports HTML 4 and Symbol font.
The table below summarizes the situation:
Browser | Behavior with default installation |
---|---|
Old browsers and Opera 5 | Only Symbol font |
Internet Explorer 5 and 6 | Partial support of named entities and Unicode + support of Symbol font |
Netscape 6.2, Mozilla 0.9.6 and Opera 6 | Full support of named entities and Unicode. No support of Symbol font |
To summarize it is impossible to display symbols and Greek characters on all browsers without checking the browser type.
Whatever symbol you choose, Word Insert Symbol inserts x0028 or '(' in the document. Ok the character code is stored somewhere else (it is displayed!) but impossible to retrieve with VBA. Therefore we created a Word document containing all supported characters.
Download and inflate this file. Then Copy | Paste Mathematical symbols from this file to your document.
For Greek characters, it is faster to type the Latin equivalent. You can easily remember that a a is an a, a b is a b and so on.
cuckoo.dot processes characters written with the Symbol font.
If the character is a character listed in the Math browser page and in the Word document, it converts it into the equivalent Unicode numbered entity, for instance ∀ for ". Otherwise it copies the ASCII value of the character:
If r.text > ChrW(61440) Then ' If the character is F0xx Dim k As Integer k = AscW(r.text) ' Convert the character in integer processMathChar = txt & Chr(4096 + k) Else processMathChar = txt & r.text End If |
cuckoo.dot also identifies Subscript and Superscript and wraps the character(s) in a <span> element.
cuckoo.dot generates XML and HTML 4 files appropriate for a display in Netscape 6, Mozilla 0.9.6 and Opera 6.
These files will not display all Greek characters and Mathematical symbol on other browsers.
math-gen.js is a WSH script that makes two things:
It converts Unicode numbered entities into Symbol character codes
It inserts a script that detects the browser version and redirects to the HTML 4 version when the browser is Netscape 6, Mozilla or Opera 6:
function redirect() { window.location = window.location.toString().replace(".html", "-nav6.html"); } var agt=navigator.userAgent.toLowerCase(); var is_major = parseInt(navigator.appVersion); var is_nav = ((agt.indexOf("mozilla")!=-1) && (agt.indexOf("spoofer")==-1)&& (agt.indexOf("compatible") == -1) && (agt.indexOf("opera")==-1)&& (agt.indexOf("webtv")==-1) && (agt.indexOf("hotjava")==-1));var is_nav6up = (is_nav && (is_major >= 5)); var is_gecko = (agt.indexOf("gecko") != -1); var is_opera6 = (agt.indexOf("opera 6") != -1 || agt.indexOf("opera/6") != -1); if (is_nav6up || is_gecko || is_opera6) setTimeout("redirect();", 10); |
Note:
math-gen.js is designed to process HTML files generated by cuckoo-gen.js.
We defined a MathGreek Word style with the Symbol font.
We also defined a MathGreek CSS class:
.MathGreek { font-size:small; font-family:Symbol; } |
You don't need to use MathGreek because Cuckoo tests the font.
However if you define another style with the Symbol font, you must also define a CSS class with a Symbol font-family.
Click on math-verif.html to see the different advanced functions of Cuckoo.
Contact:support@pagebox.net
©2001 Alexis Grandemange.
Last modified
.