<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <HTML> <HEAD> <TITLE>How to Use HEVEA with the Thai Character Set </TITLE> <META http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <META name="GENERATOR" content="hevea 1.10"> <STYLE type="text/css"> .caption{padding-left:2ex; padding-right:2ex; margin-left:auto; margin-right:auto} .title{margin:2ex auto;text-align:center} .center{text-align:center;margin-left:auto;margin-right:auto;} DIV TABLE{margin-left:inherit;margin-right:inherit;} 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> </HEAD> <BODY > <!--HEVEA command line is: ../hevea.opt -fix -exec xxdate.exe -O -o doc/thaihevea.html thai/thaihevea.ttex --> <!--CUT DEF section 1 --><TABLE CLASS="title"><TR><TD><H1 CLASS="titlemain">How to Use H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>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 Latin/Thai Character Set--> <H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc1">1</A>  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> <B>www.nectec.or.th/it-standards/iso8859-11/</B></P><P>Non-Thai variations to the official Thai character set were introduced by some vendors. The <SPAN STYLE="font-variant:small-caps">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 STYLE="font-variant:small-caps">Windows</SPAN> into a <SPAN STYLE="font-variant:small-caps">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 Thai in L<sup>A</sup>T<sub>E</sub>X--> <H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc2">2</A>  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 Thai in H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>A--> <H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc3">3</A>  Thai in H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>A</H2><!--SEC END --><P>For H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>A the style (package) file ‘thai.sty’ is not used. H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>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<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>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<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>A. The command <CODE>\usepackage{thai}</CODE> in the file is detected by H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>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<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>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 WIDTH="80%" SIZE=2></DIV> <TABLE CELLSPACING=6 CELLPADDING=0><TR><TD CLASS="hbar" COLSPAN=2></TD></TR> <TR><TD ALIGN=left NOWRAP>for L<sup>A</sup>T<sub>E</sub>X</TD><TD ALIGN=left NOWRAP> </TD></TR> <TR><TD CLASS="hbar" COLSPAN=2></TD></TR> <TR><TD ALIGN=left NOWRAP><CODE>cttex < thaihevea.ttex > thaihevea.tex</CODE></TD><TD ALIGN=left NOWRAP>run preprocessor</TD></TR> <TR><TD ALIGN=left NOWRAP><CODE>latex thaihevea.tex</CODE></TD><TD ALIGN=left NOWRAP>compile using L<sup>A</sup>T<sub>E</sub>X</TD></TR> <TR><TD ALIGN=left NOWRAP><CODE>dvips thaihevea.dvi -o</CODE></TD><TD ALIGN=left NOWRAP>convert using dvips</TD></TR> <TR><TD ALIGN=left NOWRAP><CODE>gv thaihevea.ps</CODE></TD><TD ALIGN=left NOWRAP>view using ghostview</TD></TR> <TR><TD CLASS="hbar" COLSPAN=2></TD></TR> <TR><TD ALIGN=left NOWRAP>for H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>A</TD><TD ALIGN=left NOWRAP> </TD></TR> <TR><TD CLASS="hbar" COLSPAN=2></TD></TR> <TR><TD ALIGN=left NOWRAP><CODE>cp thaihevea.ttex thaihevea.tex</CODE></TD><TD ALIGN=left NOWRAP>‘rename’ file for benefit of H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>A</TD></TR> <TR><TD ALIGN=left NOWRAP><CODE>hevea thaihevea.tex</CODE></TD><TD ALIGN=left NOWRAP>compile using H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>A</TD></TR> <TR><TD ALIGN=left NOWRAP><CODE>imagen thaihevea</CODE></TD><TD ALIGN=left NOWRAP>convert image to bitmap</TD></TR> <TR><TD ALIGN=left NOWRAP><CODE>firefox thaihevea.html</CODE></TD><TD ALIGN=left NOWRAP>view using web browser</TD></TR> <TR><TD CLASS="hbar" COLSPAN=2></TD></TR> </TABLE> <DIV CLASS="caption"><TABLE CELLSPACING=6 CELLPADDING=0><TR><TD VALIGN=top ALIGN=left>Table 1: Processing Thai text with L<sup>A</sup>T<sub>E</sub>X and H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>A.</TD></TR> </TABLE></DIV> <A NAME="commands"></A> <DIV CLASS="center"><HR WIDTH="80%" SIZE=2></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<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>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 WIDTH="80%" SIZE=2></DIV> <IMG SRC="thaihevea001.gif"><DIV CLASS="caption"><TABLE CELLSPACING=6 CELLPADDING=0><TR><TD VALIGN=top ALIGN=left>Figure 1: Thai Character Set</TD></TR> </TABLE></DIV> <A NAME="thaichar"></A> <DIV CLASS="center"><HR WIDTH="80%" SIZE=2></DIV></DIV></BLOCKQUOTE><!--CUT END --> <!--HTMLFOOT--> <!--ENDHTML--> <!--FOOTER--> <HR SIZE=2><BLOCKQUOTE CLASS="quote"><EM>This document was translated from L<sup>A</sup>T<sub>E</sub>X by <A HREF="http://hevea.inria.fr/index.html">H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>A</A>.</EM></BLOCKQUOTE></BODY> </HTML>