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

Jean-Christophe Helary fusion at mx6.tiki.ne.jp
Sat Jan 3 02:10:51 CET 2009


On samedi 03 janv. 09, at 00:44, Peter Dyballa wrote:

> 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 ...):

Peter,

Your code did not work because Texshop complained about not having the  
"native" font Lucida Bright etc.

I removed that part and pressed the typeset button and your one liner  
appeared but without the 2 kanji.

(Off course, I used the Texshop header you provided, with a file saved  
in UTF-8).

I tried the code present in the MacTex package Readme file, but that  
failed too to properly display French.

So, the question is, is there a tutorial somewhere for Texshop/Xetex/ 
French so that I can first test a few lines a proceed, with what  
should not such a hard typesetting job ?

Jean-Christophe Helary

> %% -*- mode: LaTeX; coding: utf-8; -*-
> %
> %	Time-stamp: <2009-01-02 16:29:52 pete>
> %
> \documentclass[a4paper,11pt]{article}
> \usepackage{ifpdf,ifxetex,graphicx}
> %\usepackage[ngerman]{babel}
> \usepackage[landscape,nohead,ignoreheadfoot,nomarginpar]{geometry}
> \usepackage[svgnames]{xcolor}
> \ifxetex
>     \immediate\write16{==We're with XeTeX==}
>  \usepackage[no-math]{fontspec}
>  \usepackage{xltxtra,xunicode}
>  \defaultfontfeatures{Mapping=tex-text}
> %  \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!
> \else
>  \immediate\write16{==We're without XeTeX==}
>  \ifpdf
>    \immediate\write16{==\jobname: Bonjour, PDF!==}
>    \usepackage{cmap}
> %    \DeclareGraphicsExtensions{.pdf,.png,.jpeg}			% in pdfTeX  
> allowed graphics formats
>    \usepackage[activate={true,nocompatibility}]{microtype}
> %    \usepackage[protrusion=true,expansion=true]{microtype}
>    \usepackage{lucida}
>    \usepackage{hyperref}
>    \makeatletter							% following code needs hyperref
>    \@ifundefined{pdffilemoddate}{%
>       \PackageError{sourcetime}{%
>         pdfTeX >= 1.30.0 required%
>       }%
>       \let\pdffilemoddate\@gobble
>    }{}%
>    \newcommand*{\SourceFile}[1]{%
>      \edef\@SourceFileDate{\pdffilemoddate{#1}}%
>      % empty in case of errors, but don't harm in next comparison
>      \ifnum\pdfstrcmp{\@SourceFileDate}{\@CurrentSourceFileDate}>0 %
>        \let\@CurrentSourceFileDate\@SourceFileDate
>        \expandafter\@ParseDate\@SourceFileDate\@nil
>        \hypersetup{%
>          pdfcreationdate={\@SourceFileDate},%
>          pdfmoddate={\@SourceFileDate}%
>        }%
>        \PackageInfo{sourcetime}{%
>          Using file `#1'%
>        }%
>      \fi
>    }
>    \newcommand*{\@CurrentSourceFileDate}{}
>    \expandafter\def\expandafter\@ParseDate 
> \detokenize{D:}#1#2#3#4#5#6#7#8{%
>      \year=#1#2#3#4\relax
>      \month=#5#6\relax
>      \day=#7#8\relax
>      \@ParseTime
>    }
>    \def\@ParseTime #1#2#3#4#5\@nil{%
>      \time=\numexpr #1#2 * 60 + #3#4\relax
>    }
>    \makeatother
>    \SourceFile{\jobname.tex}
>    \pdfinfo
>      { % /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)
>    }
>  \else
>    \immediate\write16{==¡Hola \jobname: DVI!==}
> %    \DeclareGraphicsExtensions{.ps,.eps}				% in dvips allowed  
> graphics formats
>    \usepackage[protrusion=true,expansion=false]{microtype}
>    \usepackage{times}
>  \fi
>  \usepackage[utf8x]{inputenc}
> %  \usepackage[utf8]{inputenc}
>  \usepackage[full]{textcomp}
> %  \usepackage[LUC,T1]{fontenc}
>  \usepackage[T1]{fontenc}						% other font encodings: T2A, T2B,  
> T2C, X2, LCY, OT2 (LY1, T5)
>  %%%%\renewcommand{\sfdefault}{pag}
>  %%%%\renewcommand{\rmdefault}{ppl}
>  %%%%\renewcommand{\ttdefault}{pcr}
>  \makeatletter
>  \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 ...
>    \leavevmode
>    \smash{%
>      X\lower\xxt at lower@e
>      \hbox{\kern\xxt at kern@eX
>        \setbox0=\hbox{E}\dimen0=\ht0\advance\dimen0by\dp0%
>        \reflectbox{E}%
>     }\kern\xxt at kern@Te\TeX}}%
>  \DeclareRobustCommand\XeLaTeX{%
>    \leavevmode
>    \smash{%
>      X\lower\xxt at lower@e
>      \hbox{\kern\xxt at kern@eX
>        \setbox0=\hbox{E}\dimen0=\ht0\advance\dimen0by\dp0\relax
>        \reflectbox{E}%
>    }\kern\xxt at kern@eL\LaTeX}}
>  \TeX at logo@spacing{-0.15em}{-0.125em}{0.5ex}{-0.36em}{-0.12em} 
> {-0.13em}
>  \makeatother
> \fi
>
>
> \begin{document}
>
> Kanbun (漢文) and French with a good font ...
>
> \end{document}
>
> %%% 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  
> better:
>
> 	%%!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.
>
> --
> Greetings
>
>  Pete
>
> Debugging? Klingons do not debug. Our software does not coddle the  
> weak.
>
> ----------- Please Consult the Following Before Posting -----------
> TeX FAQ: http://www.tex.ac.uk/faq
> List Reminders and Etiquette: http://www.esm.psu.edu/mac-tex/list/
> List Archive: http://tug.org/pipermail/macostex-archives/
> TeX on Mac OS X Website: http://mactex-wiki.tug.org/
> List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex
>




More information about the macostex-archives mailing list