Hi Wilfried,

On 07/08/2013, at 9:27 PM, Wilfred van Rooijen wrote:

> Hello all,
> 
> Polyglossia knows many languages, but also lacks support for many languages. 
> An example is Japanese. I have looked at it two times and concluded that 
> polyglossia cannot support Japanese. The reason in this case is simple: in 
> Japanese, "chapter 1" is written as 第1章, litterally "number 1 chapter", and 
> similar for all other "document divisions". The "standard" latex classes 
> encode the chapter numbering as "chapter_name_string chapter_number", and it 
> is not possible to change this to "prefix chapter_number chapter_name_string" 
> from polyglossia. It has to be done at the level of the documentclass (or 
> maybe a stylefile). But, bottom line, polyglossia cannot do it. I suspect 
> there are (potentially many) languages with similar problems. 

Surely this is not an insurmountable problem.
In (La)TeX it is certainly possible to achieve this split and reorder.
One just has to look rather carefully at what the document-class actually
does and devise a suitable patch.

For example, in  report.cls  and  book.cls  the \chaptername is placed
using a sequence
        \@chapapp \ \thechapter. 
(or \@chapapp\space\thechapter. )
where  \@chappapp  is a variable which expands to either 
\chaptername  or  \appendixname .

So redefine \@chapapp  to take 2 parameters:

  \def\@chapapp#1#2.{\@numapp#1#2#1\chaptername.} 

where  \@numapp --> 第  and  \chaptername --> 章

Similarly patch  \appendix as follows:

\renewcommand\appendix{\par
  \setcounter{chapter}{0}%
  \setcounter{section}{0}%
  \gdef\@chapapp##1##2.{\@numapp##1##2##1\appendixname.}%
  \gdef\thechapter{\@Alph\c@chapter}}

These redefinitions should be made using \AtBeginDocument{...}
and only done subject to a conditional according to what is 
chosen as the main document language. 

Such patching could be added to Polyglossia or, as you note,
done within a separate style file.


Patching other levels of section-heading seem not to be so straight-forward,
as there is no analog of the  \@chapapp  variable macro.
But at least in principle, there should be a way to do it, according
to what you actually need with Japanese.

On the other hand, if the  hyperref  package is loaded, such that  nameref.sty
is used, then there is a macro  \Sectionformat  that is a convenient place where
patches can be applied to the way the actual section heading is put onto the 
page.
Used as:  \Sectionformat{#8}{#2}
  where  #8 = the mandatory argument to  \section{...}, \paragraph{...}, etc.
  and  #2 = sectioning-counter name  e.g. 'section', 'paragraph', etc.
and with a default definition of  \providecommand\Sectionformat[2]{#1} ,
this is a macro just begging to be redefined according to need.


> 
> As far as code2000 is concerned, indeed, it supports a tremendous amount of 
> scripts, but it is __not__ intended to typeset entire documents. It lacks 
> boldface, slanted, italic, etc. In short, it is not a complete font at the 
> level of "professional" typesetting. 
> 
> Code2000 was developed (IIRC Netscape and Bitstream) for internet browsers to 
> be able to support a wide range of scripts at the level of being able to put 
> something on the screen even if the system does not have the specific fonts 
> for (uncommon) scripts. As such, it was never intended for "real" typesetting.
> 
> Cheers,
> Wilfred


Hope this helps,

        Ross

------------------------------------------------------------------------
Ross Moore                                       [email protected] 
Mathematics Department                           office: E7A-206      
Macquarie University                             tel: +61 (0)2 9850 8955
Sydney, Australia  2109                          fax: +61 (0)2 9850 8114
------------------------------------------------------------------------

<<inline: logo.png>>



--------------------------------------------------
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex

Reply via email to