CTAN Comprehensive TeX Archive Network

Direc­tory language/japanese/bxcjkjatype


BXcjk­jatype Pack­age

: Sup­port for Ja­panese type­set­ting with pdf and CJK pack­age

This pack­age pro­vides work­ing con­fig­u­ra­tion of the CJK pack­age suit­able for Ja­panese type­set­ting of mod­er­ate qual­ity. More­over, it fa­cil­i­tates use of the CJK pack­age for p users, by pro­vid­ing com­mands that are sim­i­lar to those used by the p ker­nel and some other pack­ages used with it.

Note that while the CJK pack­age sup­ports many in­put en­cod­ings, this pack­age sup­ports only UTF-8.

Sys­tem re­quire­ment

  • for­mat: .
    • en­gine: pdf (DVI or PDF mode).
    • DVI driver: Any­thing.
      • Non-de­fault font set­tings re­quire dvipdfmx or pdf.
    • Depen­dent pack­ages:
      • CJK, CJKutf8, CJKs­pace, CJKpunct, etool­box;
        • ipaex-type1 (when us­ing de­fault font map­ping);
        • zh­metrics (when us­ing non-de­fault font map­ping).


  • *.sty → $TEXMF/tex/la­tex/BXcjk­jatype


This pack­age is dis­tributed un­der the MIT Li­cense.

The bx­cjk­jatype Pack­age

Pack­age Load­ing


The avail­able op­tions are de­scribed here­after.

Op­tions for auto-wrap­ping

Th­ese op­tions en­able one to wrap the doc­u­ment body with a CJK(*) en­vi­ronemnt au­to­mat­i­cally and safely. They are suit­able when a doc­u­ment con­tains much amount of CJK text, or some “mov­ing ar­guem­nts” hold CJK text.

  • whole, wholeCJK*: Wraps the whole doc­u­ment body with a CJK* en­vi­ron­ment (pre­cisely speak­ing, with \begin{uCJK*} ... \end{uCJK*} ).
    • wholeCJK: Wraps the whole doc­u­ment body with a CJK en­vi­ron­ment (pre­cisely speak­ing, with \begin{uCJK} ... \end{uCJK} ).
    • nowhole (de­fault): Ne­ga­tion of wholeCJK* or wholeCJK.

Op­tions for “auto-tilde”

The op­tion autotilde trig­gers au­to­matic in­vo­ca­tion of \CJKtilde, which makes a tilde char­ac­ter (~) in­sert “shibuaki” (a thin space be­tween al­pha­betic and ideo­graphic let­ters) rather than a no-break space (stan­dard). No-break spaces can still be in­serted by the com­mand \nbs, and \standardtilde can­cels the ef­fect of \CJKtilde. (The com­mands men­tioned here be­long to CJK pack­age.)

  • autotilde: Makes \CJKtilde in­voked at the be­gin­ning of ev­ery CJK(*) en­vi­ronemnt.
    • noautotilde (de­fault): Ne­ga­tion of autotilde.

Op­tions for font-map­ping

One can use pre­set font map­pings in the same way as in the px­ch­fon pack­age. Please re­fer to the man­ual of that pack­age for de­tailed ex­pla­na­tion of this fea­ture.

  • oneweight, nooneweight: The same as in px­ch­fon.
    • One can use font pre­set op­tions (such as ms) which are avail­able in px­ch­fon (ex­cept ob­so­lete ones).
    • ttfname=<pattern>: Spec­i­fies the pat­tern of the TTF font names which are used when TTC sub­sti­tu­tion is em­ployed. For ex­am­ple, when ttfname=*_1 is given, the font “in­dex 0 of mogam.ttc” will map to “mogam1.ttf”, and sim­i­larly, “in­dex 1” to “mogam2.ttf” and so on.
    • ipaex-type1: Dis­ables the font man­age­ment of this pack­age and di­rectly uses the fam­i­lies pro­vided by the ipaex-type1 pack­age, namely ipxm and ipxg. In this set­ting the value of \mcdefault is ipxm and the value of \gtdefault and \mgdefault is ipxg, so that the higher level com­mands (such as \sffamily and \gtfamily) can work cor­rectly.

Op­tions for CJK font scal­ing

  • scale=<real>: Sets the scal­ing fac­tor for CJK fonts.

(With ver­sion 0.3 or later, one can em­ploy the scal­ing even with the ipaex-type1 op­tion.)

Other op­tions

  • everypage: Out­puts the font map­ping in­for­ma­tion on ev­ery page of the re­sulted DVI doc­u­ment. Avail­able only with dvipdfmx driver.
    • noeverypage (de­fault): Ne­ga­tion of everypage.
    • driver op­tions: pdftex, dvipdfmx, dvips and none are avail­able. The driver set­ting is rel­e­vant only when us­ing font map­pings other than the de­fault one (ipaex-type1 fonts), so one need not care of drivers in us­ing de­fault fonts. More­over, non-de­fault font map­pings are sup­ported only by pdftex and dvipdfmx, and these two val­ues are auto-de­tected (pdftex is de­fault in PDF mode and dvipdfmx in DVI mode). Thus one will never need to spec­ify the driver.
    • substmingoth: Ap­plies the sub­sti­tu­ion of fam­i­lies min, goth and maru (used con­ven­tion­ally for Ja­panese) with fam­i­lies mc, gt and mg (stan­dard in this pack­age).
    • nosubstmingoth (de­fault): Ne­ga­tion of substmingoth.
    • boldbyembolden (de­fault): Changes the im­ple­men­tion of \CJKbold (pseudo-bold) from “over­strik­ing” to “syn­thetic em­bold­en­ing”.
    • noboldbyembolden: Ne­ga­tion of boldbyembolden.


Select­ing CJK fonts

The present pack­age pro­vides three “generic” CJK fam­i­lies in the same way as p plus the fam­ily (\mcfamily), Gothic fam­ily (\gtfamily), and Maru-gothic fam­ily (\mgfamily). In de­fault set­ting, the font set from the ipaex-type1 pack­age are al­lo­cated; Min­cho fam­ily uses IPAex Min­cho font, and Gothic and Maru-gothic fam­i­lies use IPAex Gothic font. This al­lo­ca­tion can be al­tered by users.

  • \mcfamily: Changes the CJK fam­ily to Min­cho fam­ily. Equiv­a­lent to \CJKfamily{\mcdefault}.
    • \gtfamily: Changes the CJK fam­ily to Gothic fam­ily. Equiv­a­lent to \CJKfamily{\gtdefault}.
    • \mgfamily: Changes the CJK fam­ily to Maru-gothic fam­ily. Equiv­a­lent to \CJKfamily{\mgdefault}.

More ad­vanced com­mands:

  • \mcdefault/\gtdefault/\mgdefault: The names of CJK fam­i­lies cor­re­spond­ing to the three generic fam­i­lies. In the stan­dard al­lo­ca­tion their val­ues are mc/gt/mg re­spec­tively and the al­lo­ca­tion is used as de­fault.
  • \setCJKfamilydefault{<CJK-family>}: De­clares the de­fault CJK fam­ily. This de­fault value is used when fam­ily names are miss­ing in some com­mands, such as \CJKfamily{} and \begin{CJK}{UTF8}{}. The (re­de­fined) \normalfont also switches the CJK fam­ily to the fam­ily spec­i­fied by this com­mand.
The default value of this default family is the “counterpart” of
the alphabetic font family which is in effect at the beginning of
the document body. (See the next subsection.)

Syn­chro­niza­tion of CJK and non-CJK fam­i­lies

The CJK pack­age (and p en­gine) man­ages sep­a­rate “cur­rent fam­i­lies” for CJK and al­pha­betic (non-CJK) fam­i­lies. While this treat­ment has its merit, syn­chro­niza­tion of the two “cur­rent fam­i­lies” is con­ve­nient in many cases. Ac­cord­ingly, tHe present pack­age re­de­fines some of the com­mands that switches cur­rent al­pha­betic font fam­i­lies so that the CJK fam­ily will be switched to the coun­ter­part of the cur­rent al­pha­betic fam­ily, where the “coun­ter­part” is de­fined as fol­lows:

  • \rmfamily (Serif) → \mcfamily (Min­cho)
    • \sffamily (Sans-serif) → \gtfamily (Gothic)
    • \ttfamily (Monospace) → \gtfamily (Gothic)
    • The coun­ter­part of the other fam­i­lies is \mcfamily.

Rede­fined com­mands:

  • \rmfamily/\sffamily/\ttfamily: Changes the CJK fam­ily to the coun­ter­part of the al­pha­betic font fam­ily af­ter ex­e­cut­ing the orig­i­nal func­tion.
    • \normalfont: Changes the CJK fam­ily to the de­fault CJK fam­ily spec­i­fied by \setCJKfamilydefault com­mand.

There are short­hand forms of CJK/CJK* en­vi­ronem­nts:

  • \begin{uCJK*}...\end{uCJK*}: Equiv­a­lent to:
where `counterpart` means the counterpart of the current alphabetic
font family.
Note that this is *not* equivalent to
structure, which uses the default CJK family.
  • \begin{uCJK}...\end{uCJK}: Equiv­a­lent to:

Font map­ping

The us­age of these com­mands are the same as in the px­ch­fon pack­age. Please re­fer to the man­ual of that pack­age for de­tail.

  • \setminchofont[<id>]{<font-file>}
    • \setgothicfont[<id>]{<font-file>}
    • \setmarugothicfont[<id>]{<font-file>}
    • \setmediumminchofont[<id>]{<font-file>}
    • \setboldminchofont[<id>]{<font-file>}
    • \setmediumgothicfont[<id>]{<font-file>}
    • \setboldgothicfont[<id>]{<font-file>}
    • \setxboldgothicfont[<id>]{<font-file>}

How­ever there is a ma­jor lim­i­ta­tion as to the use of font map­ping with the pdf en­gine. One can use only TrueType fonts and more­over TTC for­mat is not al­lowed. (One can use any fla­vor of OpenType fonts when us­ing dvipdfmx.)

Note: The present pack­age does not sup­port the light-weight Min­cho font, and thus \setlightminchofont does noth­ing use­ful.

Other com­mands

  • \UTF{<hexadecimal-number>}: In­puts a CJK char­ac­ter through Uni­code code­point value. \UTF{5B57} is equiv­a­lent to \Unicode{"5B}{"57}.
  • \CJKforce{<character>...}: After­wards Treats the char­ac­ters given in the ar­gu­ment as CJK char­ac­ters (printed us­ing CJK fonts).
  • \CJKunforce{<character>...}: Cancels the ef­fect of the \CJKforce com­mand.
  • \@<character>: Treats the next char­ac­ter (only that oc­cur­rence) as a CJK char­ac­ter, when the char­ac­ter is out­side ASCII; oth­er­size the nor­mal mean­ing of \@ is re­tained.
  • \CJKecglue: Insers a “shibuaki” space. This will be in­voked by ~ when \CJKtilde is in ef­fect. This com­mand can be re­de­fined by users to ad­just the value of shibuaki space, just as \CJKglue can be re­de­fined to ad­just in­ter-ideo­graphic space.
For example:
    \renewcommand{\CJKecglue}{\hspace{0.125em minus 0.125em}}


  • The stan­dard font fam­i­lies pro­vided by this pack­age does not sup­port ver­ti­cal writ­ing, even when us­ing de­fault ipaex-type1 font set. How­ever, the fam­i­lies pro­vided by ipaex-type1 (ipxm and ipxg) do sup­port ver­ti­cal writ­ing, and one can uti­lize these fam­i­lies di­rectly by spec­i­fy­ing ipaex-type1 op­tion.

Re­vi­sion His­tory

  • Ver­sion 0.3 ‹2016/10/15›
    • Made the ver­ti­cal writ­ing work well (with CJKvert).
      • Avoided gar­bling of PDF strings cre­ated by hy­per­ref.
        • Al­lowed font scal­ing even when ipaex-type1 is set.
        • Added boldbyembolden fea­ture.
        • Added ttfname op­tion.
        • Added substmingoth op­tion.
  • Ver­sion 0.2c ‹2013/10/18›
    • Added sup­port of CJK font scal­ing.
      • Added \CJKforce, \CJKunforce, \@.
  • Ver­sion 0.2b ‹2013/09/28›
    • Added \UTF, \CJKecglue.
  • Ver­sion 0.2a ‹2013/08/08›
    • Added autotilde op­tion.
  • Ver­sion 0.2 ‹2013/08/08›
    • The first pub­lic ver­sion.

Takayuki YATO (aka. "ZR") http://zrbab­bler.sp.land.to/

Down­load the con­tents of this pack­age in one zip archive (266.9k).

bx­cjk­jatype – Type­set Ja­panese with pdf and CJK

The pack­age pro­vides a work­ing con­fig­u­ra­tion of the CJK pack­age, suit­able for Ja­panese type­set­ting of mod­er­ate qual­ity. More­over, it fa­cil­i­tates use of the CJK pack­age for p users, by pro­vid­ing com­mands that are sim­i­lar to those used by the p ker­nel and some other pack­ages used with it.

Ver­sion0.3 2016-10-15
Li­censesMIT Li­cense
Copy­right2013 Takayuki Yato
Main­tainerTakayuki Yato
Con­tained inTeX Live as bx­cjk­jatype
MiKTeX as bx­cjk­jatype
Guest Book Sitemap Contact Contact Author