[XeTeX] Defining fonts for table columns in XeLaTeX

Ross Moore ross at ics.mq.edu.au
Mon Jun 20 01:37:45 CEST 2005


Hello Pavel,

On 20/06/2005, at 7:17 AM, Pavel Straňák wrote:

> I am trying to typeset a vocabulary with 3-column tables of  
> Chinese, Pinyin and Czech. For each column I want to use a diferent  
> font (in all tables). When I define custom columns (see below), I  
> end up with following error.
>
> Thanks for any advice.
> Pavel
>
>

That code seems to be making all (except one) of its calls to \fontspec
from within the table-cells.

This means that the macro-name, used to check whether a specific  
\font command
has been processed before, only has local scope, limited to that cell,
or to within the particular {tabular}.

Thus the \font command needs to be done again, every time, and you  
exhaust
the available \font registers.


>
> This is a begining of my file, there are basically just many such  
> tables and some texts:
>

Try the following ...

Just issue a command for each of your fonts, *outside* of the tables.
This effectively loads all the fonts with global scope, so that
they no longer need to be redefined for each usage.
(See below, after the \begin{document} command.)

>
>
>> %!TEX TS-program = xelatex
>> %!TEX encoding = UTF-8 Unicode
>> \documentclass[11pt, a4paper]{article}
>> \usepackage{fontspec, xunicode}
>> \defaultfontfeatures{Mapping=tex-text}
>> \usepackage[parfill]{parskip}
>> \usepackage{array}
>> \widowpenalty=10000
>> \clubpenalty=10000
>>
>> \title{我的漢語詞典}
>> \author{\textsc{Pavel Straňák}}
>> \date{}
>>
>> %%%%%%%%%%%%
>> \newcommand{\he}{\fontspec{STHeiti}}
>> \newcommand{\himaru}{\fontspec{Hiragino Maru Gothic Pro W4}}
>> \newcommand{\ka}{\fontspec{STKaiti}}
>> \newcommand{\so}{\fontspec{STSong}}
>> \newcommand{\fs}{\fontspec[Bold=STHeiti]{STFangsong}}
>> \newcommand{\mi}{\fontspec{Minion Pro}}
>> \newcommand{\gentium}{\fontspec{Gentium}}
>> \newcommand{\gentiumIt}{\fontspec{Gentium Italic}}
>> \newcommand{\lekce}[1]{\bigskip\section*{\he{#1}}}
>> \newcommand{\slov}{\subsection*{\he{生詞:}}}
>> \newcommand{\neuz}{\ensuremath{\sim}}
>>
>> \newcolumntype{H}{>{\fs}l}
>> \newcolumntype{P}{>{\gentiumIt}l}
>> %\newcolumntype{P}{>{\textit}l}
>> %\newcolumntype{C}{>{\textbf}p{10cm}}
>> \newcolumntype{C}{>{\gentium}p{10cm}}
>>
>>
>> %%%%%%%%%%%%
>>
>> \begin{document}
    \he \himaru \so \fs \mi \gentium \gentiumIt
>> \ka
>> \maketitle
>>
>> \lekce{第一課}
>> \slov
>> \begin{tabular}{HPC}
>> 你 & n\u{i} & ty\\
>> 好 & ha\u{o} & dobrý\\
>> 你好 & n\u{i} ha\u{o} & Dobrý den.\\
>> 再 & za\`{i} & brzy\\
>> 見(见) & jia\`{n} & (vidět)\\
>> 再見 & za\`{i} jia\`{n} & Na shledanou.\\
>> \end{tabular}
>> ...


  ...  Does this now solve your problem ?


>>
>>
>>


Best regards,

     Ross Moore


>
>
>
> _______________________________________________
> XeTeX mailing list
> postmaster at tug.org
> http://tug.org/mailman/listinfo/xetex
>
>



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




More information about the XeTeX mailing list