[pdftex] Getting error in \CJK at plane

Ross Moore ross at ics.mq.edu.au
Sun Nov 16 23:46:50 CET 2008


Hi Suman, Heiko, and others,

On 14/11/2008, at 6:29 PM, Suman_Tripathy wrote:

> And as always It Works..............
>
> Thanks.

> Subject: Re: [pdftex] Getting error in \CJK at plane
>
> On Fri, Nov 14, 2008 at 11:57:39AM +0530, Suman_Tripathy wrote:
>
>>

> \documentclass{article}
> \let\OrgShow\show
> \usepackage{ucs}
> \AtBeginDocument{\let\show\OrgShow}
> \usepackage[utf8x]{inputenc}
> \PreloadUnicodePage{0}
> \PreloadUnicodePage{33}
> \usepackage[unicode]{hyperref}[2006/08/01]
> \usepackage{CJK}
> \begin{document}
> \begin{CJK}{UTF8}{}
> Hi
> \begingroup
>   \inputencoding{utf8x}%
>   \pdfstringdef\ContentsString{Phrase Code = ^^c2^^a9^^e2^^84^^a2 }%
>   \pdfannot{%
>     /Subtype/Square%
>     /Border[0  0 .1]%
>     /C[0 0 1]%
>     /T(BoilerPlate)%
>     /Contents(\ContentsString)%
>   }%
> \endgroup
> \end{CJK}
> \end{document}
>
> This trick will not work for utf8.def, because of its global
> assignments.

The following also works, achieving (in this example) effectively
the same thing, but requiring an adjustment only within the preamble:

\documentclass{article}
\let\OrgShow\show
\usepackage{ucs}
\AtBeginDocument{\let\show\OrgShow}
\usepackage[utf8x]{inputenc}
\PreloadUnicodePage{0}
\PreloadUnicodePage{33}
\usepackage[unicode]{hyperref}[2006/08/01]
\usepackage{CJK}
\makeatletter
  \pdfstringdefDisableCommands{%
   \providecommand{\CJK at XX}{}%
   \providecommand{\CJK at XXX}{}%
   \renewcommand{\CJK at XX}[2]{\expandafter \unichar \expandafter
    {\csname u8-\number`#1-\string #2\endcsname}}%
   \renewcommand{\CJK at XXX}[3]{\expandafter \unichar \expandafter
    {\csname u8-\number`#1-\string #2\string #3\endcsname}}%
  }
\makeatother
\begin{document}
\begin{CJK}{UTF8}{}
Hi
\pdfstringdef\ContentsString{Phrase Code = ^^c2^^a9^^e2^^84^^a2 }
\pdfannot{%
   /Subtype/Square%
   /Border[0  0 .1]%
   /C[0 0 1]%
   /T(BoilerPlate)%
   /Contents(\ContentsString)%
}
\end{CJK}
\end{document}


There are advantages to being able to fix the problem without
changing the document body.
Furthermore, this  \pdfstringdefDisableCommands  approach is
independent of whether  CJK.sty  is actually loaded or not.


>
> Yours sincerely
>   Heiko <oberdiek at uni-freiburg.de>

Heiko, in studying the way the errors arose with the original coding,
I've discovered various aspects of the coding within  ucs.sty ,
CJK.sty  and  hyperref.sty  and their support files, that affects
the way that these packages work together. This can be improved.
I'll send another message about it, with more details, off-list.


Cheers,

	Ross

------------------------------------------------------------------------
Ross Moore                                       ross at maths.mq.edu.au
Mathematics Department                           office: E7A-419
Macquarie University                             tel: +61 (0)2 9850 8955
Sydney, Australia  2109                          fax: +61 (0)2 9850 8114
------------------------------------------------------------------------





More information about the pdftex mailing list