[XeTeX] Issue with CJK in pdf build
Jonathan Kew
jfkthame at googlemail.com
Wed Nov 18 22:31:17 CET 2009
On 18 Nov 2009, at 21:10, Chris Jones wrote:
>> Luckily, if you can include a style file, then things become very
>> easy,
>> so let's just make one: make a file called "mystyle.sty", and in that
>> file stick the following text:
>>
>> \ProvidesPackage{mystuff}
>> \usePackage{fontspec}
>> \setmainfont{The Font You Want Used}
>> \endinput
>
There is unfortunately a typo here... \usePackage is not a valid LaTeX
command. It should be \usepackage, hence the errors seen when you try
to run....
>
> $ dblatex -V -d --texstyle ~/.dblatex/mystyle/latex/mytexstyle.sty
> unicode.xml
>
> ends with a catastrophic error - /tmp/tmp..../unicode_tmp.log and
> DocBook input unicode.xml attached to this message.
....and in particular, the first error message in your log:
> Package: mystyle
> ! Undefined control sequence.
> <recently read> \usePackage
>
> l.5 \usePackage
> {fontspec}
....though I believe \RequirePackage would be a better choice, in case
fontspec has already been loaded.
In fact, earlier in the log we see that the fontspec package *was*
already loaded; it looks like your dblatex job is loading fontspec and
then using it to select DejaVu fonts. So there's no need to load
fontspec here, you can simply reset the font with \setmainfont{......}
and you should be good to go.
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. Maybe you can
locate the default dblatex style (which presumably includes the
command \setmainfont{DejaVu Serif}, etc) and model yours on that.
JK
More information about the XeTeX
mailing list