<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <meta name="generator" content="hevea 2.32"> <style type="text/css"> .c000{border-spacing:6px;border-collapse:separate;} .c001{font-size:small} .c002{font-variant:small-caps} .c003{text-align:left;white-space:nowrap} .c004{vertical-align:top;text-align:left;} .c005{width:80%;height:2} div.footnotetext P{margin:0px; text-indent:1em;} .caption{padding-left:2ex; padding-right:2ex; margin-left:auto; margin-right:auto} .title{margin:2ex auto;text-align:center} .titlemain{margin:1ex 2ex 2ex 1ex;} .titlerest{margin:0ex 2ex;} .center{text-align:center;margin-left:auto;margin-right:auto;} div table{margin-left:inherit;margin-right:inherit;margin-bottom:2px;margin-top:2px} td table{margin:auto;} table{border-collapse:collapse;} td{padding:0;} pre{text-align:left;margin-left:0ex;margin-right:auto;} blockquote{margin-left:4ex;margin-right:4ex;text-align:left;} td p{margin:0px;} .hbar{border:none;height:2px;width:100%;background-color:black;} </style> <title>How to Use HEVEA with the Thai Character Set </title> </head> <body> <!--HEVEA command line is: ../hevea.opt -fix -exec xxdate.exe -O -o doc/thaihevea.html thai/thaihevea.ttex --> <!--CUT STYLE article--><!--CUT DEF section 1 --><table class="title"><tr><td style="padding:1ex"><h1 class="titlemain">How to Use H<span class="c001"><sup>E</sup></span>V<span class="c001"><sup>E</sup></span>A with the Thai Character Set</h1><h3 class="titlerest">Andrew Seagar and นิตยา ซีการ์ <br> email: dr_andrew_seagar@ieee.org</h3></td></tr> </table> <!--TOC section id="sec1" Latin/Thai Character Set--> <h2 class="section" id="sec1">1  Latin/Thai Character Set</h2><!--SEC END --><p>Thai L<sup>A</sup>T<sub>E</sub>X is written in the TIS-620 character encoding. Some people call this ISO-8859-11, but that name was (for a long time) never officially recognised.</p><p>The TIS-620 character encoding is an 8-bit single byte character set. It encodes both the ASCII Latin characters (0-127) and the Thai characters (128-255). See, for the official Thai definition, the docuemnt:<br> “ISO 8859-11 Latin/Thai Character Set standard”<br> at the website:<br> <span style="font-weight:bold">www.nectec.or.th/it-standards/iso8859-11/</span></p><p>Non-Thai variations to the official Thai character set were introduced by some vendors. The <span class="c002">Windows</span> Thai character set (874) places an unofficial ‘smart quote’ character into one of the empty (illegal) slots in the official Thai set. The DEC (Digital Equipement Coorporation) character set places an unofficial ‘no-break space’ character into another of the empty (illegal) slots in the <em>original</em> official Thai set. It is not too clear what is now “official” and what is not. It is necessary to be a little bit careful. Importing “Thai” docuemnts from <span class="c002">Windows</span> into a <span class="c002">Linux</span> environment via (for example) Openoffice doesn’t always produce a faithful copy of the original text.</p><p>Figure <a href="#thaichar">1</a> shows the Thai characters according to the Unicode Standard (version 3.0).</p> <!--TOC section id="sec2" Thai in L<sup>A</sup>T<sub>E</sub>X--> <h2 class="section" id="sec2">2  Thai in L<sup>A</sup>T<sub>E</sub>X</h2><!--SEC END --><p>For Thai in L<sup>A</sup>T<sub>E</sub>X the package ‘thai’ (file: thai.sty) is used, <em>i.e.</em> <code>\usepackage{thai}</code>.</p><p>The source is run through a preprocessor (cttex) to encapsulate all Thai text within bracketted pairs <code>{\thai ....}</code> and to insert the thai-break ‘<code>\tb</code>’ separator.</p><p>Normally Thai text is written in a continuous stream with few (if any) blank (space) characters. The preprocessor inserts the ‘<code>\tb</code>’ command to indicate places where the text may be broken if near the end of a line. If these separators are not inserted L<sup>A</sup>T<sub>E</sub>X has a great deal of trouble in getting a flush right margin without leaving huge gaps in the text.</p><p>The style file ‘thai.sty’ contains the definitions for <code>{\thai ....}</code> and <code>\tb</code>. The <code>{\thai ....}</code> command is used to switch the L<sup>A</sup>T<sub>E</sub>X font.</p><p>After passing through the preprocessor, the file is compiled by L<sup>A</sup>T<sub>E</sub>X in the normal fashion.</p> <!--TOC section id="sec3" Thai in H<span class="c001"><sup>E</sup></span>V<span class="c001"><sup>E</sup></span>A--> <h2 class="section" id="sec3">3  Thai in H<span class="c001"><sup>E</sup></span>V<span class="c001"><sup>E</sup></span>A</h2><!--SEC END --><p>For H<span class="c001"><sup>E</sup></span>V<span class="c001"><sup>E</sup></span>A the style (package) file ‘thai.sty’ is not used. H<span class="c001"><sup>E</sup></span>V<span class="c001"><sup>E</sup></span>A does not recognise the <code>{\thai ....}</code> or <code>\tb</code> constructs. If these constructs are encountered, warnings will be issued and the constructs will be ignored.</p><p>In order to use the Thai language with H<span class="c001"><sup>E</sup></span>V<span class="c001"><sup>E</sup></span>A, the preprocessor which is normally used before invoking L<sup>A</sup>T<sub>E</sub>X should <em>not</em> be used. The original (as typed) Thai L<sup>A</sup>T<sub>E</sub>X file should be passed directly to H<span class="c001"><sup>E</sup></span>V<span class="c001"><sup>E</sup></span>A. The command <code>\usepackage{thai}</code> in the file is detected by H<span class="c001"><sup>E</sup></span>V<span class="c001"><sup>E</sup></span>A and is used to establish a Thai character encoding. (It is no longer necessary to use the command line flag –charset=TIS-620. This flag is no longer operational).</p><p>The commands required to process this file for both Thai L<sup>A</sup>T<sub>E</sub>X and Thai H<span class="c001"><sup>E</sup></span>V<span class="c001"><sup>E</sup></span>A are listed in table <a href="#commands">1</a>. The original L<sup>A</sup>T<sub>E</sub>X filename is assumed to be ‘thaihevea.ttex’ (ttex = Thai tex).</p><blockquote class="table"><div class="center"><div class="center"><hr class="c005"></div> <table class="c000 cellpading0"><tr><td class="hbar" colspan=2></td></tr> <tr><td class="c003">for L<sup>A</sup>T<sub>E</sub>X</td><td class="c003"> </td></tr> <tr><td class="hbar" colspan=2></td></tr> <tr><td class="c003"><code>cttex < thaihevea.ttex > thaihevea.tex</code></td><td class="c003">run preprocessor </td></tr> <tr><td class="c003"><code>latex thaihevea.tex</code></td><td class="c003">compile using L<sup>A</sup>T<sub>E</sub>X</td></tr> <tr><td class="c003"><code>dvips thaihevea.dvi -o</code></td><td class="c003">convert using dvips </td></tr> <tr><td class="c003"><code>gv thaihevea.ps</code></td><td class="c003">view using ghostview </td></tr> <tr><td class="hbar" colspan=2></td></tr> <tr><td class="c003">for H<span class="c001"><sup>E</sup></span>V<span class="c001"><sup>E</sup></span>A</td><td class="c003"> </td></tr> <tr><td class="hbar" colspan=2></td></tr> <tr><td class="c003"><code>cp thaihevea.ttex thaihevea.tex</code></td><td class="c003">‘rename’ file for benefit of H<span class="c001"><sup>E</sup></span>V<span class="c001"><sup>E</sup></span>A</td></tr> <tr><td class="c003"><code>hevea thaihevea.tex</code></td><td class="c003">compile using H<span class="c001"><sup>E</sup></span>V<span class="c001"><sup>E</sup></span>A</td></tr> <tr><td class="c003"><code>imagen thaihevea</code></td><td class="c003">convert image to bitmap </td></tr> <tr><td class="c003"><code>firefox thaihevea.html</code></td><td class="c003">view using web browser </td></tr> <tr><td class="hbar" colspan=2></td></tr> </table> <div class="caption"><table class="c000 cellpading0"><tr><td class="c004">Table 1: Processing Thai text with L<sup>A</sup>T<sub>E</sub>X and H<span class="c001"><sup>E</sup></span>V<span class="c001"><sup>E</sup></span>A.</td></tr> </table></div> <a id="commands"></a> <div class="center"><hr class="c005"></div></div></blockquote><p>Since the Thai text is not processed to indicate where the text may be broken, the decision is left to the application displaying the html code. The browser I currently use (Firefox) doesn’t know how to break continuous Thai text in suitable places without external help. However the screen width is larger than a page width, which means that on average there are more natural breaks in any line, and the browser is left justifying the text so it doesn’t make large ugly gaps. The right margin is ragged, not flush, but that looks acceptable (to me).</p><p>Following is a paragraph of Thai text. It doesn’t say anything important, it is simply here to serve as a basic test. Even if you can’t compile this with L<sup>A</sup>T<sub>E</sub>X (<em>e.g.</em> you don’t have the file thai.sty or a Thai character set for printing), you can still compile it with H<span class="c001"><sup>E</sup></span>V<span class="c001"><sup>E</sup></span>A and make an English/Thai web page.</p><p>If you want to eliminate the Thai so you can compile an English-only version of this document, simply insert a comment % character before the <code>\thaistuff</code> command at the top of the file and uncomment the second version of the command (which eliminates the Thai) on the adjacent line.</p><p> ศึกษาความหมาย ความสำคัญของสิ่งแวดล้อมศึกษา วิธีการเผยแพร่ประชาสัมพันธ์ ความรู้ทางสิ่งแวดล้อม วิธีการเขียนแผนงานเพื่อเผยแพร่ความรู้ทางสิ่งแวดล้อม นำ สิ่งแวดล้อมศึกษาไปประยุกต์ใช้ในการพัฒนาและเผยแพร่ความรู้ข้อมูล ข่าวสารต่างๆ ในโครงการอื่นๆ ที่มีความสัมพันธ์เกี่ยวข้อง </p><blockquote class="figure"><div class="center"><div class="center"><hr class="c005"></div> <img src="thaihevea001.png"><div class="caption"><table class="c000 cellpading0"><tr><td class="c004">Figure 1: Thai Character Set</td></tr> </table></div> <a id="thaichar"></a> <div class="center"><hr class="c005"></div></div></blockquote><!--CUT END --> <!--HTMLFOOT--> <!--ENDHTML--> <!--FOOTER--> <hr style="height:2"><blockquote class="quote"><em>This document was translated from L<sup>A</sup>T<sub>E</sub>X by </em><a href="http://hevea.inria.fr/index.html"><em>H<span class="c001"><sup>E</sup></span>V<span class="c001"><sup>E</sup></span>A</em></a><em>.</em></blockquote></body> </html>