summaryrefslogtreecommitdiff
path: root/language/chinese/CJK/cjk-4.8.5/doc/japanese/japanese.txt
blob: e637fdb0d75d3dec6cadf62b1db801783afb1454 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
This is the file japanese.txt of the CJK macro package ver. 4.1.0
(20-Nov-1996).

It concentrates on the use of DNP fonts (their font metrics can be used
in conjunction with PS printers which have their own builtin Japanese fonts)
and watanabe jfonts.

The use of the kanji48 bitmap font together with hbf2gf is similar to all
other CJK bitmap files and is documented in detail in the file hbf2gf.txt .


kanji48 font
------------

Where is the font ? )

Host ftp.tex.ac.uk
    Location: /pub/archive/fonts/CJK
      FILE   -rw-rw-r--   1 ctan     TeX    742459 Dec  1 00:01 kanji48.tar.gz
Host ftp.dante.de
    Location: /tex-archive/fonts/CJK
      FILE   -rw-rw-r--  1 Mr.Ftp   server  742459 Dec  1 00:01 kanji48.tar.gz

or your nearest CTAN mirror ftp sites.


How to use it in CJK ? )

Use CJK.sty with Japanese as follows:

with latex:

   \documentclass[a4paper]{article}
     \topmargin=-3.5cm
     \textheight=26cm
   \usepackage{CJK}
   \usepackage{indentfirst}

   \begin{document}
   \begin{CJK*}{JIS}{song}

   .....
   < Japanese text >
   .....

   \end{CJK*}
   \end{document}


with mulatex:

   \documentclass[a4paper]{article}
    ....
   \usepackage[global]{CJK}
   \usepackage{indentfirst}

   \begin{document}
   \begin{CJK*}{}{}

   .....
   < Japanese text >
   .....

   \end{CJK*}
   \end{document}


The package CJK offers two environments: CJK and CJK*. CJK* suppresses
spaces followed by a CJK character, whereas CJK doesn't.

If you write only Japanese, you should use the CJK* environment. If you
really need a space directly followed by a JIS character, you must then use
TeX commands like `\ ', `{} ', etc.

It is highly recommended to declare

     \usepackage[global]{CJK}

if you use mulatex to be able to write Japanese inside of other
environments. See mule2cjk.doc for details.


DNP fonts
---------

What are DNP fonts ? )

DNP stands for "Dai Nippon Printing" (a big printing company in Japan). DNP
fonts are commercial fonts made by this company; if real DNP fonts have been
already installed at your site, you should use them. But watanabe-dnp fonts,
which are customized from watanabe-jfonts to emulate DNP fonts, are
freeware. The method of emulation is symbolic name linking.


Where are the fonts ? )

      watanabe-dnp (pk files)
         ftp.math.s.chiba-u.ac.jp://tex/watanabe-dnp/300
             jb10-300pk.tar.gz  jb10-622pk.tar.gz  jm10-329pk.tar.gz
             jm10-746pk.tar.gz  jb10-329pk.tar.gz  jb10-746pk.tar.gz
             jm10-360pk.tar.gz  jm8-300pk.tar.gz   jb10-360pk.tar.gz
             jb8-300pk.tar.gz   jm10-432pk.tar.gz  jm9-300pk.tar.gz
             jb10-432pk.tar.gz  jb9-300pk.tar.gz   jm10-518pk.tar.gz
             jb10-518pk.tar.gz  jm10-300pk.tar.gz  jm10-622pk.tar.gz
      tfm files
         ftp.math.s.chiba-u.ac.jp://tex/watanabe-dnp/tfm-dnp.tar.gz
         ftp.math.s.chiba-u.ac.jp://tex/watanabe-dnp/tfm.tar.gz
      tools for symbolic link
         ftp.math.s.chiba-u.ac.jp://tex/watanabe-dnp/fake.tar.gz

How to set them up ? )

       Suppose your fonts directory is $fonts ,
                     (e.g. /usr/local/lib/tex/fonts/japan)
       and your source directory in which the above files are put is $src.
                     (e.g. /usr/local/src)

       You should now expand all fonts that you've downloaded from the ftp
       server.

         % cd $src
         % gunzip -c fake.tar.gz     | tar xvf -
         % gunzip -c jd....pk.tar.gz | tar xvf -
         % gunzip -c jm....pk.tar.gz | tar xvf -
         % gunzip -c tfm.tar.gz      | tar xvf -

       Make directories.

         % cd $fonts
         % mkdir $fonts/watanabe-dnp
         % mkdir $fonts/watanabe-dnp/jd300
         % mkdir $fonts/watanabe-dnp/tfm

       Copy files.

         % cd $fonts/watanabe-dnp
         % cp $src/fake/* .
         % cp $src/tfm/* tfm
         % cp $src/*pk/*pk jd300
 
       Make all watanabe-dnp fonts.

         % make mk-300ex

       Make symbolic links.
      
         % mkdir $fonts/dnp
         % cd $fonts/dnp
         % cp $fonts/watanabe-dnp/LNFAKE .

       Next, edit the file `LNFAKE' in the dnp directory. Make sure that
       `wdir' is set to the directory where you have installed watanabe-dnp
       fonts:

               wdir=../watanabe-dnp/jd300/

       Then execute,

         % LNFAKE jm dm
         % LNFAKE jb dg


       The directory tree after the installation will look like this:

          $fonts/ +- watanabe-dnp/ +-jd300/ (all pk files)
                  |                |
                  |                +-tfm/
                  |                |
                  |                +-Makefile, FAKEDNP, FAKETFM, fake.c  ... 
                  |
                  +- dnp/

       You will need only the directories $fonts/watanabe-dnp/jd300 and
       $fonts/dnp. You can remove $fonts/watanabe-dnp/tfm/ together with the
       other now unnecessary files.

       Moving to your tfm directory, execute

         % gunzip -c tfm-dnp.tar.gz | tar xvf -

       Then add tfm-dnp (with the full path) to the TEXFONTS environment
       variable.


How to use them in CJK ? )

See the following examples how to use CJK.sty with DNP fonts.

with latex:

   \documentclass[a4paper]{article}
     \topmargin=-3.5cm
     \textheight=26cm
   \usepackage{CJK}
   \usepackage{indentfirst}

   \begin{document}
   \begin{CJK*}[dnp]{JIS}{song}

   <Japanese text>

   \end{CJK*}
   \end{document}


with mulatex:

   \documentclass[a4paper]{article}
   ....
   \usepackage[global]{CJK}
   \usepackage{indentfirst}

   \CJKfontenc{JIS}{dnp}

   \begin{document}
   \begin{CJK*}{}{}

   <Japanese text>

   \end{CJK*}
   \end{document}


[Read the file mule2cjk.doc for an explanation why you can't say
 `\begin{CJK*}[dnp]{}{}' with mulatex.]


watanabe jfonts
---------------
You can also use the original watanabe jfonts in a CJK environment.

Where are the fonts ? )

      watanabe-jfonts (pk files)
         ftp.iij.ad.jp://pub/TeX/fonts/watanabe-jfonts/300
                 b250.lzh b274.lzh b300.lzh b329.lzh b360.lzh
                 b432.lzh b518.lzh b622.lzh b746.lzh m250.lzh
                 m274.lzh m300.lzh m329.lzh m360.lzh m432.lzh
                 m518.lzh m622.lzh m746.lzh

         ftp.iij.ad.jp://pub/TeX/fonts/watanabe-jfonts/400

      tfm files
         ftp.iij.ad.jp://pub/TeX/fonts/watanabe-jfonts/tfmfiles.lzh


How to use them in CJK ? )

See the following examples how to use CJK.sty with watanabe jfonts.

with latex:

   \documentclass[a4paper]{article}
     \topmargin=-3.5cm
     \textheight=26cm
   \usepackage{CJK}
   \usepackage{indentfirst}

   \begin{document}
   \begin{CJK*}[wn]{JIS}{song}

   <Japanese text>

   \end{CJK*}
   \end{document}


with mulatex:

   \documentclass[a4paper]{article}
   ....
   \usepackage[global]{CJK}
   \usepackage{indentfirst}

   \CJKfontenc{JIS}{wn}

   \begin{document}
   \begin{CJK*}{}{}

   <Japanese text>

   \end{CJK*}
   \end{document}


compilation and coding-system
-----------------------------

If you use `latex' to compile latex files, you must save these files in
Japanese EUC and say

    latex yourfile

to process these files.

[You can also save the file in SJIS encoding; then you must use `SJIS'
 instead of `JIS' as the encoding parameter in the CJK environment. Note
 that SJIS uses the JIS fonts.]

If you use `mulatex' to compile latex files, there are several possibilities
in which coding-system you can save your latex files. If you use the
original mulatex script file that comes with the CJK package, you must save
these files in Mule's internal code and say

    mulatex yourfile

to process these files.
 
[mulatex is in utils/mule2cjk in CJK package directory. ref: mule2cjk.doc]

But if you do not like the idea of saving latex files in Mule's internal
encoding (this coding-system is not a standard coding-system, can not be
read without Mule and will be changed in the future), you can save them in
*junet*, which is based on ISO-2022 encoding, or in *ctext*, which is used
in the X window system as Compound Text Encoding. Then replace the mulatex
shell script with one of the following examples.

 
 :  mulatex for *junet*

   % cat mulatex
    #!/bin/sh
    #  mulatex : LaTeX2e for Mule's *junet* encoding
    #
    fname=`echo $1 | sed 's/\.[^\.]*$//g'`
    coco '*junet*' '*internal*' < $1 | mule2cjk > $fname.cjk
    st=$?
    if [ $st -ne 0 ] ; then
       exit $st
    fi
    latex $fname.cjk
    st=$?
    if [ -f $fname.cjk ] ; then
       /bin/rm -f $fname.cjk
    fi
    exit $st
   %

 :  mulatex for *ctext*

   % cat mulatex
    #!/bin/sh
    #  mulatex : LaTeX2e for Mule's *ctext* encoding
    #
    fname=`echo $1 | sed 's/\.[^\.]*$//g'`
    coco '*ctext*' '*internal*' < $1 | mule2cjk > $fname.cjk
    st=$?
    if [ $st -ne 0 ] ; then
   	exit $st
    fi
    latex $fname.cjk
    st=$?
    if [ -f $fname.cjk ] ; then
    	/bin/rm -f $fname.cjk
    fi
    exit $st
    %

If you use Mule (without auctex), add one of the following pieces of
Lisp code to your .emacs initialization file.

 : `.emacs' for *junet*

    (add-hook 'LaTeX-mode-hook
              (function (lambda ()
                (set-file-coding-system  *junet*)
                )))

 : `.emacs' for *ctext*

    (add-hook 'LaTeX-mode-hook
              (function (lambda ()
                (set-file-coding-system  *ctext*)
                )))

The program `coco' is included in the Mule package.


auctex
------

auctex is an elisp package for TeX and LaTeX users. It is easy to integrate
the CJK environment into auctex; the usage is very similar to ordinary LaTeX
with the exception that the typesetting command to compile a .dvi file is
not `latex' but `mulatex'.

Add the following code to your .emacs file (or, if possible, to
tex-site.el).

 : `.emacs' for auctex users

    (add-hook 'LaTeX-mode-hook
              (function (lambda ()
                (set-file-coding-system  *junet*)
                (nconc
                 TeX-command-list
                 (list
                  (list "MuLaTeX" "aucmulatex %t" 'TeX-run-LaTeX nil t)
                  )
                 )
                (setq TeX-command-default "MuLaTeX")
                )))


 :  mulatex for auctex users

   % cat aucmulatex
    #!/bin/sh
    #  aucmulatex : LaTeX2e in auctex mode for Mule's *junet* encoding
    #
    fname=`echo $1 | sed 's/\.[^\.]*$//g'`
    coco '*junet*' '*internal*' < $1 | mule2cjk > $fname.cjk
    st=$?
    if [ $st -ne 0 ] ; then
       exit $st
    fi
    latex \\nonstopmode\\input{$fname.cjk}
    st=$?
    if [ -f $fname.cjk ] ; then
       /bin/rm -f $fname.cjk
    fi
    exit $st
   %

   This example describes only the usage for *junet*. Of course, you can use
   other coding systems too.
 

auctex (yet another usage)
----------------------------

You can directly write elisp code instead of using a mulatex shell script
(not for the faint-hearted :-). If TeX files are written in *junet*, *ctext*,
*euc-japan* ... encoding, Mule will understand the input files automatically.
Add the following code to your .emacs file (or, if possible, to tex-site.el).

 : `.emacs' for auctex user (for Mule 2.3 based on emacs 19.28)

   (add-hook 'LaTeX-mode-hook
   	  (function (lambda () 
   		      (nconc
   		       TeX-command-list
   		       (list 
   			(list "MuLaTeX" "latex '\\nonstopmode\\input{%c}'" 
   			      'TeX-run-MuLaTeX nil t)
   			)
   		       )
   		      (nconc
   		       TeX-expand-list
   		       (list
   			(list  "%c" 'file "cjk")
   			))
   		      (setq TeX-command-default "MuLaTeX")
   		      )))
   
   (define-program-coding-system nil "mule2cjk" *internal*)
   
   (defvar TeX-LaTeX-CJK-tmpfile nil)
   
   (defun TeX-MuLaTeX-sentinel (process name)
     (prog1
         (TeX-LaTeX-sentinel process name)
       (delete-file TeX-LaTeX-CJK-tmpfile)))
   
   ;  customized from TeX-run-LaTeX
   (defun TeX-run-MuLaTeX (name command file)
     "Run mule2cjk and latex on current TeX buffer."
   
     (let ((TeX-LaTeX-CJK-tmpbuffer (generate-new-buffer-name "cjk")))
       (setq TeX-LaTeX-CJK-tmpfile (concat file ".cjk"))
       (generate-new-buffer TeX-LaTeX-CJK-tmpbuffer)
       (call-process-region
        (point-min) (point-max) "mule2cjk" nil TeX-LaTeX-CJK-tmpbuffer nil)
       (set-buffer TeX-LaTeX-CJK-tmpbuffer)
       (write-region (point-min) (point-max)
   		  TeX-LaTeX-CJK-tmpfile nil nil *internal*)
     
       (let ((process (TeX-run-format name command file)))
         (setq TeX-sentinel-function 'TeX-MuLaTeX-sentinel)
         (if TeX-process-asynchronous
   	  process
   	(TeX-synchronous-sentinel name file process)))
     (kill-buffer  TeX-LaTeX-CJK-tmpbuffer)))


indentfirst.sty
---------------

Japanese style of indenting paragraphs is different from the original latex.
There is a style file called `indentfirst.sty' in the official LaTeX2e
`tools' package which always indents the first paragraph.

Where is indentfirst.sty ? )

Host ftp.dante.de

    Location: /tex-archive/macros/latex/packages/tools
      FILE      rw-rw-r--      1492  Dec 14 17:46   indentfirst.dtx
                
or your nearest CTAN mirror ftp sites.

You should get all files in /pub/TeX/CTAN/macros/latex/packages/tools, read
the readme.txt file and install them. There are many, many useful styles in it.
(e.g. tabular or verbatim etc.)


\maketitle
----------

When you write Japanese titles, make sure that the \maketitle command
is inside of a CJK environment because it contains CJK characters.

example )

   \documentclass[a4paper]{article}
    ....
   \usepackage[global]{CJK}
   \usepackage{indentfirst}

   \begin{CJK*}{}{}
     \title{ < Japanese Text > }
     \author{ < Japanese Text > }
   \end{CJK*}

   \begin{document}
   \begin{CJK*}{}{}

     \maketitle
   .....
   < Japanese Text >
   .....

   \end{CJK*}
   \end{document}



JIS.cap
-------

CJK provides Japanese captions. You need the koma-script package (which is a
replacement of the standard classes) to use the caption files. (ref: `CJK
captions' in CJK.txt)

[This feature does not work for Japanese in CJK versions prior to 4.1.0]


Where is Koma-script ? )

Host ftp.dante.de

    Location: /tex-archive/macros/latex/contrib/supported
      DIRECTORY rwxr-xr-x       1024 Jan 23 12:20 koma-script

or your nearest CTAN mirror ftp sites.

How to use it in CJK ? )

Inside of your CJK JIS environment, put

   \CJKcaption{JIS}

to activate Japanese captions.

   To use CJK.sty and Koma-script for Japanese captions, see the
   example below.

   % srcartcl is a stylefile of Koma-script
   \documentclass{scrartcl}
     \topmargin=-3.5cm
     \textheight=26cm
   \usepackage{CJK}
   \usepackage{indentfirst}

   \begin{document}
   \begin{CJK*}[dnp]{JIS}{song}
   \CJKcaption{JIS}

   <Japanese text>

   %  Japanese Caption
   \refname{<Japanese text>}

   \end{CJK*}
   \end{document}


\newpage
--------

If you encounter an undefined CJK command (just before leaving the CJK
environment), it is necessary to flush out the page, because LaTeX sometimes
writes the headers _after_ the environment was closed. (ref: `Possible
errors' in CJK.txt)


example )

   \documentclass[a4paper]{article}
   \usepackage{CJK}
   \usepackage{indentfirst}

   \begin{document}
   \begin{CJK*}{JIS}{song}

   < Japanese text >
   .....
   \newpage
   \end{CJK*}
   \end{document}


Japanese PostScript printer
---------------------------

If your site has a postscript printer with builtin Japanese PS fonts 
that implements /Ryumin-Light and /GothicBBB-Medium, or a printer that
can emulate these fonts, you can easily use it to print out a dvi file
made from dnp-tfm (see DNP fonts). `dvi2ps' is a tool to drive printer
resident Japanese PS fonts. You can also use watanabe-dnp fonts for
previewing, as their metric files are the same.

Where is dvi2ps ? )

Host ftp.math.s.chiba-u.ac.jp

    Location: /tex
      FILE      rw-r--r--    112970  Dec  1  1994   dvi2ps-1.91j.tar.gz


------------------
Version 1.0 Beta8 (1996/02/09)
     Tanaka Shinichiro      Email: tanaka3@ifos.se.fujitsu.co.jp



---End of japanese.txt---