old-www/HOWTO/Chinese-HOWTO-7.html

428 lines
17 KiB
HTML
Raw Permalink Blame History

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
<TITLE>Linux Chinese HOWTO English Version: Chinese Printing Softwares</TITLE>
<LINK HREF="Chinese-HOWTO-8.html" REL=next>
<LINK HREF="Chinese-HOWTO-6.html" REL=previous>
<LINK HREF="Chinese-HOWTO.html#toc7" REL=contents>
</HEAD>
<BODY>
<A HREF="Chinese-HOWTO-8.html">Next</A>
<A HREF="Chinese-HOWTO-6.html">Previous</A>
<A HREF="Chinese-HOWTO.html#toc7">Contents</A>
<HR>
<H2><A NAME="s7">7. Chinese Printing Softwares</A></H2>
<H2><A NAME="ss7.1">7.1 LaTeX + CJK</A>
</H2>
<P>TeX/LaTeX is a set of printing softwares, of which excellent and elegant output quality have been admiring and adopting out of the academic circles for several years. The CJK is a LaTeX2e macro package, which can let you use CJK (Chinese/Japanese /Korean) literal codes in TeX documents.
<P>You need install TeX/LaTeX first on your Linux system; many Linux distributions have been included teTeX/LaTeX already. If haven't, you could install it by yourself. Please link to
<A HREF="http://sunsite.unc.edu/LDP/HOWTO/TeTeX-HOWTO.html">teTeX HOWTO</A> for more information.
<P>
<H3>Getting this software</H3>
<P>Obtain CJK 4.1.3 from this site:
<BLOCKQUOTE>
<A HREF="ftp://nctuccca.edu.tw/Chinese/ifcss/software/tex/">ftp://nctuccca.edu.tw/Chinese/ifcss/software/tex/CJK-4.1.3.src.tar.gz</A></BLOCKQUOTE>
<P>Bring the demanded TTF fonts home:
<BLOCKQUOTE>
<A HREF="ftp://nctuccca.edu.tw/Chinese/ifcss/software/fonts/big5/ms-win/">ftp://nctuccca.edu.tw/Chinese/ifcss/software/fonts/big5/ms-win/</A></BLOCKQUOTE>
<P>
<H3>Installation</H3>
<P>You must have an clear ideal about the teTeX/LaTeX installing directory, <CODE>$TEXMF</CODE>, for example, <CODE>/usr/lib/texmf</CODE>.
And I assume that you will use the <CODE>ntu_kai.ttf</CODE> font; if doesn't, make a change to match it.
<P>
<UL>
<LI>Put the downloaded fonts, after
<A HREF="Chinese-HOWTO-11.html#ntuttf">decompression</A>, into the <CODE>$TEXMF/fonts/truetype/chinese</CODE>.</LI>
<LI>Unzip and untar CJK-4.1.3.src.tar.gz, and mv the sub-directory <CODE>texinput</CODE> to <CODE>$TEXMF/tex/latex</CODE>, and rename it to <CODE>CJK</CODE>, and create the fonts directory.
<BLOCKQUOTE><CODE>
<PRE>
# cd 4_1.3/; mv ./texinput $TEXMF/tex/latex/CJK
# mkdir -p $TEXMF/fonts/tfm/chinese/ntukai
# mkdir $TEXMF/ttf2pk
# mkdir $TEXMF/hbf2gf
</PRE>
</CODE></BLOCKQUOTE>
</LI>
<LI>To come immediately, it will probably be the most difficult step. You need to invoke <CODE>patch</CODE> command to append <CODE>*.diff</CODE> under <CODE>4_1.3/doc/teTeX</CODE> upon these following files:
<BLOCKQUOTE><CODE>
<PRE>
/usr/bin/MakeTeX*
$TEXMF/web2c/texmf.cnf
$TEXMF/fontname/special.map
</PRE>
</CODE></BLOCKQUOTE>
For instance:
<BLOCKQUOTE><CODE>
<PRE>
# cd /usr/bin
# patch -s &lt; 4_1.3/doc/teTeX/MakeTeXPK.diff
</PRE>
</CODE></BLOCKQUOTE>
According to the enormous TeX versions, your action with <CODE>patch</CODE> may fail perhaps. If so, you need to do it manually by yourself to patch these parts of failure( the portions of failure will record in <CODE>.rej</CODE>). If you don't understand the theory of <CODE>patch</CODE> well, you had better get someone experienced to help you.
</LI>
<LI>Compiling and installing <CODE>bg5conv</CODE>
<BLOCKQUOTE><CODE>
<PRE>
# cd 4_1.3/utils/Bg5conv; gcc -o bg5conv bg5conv.c
# chmod 755 bg5latex
# cp bg5conv bg5latex /usr/local/bin/
# gzip bg5conv.1; cp bg5conv.1.gz /usr/local/man/man1/
</PRE>
</CODE></BLOCKQUOTE>
Because there are some codes in BIG5 TeX documents may contain <CODE>{</CODE>, <CODE>}</CODE>, <CODE>&amp;</CODE> and so forth, which are the specific tokens to TeX , the <CODE>bg5conv</CODE> can change this codes into certain format that can let TeX manipulate.
</LI>
<LI>Compile and install <CODE>ttf2pk</CODE>, which can change TrueType fonts into TeX's pk fonts.
<BLOCKQUOTE><CODE>
<PRE>
# cd 4_1.3/utils/ttf2pk/src
# make all OS=unix
# cp ttf2pk /usr/local/bin/
# cd ..
# cp config/ttf2pk.cfg $TEXMF/ttf2pk/
# gzip ttf2pk.1; cp ttf2pk.1.gz /usr/local/man/man1/
# cp c00kai.fd $TEXMF/tex/latex/CJK/Bg5/
# cp MakeTTFPK /usr/local/bin
</PRE>
</CODE></BLOCKQUOTE>
</LI>
<LI>If you want to print documents vertically, you have to edit a <CODE>c00kair.fd</CODE> file under <CODE>$TEXMF/tex/latex/CJK/Bg5/</CODE>:
<HR>
<PRE>
\def\fileversion{4.1.0}
\def\filedate{1996/11/20}
\ProvidesFile{c00kair.fd}[\filedate\space\fileversion]
% traditional Chinese characters in Big 5 encoding scheme.
% font shape: kai
% ntu_kai.ttf is Kai3 Shu1 (&amp;quotmodel book")
\DeclareFontFamily{C00}{kair}{}
\DeclareFontShape{C00}{kair}{m}{n}{&lt;-> CJK * ntukar}{}
\DeclareFontShape{C00}{kair}{bx}{n}{&lt;-> CJKb * ntukar}{\CJKbold}
\endinput
</PRE>
<HR>
</LI>
<LI>Execute <CODE>texconfig</CODE>:
<BLOCKQUOTE><CODE>
<PRE>
# texconfig rehash
# texconfig hyphen
</PRE>
</CODE></BLOCKQUOTE>
</LI>
</UL>
<P>
<H3>Tests</H3>
<P>
<UL>
<LI>Horizontal printing tests:
<BLOCKQUOTE><CODE>
<PRE>
# cd 4_1.3/examples
# bg5latex Big5.tex (See if there is a Big5.dvi appeared ?)
# xdvi Big5.dvi (Can you see Chinese? Of course, in X mode)
# dvips Big5.dvi -o Big5.ps (Change to PostScript format)
# ghostview Big5.ps (View it as ghostview)
# lpr Big5.ps (Send it to printers, see if there are Chinese printed.)
</PRE>
</CODE></BLOCKQUOTE>
</LI>
<LI>Vertical printing tests: You can use the <CODE>Big5vert.tex</CODE> file under <CODE>examples</CODE> to repeat those previous procedures. </LI>
</UL>
<P>
<H3>Adding New Fonts</H3>
<P>For example, if you want to change to the Ming style font <CODE>ntu_mm.ttf</CODE>, then
<P>
<UL>
<LI>put your TrueType fonts under <CODE>$TEXMF/fonts/truetype/chinese</CODE>.</LI>
<LI>And then add the two lines in <CODE>$TEXMF/ttf2pk/ttf2pk.cfg</CODE>:
<BLOCKQUOTE><CODE>
<PRE>
ntumm: -e Big5 $TEXMF/fonts/truetype/chinese/ntu_mm.ttf
ntummr: -r 1 -e Big5 $TEXMF/fonts/truetype/chinese/ntu_mm.ttf
</PRE>
</CODE></BLOCKQUOTE>
</LI>
<LI>Create the <CODE>c00ming.fd</CODE> file:
<BLOCKQUOTE><CODE>
<PRE>
# cd 4_1.3/utils/ttf2pk
# cp c00ming.fd $TEXMF/tex/latex/CJK/Bg5/
</PRE>
</CODE></BLOCKQUOTE>
</LI>
<LI>Execute the <CODE>texconfig</CODE> again. </LI>
<LI>Change kai to ming in file <CODE>4_1.3/examples/Big5.tex</CODE>, and then repeat this steps, <CODE>bg5latex</CODE>, <CODE>xdvi</CODE>, <CODE>dvips</CODE> and so on, to see if the results correct or not. </LI>
<LI>If you want to print files vertically, redo this section's installation and create the <CODE>c00mingr.fd</CODE> file listed as follows, and then change kair to mingr in <CODE>Big5vert.tex</CODE> file, and repeat tests processes.
<HR>
<PRE>
\def\fileversion{4.1.0}
\def\filedate{1996/11/20}
\ProvidesFile{c00kair.fd}[\filedate\space\fileversion]
\DeclareFontFamily{C00}{mingr}{}
\DeclareFontShape{C00}{mingr}{m}{n}{&lt;-> CJK * ntummr}{}
\DeclareFontShape{C00}{mingr}{bx}{n}{&lt;-> CJKb * ntummr}{\CJKbold}
\endinput
</PRE>
<HR>
</LI>
</UL>
<P>
<H3>Creating CJK Documents</H3>
<P>The dominant difference between Chinese CJK TeX documents and general LaTeX ones is that:
<UL>
<LI>There should exist the \usepackage{CJK} command in the preamble (\documentclass to \begin{document}<7D>^section, that means you must have CJK.sty loaded. </LI>
<LI> Chinese words must be under the circumstances of CJK or CJK*.</LI>
<LI>If you want to change fonts, you can use \CJKfamily command, for example, the command \CJKfamily{fs} will change the following fonts as Song-imitated fonts( Certainly, the <CODE>fs</CODE> fonts' name must be defined in <CODE>c00fs.fd</CODE>). </LI>
</UL>
This is a demonstration for CJK document:
<HR>
<PRE>
\documentclass[12pt]{article}
\usepackage{CJK}
\begin{document}
\begin{CJK*}{Bg5}{kai}
\section{first section}
\section{second section}
Paragraphs, sections, pictures, tables, references and so forth...
...
\end{CJK*}
\end{document}
</PRE>
<HR>
<P>
<H2><A NAME="ss7.2">7.2 ChiTeX</A>
</H2>
<P>Developed by professor Chen Hung-Yih &lt;
<A HREF="mailto:yih@math.ncu.edu.tw">yih@math.ncu.edu.tw</A>&gt;.
Operations with the ChiTeX are easy enough just like the English TeX, apart from some special instructions.
<P>
<H3>Obatining it</H3>
<P>From here, you can find its vestige:
<BLOCKQUOTE>
<A HREF="ftp://dongpo.math.ncu.edu.tw/tex-archive/local/chitex/chitex/Linux/">ftp://dongpo.math.ncu.edu.tw/tex-archive/local/chitex/chitex/Linux/</A></BLOCKQUOTE>
<P>
<H3>Installing</H3>
<P>You should know what's the version of TeX installed on your Linux.. On older system, the installed one usually is NTeX while on newer one, it will be always teTeX .
How to tell which TeX you've installed, teTeX or NTeX, on your Linux System. Just run the TeX. If the monitor appears
<BLOCKQUOTE><CODE>
<PRE>
This is TeX, Version 3.14159
</PRE>
</CODE></BLOCKQUOTE>
, then it is teTeX. Otherwise,
<BLOCKQUOTE><CODE>
<PRE>
This is TeX, Version 3.1415N
</PRE>
</CODE></BLOCKQUOTE>
It is NTeX.
Download the exact ChiTeX corresponding to your version of TeX.
<P>It is simple to install ChiTeX. Just put <CODE>chitex60.tgz</CODE>(teTeX) or <CODE>chitexN.tgz</CODE>(NTeX) and <CODE>fonts1.tgz</CODE>, <CODE>fonts2.tgz</CODE> under <CODE>/usr/local</CODE>.
And decompress <CODE>chitex60.tgz</CODE> to execute setup program <CODE>csetup</CODE>.
<BLOCKQUOTE><CODE>
<PRE>
# tar zxvf chitex60.tgz
# cd chitex60
# ./csetup
</PRE>
</CODE></BLOCKQUOTE>
<P>If you are using Red Hat 5.0, you may install the rpm package I made:
<BLOCKQUOTE>
<A HREF="ftp://ftp.phys.ntu.edu.tw/pub/os/linux/rpm/">ftp://ftp.phys.ntu.edu.tw/pub/os/linux/rpm/chitex-6.0.7-1.i386.rpm</A></BLOCKQUOTE>
<P>
<H3>Installing fonts</H3>
<P>You can install Chinese TrueType fonts for ChiTeX.
<UL>
<LI>Put TrueType fonts under <CODE>$TEXMF/fonts/chinese/ttf</CODE>.</LI>
<LI>Modify <CODE>$TEXMF/tex/chinese/chitex.fdf</CODE>, and add a new line:
<BLOCKQUOTE><CODE>
<PRE>
\choosechfont{fontname}{filename}
</PRE>
</CODE></BLOCKQUOTE>
In it, the <CODE>filename</CODE> is the fonts' names erased the <CODE>.ttf</CODE> part, and <CODE>\fontname</CODE> is the macro that you can use for this font in your document.
For example, if you want to use a font named <CODE>avntmv.ttf</CODE>, put a line <CODE>\choosechfont{ming}{avntmv}</CODE>, and use the macro <CODE>\ming</CODE> to use the font <CODE>avntmv.ttf</CODE>.</LI>
<LI>In <CODE>chitex.fdf</CODE>, there were several fonts defined; thus, if you want to install these fonts, you don't have to change <CODE>chitex.fdf</CODE> any more.
<BLOCKQUOTE><CODE>
<PRE>
\kai ----> ntukai.ttf
\li ----> ntuli.ttf
\mr ----> ntumr.ttf
\fs ----> ntufs.ttf
</PRE>
</CODE></BLOCKQUOTE>
</LI>
</UL>
<P>
<H3>Tests</H3>
<P>Now, you can take the samples enclosed with ChiTeX to test:
<BLOCKQUOTE><CODE>
<PRE>
# chilatex math2.tex (Compiling)
# xdvi math2 (pre-viewing)
# dvips math2 (Changing to PostScript file)
# ghostview math2.ps (Using ghostview to view the output)
</PRE>
</CODE></BLOCKQUOTE>
<P>You can also write a small document to test the new installed fonts:
<HR>
<PRE>
\documentclass[12pt]{article}
\begin{document}
\ming
This is a test(You should type these words in Chinese).
\end{document}
</PRE>
<HR>
<P>For more information, please refer to the homepage of professor Chen.
<BLOCKQUOTE>
<A HREF="http://www.math.ncu.edu.tw/yih/intro.htm">http://www.math.ncu.edu.tw/yih/intro.htm</A></BLOCKQUOTE>
<P>
<H2><A NAME="ss7.3">7.3 Dtop</A>
</H2>
<P>The Dtop is a Chinese printing software for the UNIX platform, developed by the
<A HREF="http://www.bdc.com.tw/">Behavior Design Corporation</A>.
In early November, 1995, it released the version of v1.4, which was composite of five various platforms, simultaneously. The Linux beta version provided the users with a trial of free and endless expiration, which has created another nice Chinese environment for Linux fans. However, the formal version is late for publishing until now due to the tiny scope of business market. It seems that this had been ceased to develop.
<P>
<H3>How to Get it? </H3>
<P>The beta version of Dtop for Linux can download from each school's ftp site:
<UL>
<LI>
<A HREF="ftp://nctuccca.edu.tw/Chinese/ifcss/software/linux/X11R6/dtop1.4/pub/">ftp://nctuccca.edu.tw/Chinese/ifcss/software/linux/X11R6/dtop1.4/pub/</A></LI>
<LI>
<A HREF="ftp://ftp.ntu.edu.tw/Chinese/ifcss/software/linux/X11R6/dtop1.4/pub/">ftp://ftp.ntu.edu.tw/Chinese/ifcss/software/linux/X11R6/dtop1.4/pub/</A></LI>
<LI>
<A HREF="ftp://ftp.ccu.edu.tw/pub3/chinese/linux/X11R6/dtop1.4/pub/">ftp://ftp.ccu.edu.tw/pub3/chinese/linux/X11R6/dtop1.4/pub/</A></LI>
<LI>
<A HREF="ftp://ftp.ncu.edu.tw/OS/linux/X/ifcss/X11R6/dtop1.4/pub/">ftp://ftp.ncu.edu.tw/OS/linux/X/ifcss/X11R6/dtop1.4/pub/</A></LI>
<LI>
<A HREF="ftp://ftp.ifcss.org/pub/software/linux/X11R6/dtop1.4/pub/">ftp://ftp.ifcss.org/pub/software/linux/X11R6/dtop1.4/pub/</A></LI>
</UL>
<P>There are three sub-directories saying respectively,
<DL>
<DT><B>dtop.linux</B><DD><P>Storage for binary files and data files of Dtop, which can divide into three major files. After decompressing all files, the disk space demanded is about 40MB.
<DT><B>dtop.readme</B><DD><P>Storage for related documents of Dtop, which are stored as the file format defined by Dtop. Users can read this papers through this beta version directly.
<DT><B>dtop.manual</B><DD><P>Storage of references for X version of Dtop, which are stored as the file format defined by Dtop. The X version can access through Linux, IBM AIX, HP-UX, Sun 4.1.x, and Solaris directly.
</DL>
<P>
<H3>Installing</H3>
<P>The hardware required is something like this: CPU 486 DX-33 or later, RAM 16MB or larger, 50MB disk space or so. If there is no enough memory on your system, you will get nuts someday.
<P>Decompress all the files under <CODE>dtop.linux</CODE> to a self-selected directory, for example,
<CODE>/usr/local/dtop</CODE>.
<P>Before implementing it, you must first set environment variable <CODE>$DTOPHOME</CODE>, which is the directory that preparing to install Dtop. The <CODE>$DTOPTMP</CODE> is a temporary directory for Dtop, which is usually <CODE>/tmp</CODE>. The <CODE>XAPPLRESDIR</CODE> is the directory for resources files of Dtop, which is set at
<CODE>$DTOPHOME/user</CODE> .
<BLOCKQUOTE><CODE>
<PRE>
# export DTOPHOME=/usr/local/dtop
# export DTOPTMP=/tmp
# export XAPPLRESDIR=DTOPHOME/user
</PRE>
</CODE></BLOCKQUOTE>
<P>You need to set the Chinese fonts directory used by Dtop.
<BLOCKQUOTE><CODE>
<PRE>
# xset fp+ $DTOPHOME/pcf.chn
</PRE>
</CODE></BLOCKQUOTE>
<P>Finally, you have to configure the Keysym matching table caused by the matching between Keysym and Keycode under X different from workstations. The Keysyms of <CODE>BackSpace</CODE> and <CODE>Delete</CODE>, for example, are all matching to the same Keycode under X, regarding the behavior of <CODE>BackSpace</CODE> as the <CODE>Delete</CODE>'s in reality . To solve this problem, the Dtop creates a Keysym file, locating under <CODE>$DTOPHOME/user</CODE> of which filename is <CODE>dtop_keysym.linux</CODE>. After starting X, invoke the command,
<BLOCKQUOTE><CODE>
<PRE>
# xmodmap dtop_keysym.linux
</PRE>
</CODE></BLOCKQUOTE>
<P>Another solution is that invoke commands directly on shell:
<BLOCKQUOTE><CODE>
<PRE>
# xmodmap -e "keycode 22 = BackSpace"
# xmodmap -e "keycode 107 = Delete"
</PRE>
</CODE></BLOCKQUOTE>
<P>When everything is ready, you can execute Dtop.
<BLOCKQUOTE><CODE>
<PRE>
# $DTOPHOME/bin/dtop14
</PRE>
</CODE></BLOCKQUOTE>
<P>You may read all the on-line references enclosed in Dtop for more detailed introductions.
<P>
<H2><A NAME="ss7.4">7.4 ChinesePower</A>
</H2>
<P>The ChinesePower is a Far-East Editor running under X, which is easy and classified as WYSIWYG.
It supports BIG5, GB, Japanese and Korean mixed inputs, and the printing and displaying PostScript format. It can generate GIF graphics of seven colors for documents, which is adequate for Chinese homepages. ChinesePower uses HBF or TTF fonts.
<P>You can get it from,
<BLOCKQUOTE>
<A HREF="ftp://ftp.ifcss.org/pub/software/x-win/editor/chpower-2.0.tar.gz">ftp://ftp.ifcss.org/pub/software/x-win/editor/chpower-2.0.tar.gz</A></BLOCKQUOTE>
<P>To compile Chinese Power, you will need HBF fonts and Motif libraries. At first, modify <CODE>Makefile</CODE> to fit your system, then
<BLOCKQUOTE><CODE>
<PRE>
# make
</PRE>
</CODE></BLOCKQUOTE>
After making step, it will generate binary executable files.
Then export environment variables:
<BLOCKQUOTE><CODE>
<PRE>
# export HBFPATH=/usr/local/lib/chinese/HBF/
# export TTFPATH=/usr/local/lib/chinese/TTF/
# export HZINPUTDIR=/usr/local/lib/chinese/dict/
# export CHPOWERPATH=path_of_chinesepower
</PRE>
</CODE></BLOCKQUOTE>
<P>
<H2><A NAME="ss7.5">7.5 EasyFlow</A>
</H2>
<P>This is developed by wycc &lt;
<A HREF="mailto:wycc@iis.sinica.edu.tw">wycc@iis.sinica.edu.tw</A>&gt; , which can make simple printing for Chinese documents. Relative information is locating at
<BLOCKQUOTE>
<A HREF="http://formosa.iis.sinica.edu.tw/~wycc/">http://formosa.iis.sinica.edu.tw/~wycc/</A></BLOCKQUOTE>
<P>
<P>
<HR>
<A HREF="Chinese-HOWTO-8.html">Next</A>
<A HREF="Chinese-HOWTO-6.html">Previous</A>
<A HREF="Chinese-HOWTO.html#toc7">Contents</A>
</BODY>
</HTML>