Re: [OS X TeX] Kanbun (漢文) and French...

Peter Dyballa Peter_Dyballa at Web.DE
Fri Jan 2 10:44:09 EST 2009

Am 02.01.2009 um 15:28 schrieb Jean-Christophe Helary:

> I did visit the site, installed xetex with Fink and tried it with a  
> few (French) paragraphs or my document, but the resulting PDF did  
> not display any French accent.

Because you did not adapt your document to XeTeX, did not, for  
example, use fontspec in case it's LaTeX based. And it's also good to  
use an UTF encoding for the document's contents.

I sent a few times a preamble that allows to typeset a UTF-8 encoded  
LaTeX document with (some) LaTeX (either producing DVI or PDF) and  
XeLaTeX. Could be it happened on the XeTeX list, so here it is on the  
more general list (since it's not allowed to attach files I have to  
paste the sometimes a bit long lines ...):

%% -*- mode: LaTeX; coding: utf-8; -*-
%	Time-stamp: <2009-01-02 16:29:52 pete>
      \immediate\write16{==We're with XeTeX==}
%  \setmainfont{Lucida Bright}
   \setromanfont{Lucida Bright}
   \setsansfont{Lucida Sans}
   \setmonofont{Lucida Sans Typewriter}
   \newfontface\textsl[RawFeature={slant=0.194}]{Lucida Bright}
%    \DeclareGraphicsExtensions{.pdf,.png,.jpeg,.bmp,.eps}		% formats  
with xdvipdfmx
%    \DeclareGraphicsExtensions{.mac,.pict,.psd,.sgi,.tga,.tif,.gif}	 
% additionally with xdv2pdf, less eps!
   \immediate\write16{==We're without XeTeX==}
     \immediate\write16{==\jobname: Bonjour, PDF!==}
%    \DeclareGraphicsExtensions{.pdf,.png,.jpeg}			% in pdfTeX  
allowed graphics formats
%    \usepackage[protrusion=true,expansion=true]{microtype}
     \makeatletter							% following code needs hyperref
          pdfTeX >= 1.30.0 required%
       % empty in case of errors, but don't harm in next comparison
       \ifnum\pdfstrcmp{\@SourceFileDate}{\@CurrentSourceFileDate}>0 %
           Using file `#1'%
     \def\@ParseTime #1#2#3#4#5\@nil{%
       \time=\numexpr #1#2 * 60 + #3#4\relax
       { % /ModDate	(\time)
	/Title		(An UTF-8 LaTeX Example)
	/Author		(Peter Dyballa)
	/Subject	(ISO Latin-1 and ISO Latin-9 characters)
	/Keywords	(LaTeX, UTF8, ISO, Latin-1, Latin-2, Latin-9, ISO 8859, LICR)
     \immediate\write16{==¡Hola \jobname: DVI!==}
%    \DeclareGraphicsExtensions{.ps,.eps}				% in dvips allowed  
graphics formats
%  \usepackage[utf8]{inputenc}
%  \usepackage[LUC,T1]{fontenc}
   \usepackage[T1]{fontenc}						% other font encodings: T2A, T2B,  
T2C, X2, LCY, OT2 (LY1, T5)
   \newcommand*\TeX at logo@spacing[6]{%
     \def\xxt at kern@Te{#1}%
     \def\xxt at kern@eX{#2}%
     \def\xxt at lower@e{#3}%
     \def\xxt at kern@La{#4}%
     \def\xxt at kern@aT{#5}%
     \def\xxt at kern@eL{#6}%
   \DeclareRobustCommand\XeTeX{%						make a bit of XeTeX available  
outside ...
       X\lower\xxt at lower@e
       \hbox{\kern\xxt at kern@eX
      }\kern\xxt at kern@Te\TeX}}%
       X\lower\xxt at lower@e
       \hbox{\kern\xxt at kern@eX
     }\kern\xxt at kern@eL\LaTeX}}
   \TeX at logo@spacing{-0.15em}{-0.125em}{0.5ex}{-0.36em}{-0.12em} 


Kanbun (漢文) and French with a good font ...


%%% Local Variables:
%%% mode: latex
%%% fill-column: 99999
%%% TeX-master: t
%%% End:

It's meant to be used in GNU Emacs. In TeXShop this header would be  

	%%!TEX TS-program = xelatex
	%%!TEX encoding = UTF-8 Unicode

and no footer needed.

Don't forget to customise for your system's fonts! Babel or  
polyglossia can be used for hyphenation. Since your Japanese texts  
are so short you don't other Japanese support then choosing the  
proper font. Take care that you use up-to-date TeX Live and XeTeX in  
Fink! Maybe you need to switch to unstable packages.



Debugging? Klingons do not debug. Our software does not coddle the weak.

More information about the MacOSX-TeX mailing list