[XeTeX] help with pgf xelatex issue

Wilfred van Rooijen wvanrooijen at yahoo.com
Tue Jan 19 00:29:05 CET 2016


I also a non-expert.
There are a multitude of so-called TeX-engines: TeX, eTeX, vTeX, pdfTeX, xeTeX, pTeX, luaTeX, ConTeXt, and probably several others. TeX is the original work of Donald Knuth, the other engines are extensions / improvements of the original TeX. Improvements can be better handling of non-ASCII characters, right-to-left typesetting, support for CJK (Chinese, Japanese, Korean), etc.
The original intention of Knuth was to make the TeX output "device independent" (dvi) so that each user could choose the best way to generate the final typesetting. So we have the traditional DVI to PS route (.tex -> .dvi (dvips) -> .ps). You can produce PDF from the PS (ps2pf) or directly from the DVI (dvipdfm(x)).

There are some problems with the traditional engines, for example "traditional" TeX does not support inclusion of PDF images or JPG images. Also there are problems for creating special effects (such as hyperlinks) which cannot always properly be propagated through dvips (ps specials).
So the "newer" TeX engines produce PDF directly (pdfTeX) or use a newer "device independent" format (xeTeX uses xdv which is immediately translated to PDF).
Into all this then comes PGF which is basically a 2D drawing program that relies heavily on all kinds of behind-the-scenes trickery to put all the lines on the paper. I don't know if PGF is supposed to work with the "traditional" DVI route, but even if you produce PDF directly (pdfTeX) it is not so straightforward. If you go through xeTeX you may stumble into issues with the XDV format, as apparently you did.
As far as I know the "PDF version" is not decided by the TeX-engine but by the post-processing software, except for pdfTeX because it produces "native PDF".
Despite modern improvements to TeX sometimes there still are tasks for which one TeX-engine is simply better than the other. If you have a problem with PGF and xeTeX, you could consider to make the figure with pdfTeX or LuaTeX and then include the PDF in your document. It is a "quick and dirty" workaround, not a solution....
Wilfred





 

    On Tuesday, January 19, 2016 4:30 AM, Stefan Müller <stefan.mueller at fu-berlin.de> wrote:
 
 

 Dear Akira,

Thanks a lot! This works for the examples I tried and is very helpful!

Some questions from the non-expert. Does the definition of pdftexversion
mean that every texinstallation comes with several versions installed?
Also with several drivers?

Very interesting.

Are there ways to fix the problem in the more recent drivers or is this
too difficult/marginal?

Thanks for everything!

Greetings from Berlin

    Stefan

PS: I had a bounty for a quick fix on stackexchange, but nobody wanted
it. If you do like bounties, I could set one up again.

    St.

Am 15.01.16 um 00:48 schrieb Akira Kakuto:
> Dear Stefan,
> 
>> I filed a bug report, but nothing happend:
>> http://sourceforge.net/p/pgf/bugs/354/
> 
> The issue is related to pgf drivers, pgfsys-xetex.def and
> pgfsys-dvipdfmx.def which is called by the former.
> 
> Your example works if you use the other driver: pgfsys-dvipdfm.def,
> see below. However, don't expect that the way is always ok.
> 
> %
> % xelatex
> %
> \documentclass{article}
> %deceive the driver
> \def\pdftexversion{140}
> %use the old driver for dvipdfm
> \def\pgfsysdriver{pgfsys-dvipdfm.def}
> \usepackage{tikz}
> \usetikzlibrary{tikzmark}
> 
> \begin{document}
> 
> x\pgfmark{tA}some text \pgfmark{tB} some text
> \begin{tikzpicture}[remember picture]
> \draw (0,0)node (A){A} rectangle (1,1)node (B){B};
> \end{tikzpicture}
> \begin{tikzpicture}[remember picture]
> \draw (0,0)node {\pgfmark{nA}} rectangle (1,1)node {\pgfmark{nB}};
> \end{tikzpicture}
> 
> \vspace{3cm}\centering
> \begin{tikzpicture}[overlay,remember picture]
> \draw[red,->] (0,0)--(pic cs:tA) (0,0)--(pic cs:tB);
> \draw[blue,->](0,0)--(pic cs:nA) (0,0)--(pic cs:nB); %nB faulty
> \draw[green,->](0,0)--(A) (0,0)--(B);
> \end{tikzpicture}
> 
> \end{document}
> Best,
> Akira
> 
> 
> 
> --------------------------------------------------
> Subscriptions, Archive, and List information, etc.:
>  http://tug.org/mailman/listinfo/xetex


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


 
  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/xetex/attachments/20160118/34f1f787/attachment-0001.html>


More information about the XeTeX mailing list