[l2h] An Apparent Byte Size Limit for a Portable Network Graphics (.png) Image File Containing Simplified Chinese Characters Produced by LaTeX2HTML From a .tex File Containing LaTeX and Chinese/Japanese/Korean (CJK) for LaTeX Commands

Pat Somerville l_pat_s at hotmail.com
Sun Aug 1 00:02:38 CEST 2010

Introduction and Background

In an OpenSuSE-11.1, Linux operating system with the primary language set as English and the secondary language set as "Simplified Chinese" and using the K Desktop Environment (KDE) 3.5.10, I can input simplified Chinese characters into a document in the text editor Kate using the AR PL Songtil GB font and the Small Common Input Method (SCIM) 1.4.7 with Smart Pinyin set for inputting simplified Chinese characters.  In this way I could input a set of LaTeX commands and some text containing simplified Chinese characters in a file of the form MyFile.tex file.   I also have Chinese/Japanese/Korean (CJK) 1.4.7 for LaTeX 2e, including various related CJK software packages, installed.  That permits the command of the form "latex MyFile.tex" to be executed.  Also it permits a command of the form "latex2html.............MyFile.tex" to be executed using the previously  installed program LaTeX2html 1.70 (a year-2002 version).  Some of the relevant commands in such a .tex file could, for example, be similar to:

....some simplified Chinese characters here.....
....some pinyin romanizations (Chinese pronunciation system) here, for example \Ni3 \hao3 \ma5?

In a successful case a resulting output file of the form MyFile.html could then be opened in the Konqueror-3.5.10 Web browser to display the simplified Chinese characters and pinyin romanizations input into the original .tex file.  The default in LaTeX2HTML is apparently to produce Portable Network Graphics (.png) images.  Without using Chinese characters such images may contain mathematical symbols, often with just one mathematical expression, symbol, or inline-used Greek letter in each .png file.  On the other hand, when using simplified Chinese characters, from my experience it appears that one .png file is produced for each segment in the .tex file which begins with \begin{CJK}{UTF8}{gbsn} and ends with \end{CJK}.  That one, .png file apparently contains all of the possibly numerous mathematical symbols and simplified Chinese characters generated from that segment of the .tex file.  The program LaTeX2HTML 1.70 apparently treated the entire CJK segment in the .tex file as if it were a single, "mathematical" expression.  

The Apparent Byte Size Limit for a Portable Network Graphics (.png) File

However, in the file of the form MyFile.tex, apparently when the set of LaTeX commands and text between the commands \begin{CJK}{UTF8}{gbsn} and \end{CJK} was too extensive, one of the ensuing messages after entering the command of the form "latex2html........ MyFile.tex" was "Bad file descriptor" in attempting to generate the .png image.  That .png image was listed in the so-generated folder with a corresponding name of the form MyFile; but it had a size of 0 bytes.--So, of course, it either wasn't displayed or else a blank for it was displayed when the file of the form MyFile.html was opened in the Konqueror Web browser.  From experience the limiting size of the so-generated, yet displayable, not-empty, .png file had to have been somewhat larger than 60 kilobytes, based on the largest .png file size I recall seeing in this context without the file-size problem.  Such a large size is in stark contrast to 4.6 kilobytes, the largest size I saw for a .png image of a mathematical expression generated by LaTeX2HTML 1.70 from a .tex file containing mathematical expressions and possibly one or more Greek letters, but no simplified Chinese characters.

A "Workaround" Solution

By breaking the single, long, \begin{CJK}{UTF8}{gbsn}, \end{CJK} segment into several, shorter, such segments, such that no LaTeX2HTML-generated .png file had a size larger than the apparent byte limit of somewhat greater than 60 kilobytes, the .html file produced by LaTeX2HTML could contain the designed, simplified Chinese characters and mathematical content.  Then each {CJK} segment of the .tex file corresponded to one .png file.

The above solution is much preferred over the alternative solution of breaking the long, say MyFile.tex file into files of the form MyFileA.tex, MyFileB.tex, MyFileC.tex, etc.; executing latex2hmtl commands of the forms "latex2html......MyFileA.tex",  "latex2html......MyFileB.tex",  "latex2html......MyFileC.tex", etc., so-producing output files of the respective forms MyFileA.html, MyFileB.html, MyFileC.html, etc.; and finally appending each of those files in the order of MyFileA.html, MyFileB.html, MyFileC.html, etc., to make one long, .html document.--The undesirable features of this alternative solution are that, say equation number 1 and the image file name img1.png could conceivably appear for each of the files of the forms MyFileA.html, MyFileB.html, MyFileC.html, etc.  So if all of the multiple, img1.png files were placed in the same directory, there would likely be mistakes or problems when img1.png would be referenced by one of the .html files.  No, for one project each of the equations and .png files should have its own, unique number.  And that can be arranged automatically by LaTeX2HTML by using the first solution in which the long, CJK segment in the original .tex file is broken into several CJK segments, as discussed in the first paragraph of this section.

Unknown Origin of the Apparent .png-File Size Limitation

Since the origin in the computer code of the apparent, .png, file-size limitation is unknown to me, even whether it is within the CJK for LaTeX or LaTeX2HTML code, I hope I will able to send this e-mail letter to both the LaTeX2HTML and CJK users groups; however, so far e-mail letters sent to two e-mail addresses posted for joining the CJK users group have been returned to me as undeliverable.  Please advise me on where to make a change in one of the computer codes to accommodate a .png file size larger than the current apparent limit, which appears to be somewhat over 60 kilobytes.  Thanks in advance for help with where to make a change in some computer code to overcome this apparent limitation.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/latex2html/attachments/20100731/71e98aac/attachment.html>

More information about the latex2html mailing list