[XeTeX] Issue with CJK in pdf build

Chris Jones cjns1989 at gmail.com
Thu Nov 19 01:03:59 CET 2009


On Wed, Nov 18, 2009 at 04:31:17PM EST, Jonathan Kew wrote:

[..]

> There are subsequent error messages related to hyperlinks, etc., which I 
> don't know anything about; perhaps there are other things you need to 
> include in such a "style" to keep dblatex happy. 

On a hunch I added a 'mystyle.xsl' to my .dblatex directory tree,
copying the /etc/asciidoc/docbook.xsl to it and pointed dblatex to it:

dblatex -V -d --xsl-user ~/.dblatex/mystyle2/xsl/mystyle.xsl --texstyle ~/.dblatex/mystyle2/latex/mytexstyle.sty -b xetex unicode.xml
                ^                                ^

Looks like with the --texstyle option, dblatex was no longer able to
find it own .xsl file.

After explicitly specifying it via the --xsl-user flag practically all
the errors messages disappeared and the .pdf was built successfully.

> Maybe you can locate the default dblatex style (which presumably
> includes the command \setmainfont{DejaVu Serif}, etc) and model yours
> on that.

I added the recommended lines near the top (¹):

------------------------------------------------------------------------
%% Trying to change to a Unicode font
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{mystyle}[2008/06/05 AsciiDoc DocBook Style]
\RequirePackageWithOptions{docbook}

\RequirePackage{fontspec}                                          (¹)
\setmainfont{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}%
}

% For DocBook literallayout elements, see `./dblatex/dblatex-readme.txt`.
\usepackage{alltt}
------------------------------------------------------------------------

All the glyphs are now rendered correctly in 'normal' text.

Not the case for 'code blocks' (in asciidoc terminology) where I'm still
getting the default with most glyphs missing.

Is there a latex command that lets you set the default fixed / monospace
font for text delimited by DocBook tags <screen> </screen>? 

Something like \setfixedfont{} or \setmonofont{}, maybe, but I googled
a bit and looked at LaTeX cheat sheets but I did not find anything.

Thank you for your comments.

CJ


More information about the XeTeX mailing list