[XeTeX] Cite Devanagari in BibTeX

Ross Moore ross at ics.mq.edu.au
Fri Feb 15 23:48:44 CET 2008


Hi Sven,

On 16/02/2008, at 12:50 AM, Sven Siegmund wrote:

> The only work-around I have found until now is to manually edit the
> *.bbl file before finally xelatexing it to pdf. (Thanks to this post:
> http://www.esm.psu.edu/mac-tex/MacOSX-TeX-Digests/2004/MacOSX- 
> TeX_Digest_07-29-04.html)
>
> So the procedure that worked with my ffiilles was:
>
> xelatex cite
> bibtex cite
> xelatex cite
> ------
> manually edit cite.bbl and replace {\em  
> उद्दिष्टः  
> समाहितचित्तस्य योगः
> । कथं  
> व्युत्थितचित्तोऽपि} by {\arial  
> उद्दिष्टः  
> समाहितचित्तस्य योगः ।
> कथं व्युत्थितचित्तोऽपि}.
> ------
> xelatex cite
>
> So maybe there is a way how I could modify the BibTeX macros to make
> them recognize devanagari in the bibliography file and tag them
> differently.

The approach that I would use is to hack at the \bibitem command.

The first argument of \bibitem is the citation key, so I would
examine that key and compare it with a list of the keys that
require the different font. When a match is found, simply
make a rebinding:   \let\em\arial .
This would need to take place within a grouping that restricts
the scope of the change to just a single bib-item.
  (or see the coding below, where extra scoping is not needed)

If any of the bib-items uses \em in more than one place, then
the definition of \arial will need to be a bit more complicated
than simply a font-switch.

Alternatively, you could have TeX coding as follows:

   \let\realem\em
   \def\resetemphasis{\let\em\realem}
   \def\imposearial{let\em\usearial}
   \def\usearial{\aftergroup\resetemphasis\arial}

where you simply call  \imposearial  whenever the modified
  \bibitem  command detects the need to impose Arial for the
current entry.

Of course you'll need decent TeX programming skills to
redefine \bibitem appropriately, unless there is already
a LaTeX package available that adopts this approach.
This will include devising a way to indicate the bib-items
that need the special treatment.

Is there such a package already?


The reason for doing it this way, rather than putting \arial
commands into the .bib file, is that in future you may need
the same bibliography entries in a different paper, or other
publication, but decide not to use the Arial font.

Or you may share your .bib files with others, who don't
require use of \arial . Then you or they will need to know
about how the .bib file was changed, and undo it all.


>
> S.

Hope this helps,

	Ross


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




More information about the XeTeX mailing list