[XeTeX] xecjk and listings packages incompatible?

Daniel Greenhoe dgreenhoe at gmail.com
Tue Jun 9 07:29:03 CEST 2015


When I try to use the xecjk and listings packages together, I get
error messages that include the following:

! LaTeX error: "kernel/message-already-defined"
! Message 'Require-XeTeX' for module 'xeCJK' already defined.
! Emergency stop.
| This is a coding error.
|
| LaTeX was asked to define a new message called 'Require-XeTeX' by the module
| 'xeCJK': this message already exists.

(end error messages).

Switching the included order of the packages does not correct the problem.

Here is a somewhat minimal example:

\documentclass{article}
\usepackage{listings}
\usepackage{xecjk}
%\usepackage{listings}
\begin{document}%
\thispagestyle{empty}%
\Huge%
一二三四五六七八九十。
一二三四五六七八九十。
一二三四五六七八九十。
一二三四五六七八九十。
一二三四五六七八九十。
\end{document}%

A test source file and log file is attached. In my case, I typed
  xelatex test
in a Windows 7 command prompt.

If both "\usepackage{listings}" lines are commented out, everything
seems to work fine. See attached test.pdf for compilation without
listings package.

Many many thanks in advance,
Dan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.tex
Type: application/x-tex
Size: 532 bytes
Desc: not available
URL: <http://tug.org/pipermail/xetex/attachments/20150609/603c701c/attachment-0001.tex>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.log
Type: application/octet-stream
Size: 35607 bytes
Desc: not available
URL: <http://tug.org/pipermail/xetex/attachments/20150609/603c701c/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.pdf
Type: application/pdf
Size: 3415 bytes
Desc: not available
URL: <http://tug.org/pipermail/xetex/attachments/20150609/603c701c/attachment-0001.pdf>


More information about the XeTeX mailing list