[XeTeX] Issue with CJK in pdf build

Chris Jones cjns1989 at gmail.com
Thu Nov 19 02:20:40 CET 2009


On Wed, Nov 18, 2009 at 07:15:48PM EST, Wilfred van Rooijen wrote:

> Check the fontspec-manual. The command \setmainfont does not set all
> the other fonts accordingly.

Found \setmonofont in the fontspec manual, so I now have this in
mystyle.sty and everything comes out great:

------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{mystyle}[2008/06/05 AsciiDoc DocBook Style]
\RequirePackageWithOptions{docbook}

\RequirePackage{fontspec}                     *
\setmainfont{Times New Roman}                 *
\setmonofont{unifont}                         *

\renewenvironment{sidebar}[1][0.95\textwidth]{
  \hspace{0mm}\newline%
  \noindent\begin{Sbox}\begin{minipage}{#1}%
  \setlength\parskip{\medskipamount}%
}{
  \end{minipage}\end{Sbox}\doublebox{\TheSbox}%
}

\usepackage{alltt}
------------------------------------------------------------------------

I wrote a little python script that dumps the terminal's current font
capabilities with the code point (U+nnnn), the corresponding glyph if it
exists, and the official Unicode name - thought it would be a good way to
test the asciidoc/a2x tool chain to generate a pdf with the script's
output.

> Also note that by using a \setmainfont you are likely to lose a lot of
> italic, emph, boldface etc which are normally handled inside TeX by
> implicitly changing to another font. Personally I have yet to find a
> completely satisfactory solution for this issue.

I realize that, but I chose to look on the bright side :-)

> So if anybody knows how I can set my font for instance to the Kozuka
> Mincho and still have boldface in my References, please let me know
> :-))

I'm not likely to be able to help with that..

> > Yes - although as a user of a tool chain I'm not sure I should have
> > to worry about the customization of each separate component.  And
> > since it's been trial and error four hours a night for the last ten
> > days or so, I'm not even learning anything.

> But it seems that the problem is that the tool chain uses TeX, and when
> used in the toolchain, TeX is not configured for the full 100%, and
> thus strange things happen. I guess we can discuss whether the
> tool chain is at fault or the user. 

Since I'm the user, it must be the tool chain ;-)

> It may well be that in earlier days, when a PC was set up for a
> certain encoding, for example a "Russian-capable" PC in Russia, a
> "Thai-capable" computer in Thailand, etc, and that this kind of issue
> of mixing character-types was much less of a problem, because it
> didn't really exist unless specifically requested.

What I don't understand is that the dblatex manual apparently states
that mixing 'languages' (scripts, rather) is not possible. Since one
really wonderful thing about Unicode is that you can mix different
scripts in the same document, I wrongly concluded that it was time I
look elsewhere for my fun. Must have gotten my eyes crossed since it
seems you only need joints that are flexible enough to perform the
contortions.

> You seem to expect that TeX (or other tools) will revert to
> "reasonable defaults". However, the philosophy of TeX (and many other
> computer languages) is that there is no reasonable default. 

No..!! What I expected is that the _asciidoc/a2x tool chain_ _as
implemented in debian stable_ would handle this and tell TeX what
to do. But on second thoughts, since my locale is set to en_US.UTF-8 I
have a feeling that's what it's doing and chooses a font that has all
the glyphs that would be of interest, including arrows, box drawing,
etc. on top of the ASCII range.

> TeX provides "expert level" typesetting. Consider TeX like a Formula-1
> car: very powerful, but really only applicable if driven by someone
> who knows what they're doing. In the case of the tool chain, using TeX
> may be overdoing things a bit?

In terms of functionality, probably. But then, is there an alternative?

Thank you for your comments.

CJ



More information about the XeTeX mailing list