XeTeXPDF graphics and xelatex

Information and discussion about XeTeX, an alternative for pdfTeX based on e-Tex
Post Reply
meznaric
Posts: 10
Joined: Mon Aug 10, 2009 7:17 pm

PDF graphics and xelatex

Post by meznaric »

I was wondering why when I include a PDF graphic in the document it simply shows up as empty space whereas in pdflatex it works as expected? Any ideas?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

PDF graphics and xelatex

Post by gmedina »

Hi,

can you please post a minimal working example that allows us to reproduce the odd behaviour mentioned? Posting the actual image as an attachment would be ideal.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
meznaric
Posts: 10
Joined: Mon Aug 10, 2009 7:17 pm

PDF graphics and xelatex

Post by meznaric »

Sure, here goes the code:

Code: Select all


\documentclass[a4paper, 11pt]{article}

\usepackage{graphicx}
\usepackage[no-math]{fontspec}
\usepackage{xunicode}
\usepackage{xltxtra}

\begin{document}

\begin{figure}
 \centering
 \includegraphics{UsefulEntanglementGraph.pdf}
 \caption{The graph showing useful entanglement $E_u$ as a function of the probability of erroneous detection $p$.}
 \label{fig:UEGraph}
\end{figure}

\end{document}
I have tried the above with \usepackage[xetex]{graphicx} as well with no success. The image in question is attached.
Attachments
UsefulEntanglementGraph.pdf
The file that is not displayed.
(4.25 KiB) Downloaded 721 times
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Re: PDF graphics and xelatex

Post by gmedina »

Hi,

I did a test with the code and image provided and everything went OK (I attach the resulting pdf file). Do you get any warnings/errors? after compilation of your test code?
Attachments
test.pdf
(12.07 KiB) Downloaded 870 times
1,1,2,3,5,8,13,21,34,55,89,144,233,...
meznaric
Posts: 10
Joined: Mon Aug 10, 2009 7:17 pm

Re: PDF graphics and xelatex

Post by meznaric »

Hmmm, this is really strange. I get no errors or warnings when I compile the file and the result is as attached.

I am using the programme Kile in Linux to compile the above file with the TeXLive distribution that comes with Fedora 10. I had to set up kile manually to use xelatex and here are the settings I used:

command: xelatex
options: -output-driver=xdvipdfmx -papersize="a4" %S.tex

Are you using any options when you compile the file? Maybe the command line options above could be at fault?

Edit: What I just noticed is that another picture, that is also in PDF format, appears like normal, in the same document where the PDF graph does not appear - I am now attaching a document that shows this effect. Another important thing that I discovered is that Fedora 10 is using xetex version 0.996.
Attachments
test2.pdf
Here the Oxford logo is displayed like normal, but the graph is not displayed.
(46.44 KiB) Downloaded 660 times
test.pdf
The graph is not displayed.
(8.23 KiB) Downloaded 590 times
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

PDF graphics and xelatex

Post by gmedina »

meznaric wrote:...
command: xelatex
options: -output-driver=xdvipdfmx -papersize="a4" %S.tex

Are you using any options when you compile the file? Maybe the command line options above could be at fault?
I compiled directly from the command line using

Code: Select all

xelatex test.tex
I think that the driver option is not necessary for this particular code.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
meznaric
Posts: 10
Joined: Mon Aug 10, 2009 7:17 pm

Re: PDF graphics and xelatex

Post by meznaric »

Yes, I tried that as well and it didn't work any better.

When I first installed xetex I had some problems with mathematical fonts and so I installed the newest fontspec package from CTAN (which fixed the problem). Could this package now be causing the graphics problem? A friend of mine, on Fedora 11, has done the same thing and seems to be suffering from the same PDF problem.
meznaric
Posts: 10
Joined: Mon Aug 10, 2009 7:17 pm

Re: PDF graphics and xelatex

Post by meznaric »

Just to update anyone who might be reading this, I have tested the same code in Ubuntu and it works perfectly. It seems that Fedora might have a buggy distribution of TeXLive ...
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: PDF graphics and xelatex

Post by frabjous »

Did you see if your Fedora and your Ubuntu are using the same versions of xelatex?

Open a console and type in:

xelatex -v

to see what version it's using. I'd be interesting in learning which version(s) are working for you and which aren't.
kwasposer
Posts: 1
Joined: Tue Oct 25, 2011 7:06 pm

PDF graphics and xelatex

Post by kwasposer »

Did you solve this problem? My problem has something to do with the kind of PDF file. I just installed the TeX Live distribution on my Windows. But still having the problem that using \includegraphics{*.pdf} is producing an empty picture frame without error or warning. Like newer version it doesn't except, and the picture keeps plain. Is there any other solution?

Edit: Solved Problem with pdfcrop.

Code: Select all

pdfcrop file.pdf

Kwas
Attachments
figureminbsp.zip
(178.61 KiB) Downloaded 407 times
Post Reply