Talk:XeTeX - Old Content

From Wiki
Jump to navigation Jump to search

Did all that, thanks. Doesn't quite get me there, though. It sounds really good, because I don't typeset math, but fonts are always a problem with context in my experience, and having easy access to the Mac fonts would be excellent.

I have installed TeXLive from the CD-ROM. Onto this I installed the latest (dec 04) update of context. I downloaded the XeTeX package and ran the installer from that. Then followed the steps on this page, but when I run texexec --make -xtx en I get

! I can't read xetex.pool; bad path?

Of course, it does exist, at /usr/local/teTeX/texmf.local/web2c/xetex.pool

One difference I notice is that I have /usr/local/teTeX/share/texmf/context/config/texexec.ini (no textmf.local inside share/texmf). Anyone come across that so that the page can be updated with a workaround? It does amaze me that, with directory structure standardised and utilities to find files, paths seem to be a real problem with TeX. Something has not been thought through properly there. Alun ap Rhisiart.

Hi. I'm glad you like my efforts so far. I used to use TeXLive, and switched over to gwTeX because of these same problems with installing XeTeX. I encourage you to join the list at http://tug.org/mailman/listinfo/xetex so we can work out this problem with a larger audience/pool of experts. --Adam 12:49, 6 Jan 2005 (CET)

-translate-file=natural.tcx

May I remove the notice about removing -translate-file=natural.tcx? It seems that XeTeX already knows that it has to be ignored. --Mojca 20:11, 3 May 2006 (CEST)

Basic Installation (and formats)

you need to check that syst-xtx.tex(/texmf.local/tex/context/base/) contained the following lines

seems obsolete to me as well. May this be removed/replaced with something like "make sure that you have the latest ConTeXt"? --Mojca

My format files are located under

[PATH]/web2c/pdfetex/cont-en.fmt
[PATH]/web2c/xetex/cont-en.fmt

probably a matter of

TEXFORMATS = "\$TEXMFOS/web2c/{\$engine,}"

How recent is the information about .xfmt files? --Mojca 17:52, 30 May 2006 (CEST)

This should be moved to a separate page perhaps, but I have to test/adapt/comment it first. I just wanted to write it down before it gets lost (it answered two of my questions at the same time). This was posted to the XeTeX mailing list by Jonathan Kew. \reflectbox is \mirror in ConTeXt! --Mojca 13:58, 5 May 2006 (CEST)

Q: Is there a way to check the character existence from within XeTeX?

A:You can use \XeTeXcharglyph"018E to get the glyph ID of character U +018E in the current font; if the character isn't supported, this will return 0.

So you could use something along the lines of

\def\XeTeX{\leavevmode
  \setbox0=\hbox{X\lower.5ex
  \hbox{\kern-.15em
    \ifnum\XeTeXcharglyph"018E>0
      \char"018E
     else\ifdim\fontdimen1\font=0pt
      \reflectbox{E}%
    \else % rotation is about the origin, so we need to adjust positioning
      \XeTeXuseglyphmetrics=1
      \setbox0=\hbox{E}\dimen0=\ht0 \advance\dimen0 by \dp0
      \raise\dimen0\hbox{\rotatebox{180}{\box0}}%
    \fi\fi
  }\kern-.1667em \TeX}%
  \dp0=0pt \ht0=0pt \box0 }

which uses "018E if available, otherwise it uses \reflectbox for unslanted fonts, and \rotatebox for slanted.

Referencing fonts by filenames

(just a note from the XeTeX mailing list as a reminder for later)

in texmf.cnf:

OPENTYPEFONTS = .;$TEXMF/fonts/opentype//;c:/Resources/Fonts//

Then

\setromanfont{[KalligraphiaLTStd.otf]}


What follows should be put when we solve the trouble

Figures

What follows works, but the problem should be solved by fixing the sources very early:

Because of an actual bug, including figures in a document processed by XeTeX requires some cautions. The use of the usual \externalfigure can slow a lot the processing and raise some troubles. A possible strategy (which works only as a workaround as it breaks engine compatibility) is to replace \externalfigure with the low-level XeTeX specific command \XeTeXpicfile. For pdf inclusion one can use \XeTeXpdffile. As an example, consider this code:

\externalfigure[stuff/picTest] [height=.5\paperheight, width=\paperwidth]
\externalfigure[stuff/pdfTest] [height=.5\paperheight, width=\paperwidth]

it can be replaced by:

\XeTeXpicfile "stuff/picTest.png" height .5\paperheight width \paperwidth
\XeTeXpdffile "stuff/pdfTest.pdf" height .5\paperheight width \paperwidth

Encoding

This is not exact, at least at the moment (16/09/07), so it could be confusing:

XeTeX is able to handle UTF-8 or UTF-16 documents natively, without any interference or configuration from ConTeXt. If you do want ConTeXt to process UTF-8 characters specially, then you can activate it with \enableregime[utf]. Be aware that you are then limited by the named glyphs that exist in the unicode vector files (unic-0xx). However, it is generally desirable to enter UTF documents without any regime notated, and let XeTeX work its magic.

You don't have to encode documents in UTF, though. ConTeXt allows you to use the regime of your choice because of its use of named glyphs, so documents in latin-1 or even MacRoman encoding can be supported, given the proper \enableregime command. For characters out of reach of the given regime, you can use accents (like \'e) and/or named glyphs (\eacute).