# [pdftex] pdfbookmark problems with auto-greek or iso-8859-7

Werner LEMBERG wl at gnu.org
Sat Jun 28 08:27:19 CEST 2008

> >> Unfortunately, it hasn't worked as I hoped.  The Latin stuff (UV
> >> Block ...) gets written in Greek letters :-( .
> >
> > Yes.  You have to explicitly switch languages, probably using
> > \foreignlanguage{}{}.  Remember that in fonts which use the LGR
> > encoding, Greek letters are positioned where you normally find
> > Roman ones.
>
> Well but this is exactly my problem. I already recognized Babel's
> \textgreek and \textlatin switches and they work well, but I can't
> use them !
>
> I need to mix Latin and Greek letters within one stream because I
> get the data as Unicode from a Database and there a Unicode "a" is
> simply a Latin "a" and not an Greek alpha (or whatever it is in
> Greek ^^).

What about using a filter before calling TeX to tag strings of Greek
character with \textgreek?  I don't see a solution within TeX while
using the LGR encoding.

In general, using different scripts in TeX without tagging is always
problematic.  You could try the CJK environment (part of my CJK
package) with UTF8 encoding which maps Unicode to subfonts -- your
example would work with fonts like cyberbit.ttf out of the box -- but
this has serious disadvantages because there is no kerning between
various subfonts (just think of accented Latin-1 characters which are
in subfont 01, while ASCII characters are in subfont 00).  In case you
are restricted to modern Greek, only glyphs from a single subfont are
used, so it may be an adequate solution.

I've attached the UTF8.tex sample file from the CJK package.

Werner
-------------- next part --------------
% This is the file UTF8.tex of the CJK package
%   for testing UTF 8 encoding.
%
% written by Werner Lemberg <wl at gnu.org>
%
% Version 4.8.0 (22-May-2008)

\documentclass[12pt]{article}

\usepackage{CJK}
\usepackage[T1]{fontenc}

% we want the Unicode font for normal text also
\DeclareFontFamily{T1}{song}{}
\DeclareFontShape{T1}{song}{m}{n}{<-> cyberb00}{}
\renewcommand\rmdefault{song}

\begin{document}

\begin{CJK}{UTF8}{song}

\noindent Hello World!

\noindent ???????? ?????

\CJKnospace
\noindent ????? ??

\end{CJK}

\end{document}

%%% Local Variables:
%%% coding: utf-8
%%% mode: latex
%%% TeX-master: t
%%% End: