1

How XeLaTeX can be used to include pdf_tex graphics files produced from svg files including amstex code and exported with Inkscape (v48.2) with the PADF+LaTeX option? (the problem occurs independently of the pdf_tex file chosen). I use TeXShop v2.47 and MacTeX and TeX-Live 2013.

A MWE:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% !TEX TS-program = XeLaTeX   
% !TEX encoding = MacOSRoman    
%%%%%%%%%%%%% PREAMBLE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
\documentclass[aps,pra,12pt]{revtex4-1}   
\usepackage[no-sscript]{xltxtra}    
\usepackage{amssymb,amsmath,amscd,stmaryrd}
\usepackage{amsthm}
\usepackage[applemac]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern,textcomp,url}
\usepackage{color}
\usepackage{graphicx} 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\section{Introduction}

See Figure. 

\begin{figure}[ht] 
\centering 
\def\svgwidth{\columnwidth} 
\input{figure.pdf_tex}
\end{figure}
\end{document}

I obtain the following indications when compiling the tex file:

................
(/usr/local/texlive/2013/texmf-dist/tex/latex/stmaryrd/Ustmry.fd))
No file test.bbl.
[1]
./test.tex:35: Missing number, treated as zero.
<to be read again> 
                   \aftergroup 
l.35 \end{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

@DavidCarlisle

Here is again the tex file:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% !TEX encoding = UTF-8 Unicode
% !TEX TS-program = XeLaTeX
\documentclass[aps,pra,12pt]{revtex4-1} 
\usepackage[frenchb]{babel} 
%\usepackage{xltxtra} 
%\usepackage{polyglossia} 
%\setmainlanguage{english} 
%\setotherlanguage{french} 
\usepackage{amsmath,amssymb,amsmath,amscd} 
\usepackage{lmodern,textcomp,url} 
\usepackage{color} 
\usepackage{graphicx} 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}
\section{Introduction}
See Figure. 
\begin{figure}[ht] 
\centering 
\def\svgwidth{.75\columnwidth} 
\input{Figure.pdf_tex}
\end{figure}
\end{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

It works fine. But during the compilation the following message is given (the content of the input line 26 is the \begin{document} command):

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Package frenchb.ldf Warning: Add \usepackage{xltxtra} to the
(frenchb.ldf)                preamble of your document, on input line 26.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

But, then, if I try to include this package in the tex file, there is a clash with the following indication:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 (/usr/local/texlive/2013/texmf-dist/tex/latex/amsfonts/umsb.fd))
 No file test.bbl.
[1]    
./test.tex:37: Missing number, treated as zero.    
<to be read again> 
                  \aftergroup 
   l.37 \end{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Using the package polyglossia alone (without xltxtra and babel as well) does not work. So?

8
  • Which line in the file is actually line 35? Perhaps it is the underscore in the file name? See tex.stackexchange.com/questions/69142/… for information on how you can include/input files whose name contains an underscore.
    – DCTLib
    Nov 21, 2013 at 13:28
  • @Ruedi The line 35 contains only the \end{document} command. It cannot be due to the underscore in the file name since the file works correctly but only without the xltxtra package. But this package is required if I want to use babel with the english or frenchb option for instance (this xltxtra package must be added as indicated during the compilation when using the babel package; whatever is the option).
    – Roy
    Nov 21, 2013 at 14:00
  • Please edit the question to include a copy of figure.pdf_tex but never use inputenc with xetex or luatex (and using fontenc is pretty rare too, normally people use xetex because they want to use system fonts with fontspec) Nov 21, 2013 at 14:22
  • Note your declarations at the top are incompatible % !TEX TS-program = XeLaTeX and % !TEX encoding = MacOSRoman You can not use 8bit encodings such as MacOSRoman with xetex you must use utf-8 Unicode encoding. Nov 21, 2013 at 16:20
  • @DavidCarlisle I corrected this encoding with the command % !TEX TS-program = UTF-8 Unicode but the problem remains completely. It seems to be due to "interactions" between babel and xltxtra. Using \usepackage[english]{babel} alone works fine whereas \usepackage[english]{babel} \usepackage{xltxtra} does not.
    – Roy
    Nov 21, 2013 at 16:47

1 Answer 1

5

As noted in comments your input is mixing old style font and encoding handling with xetex. In particular xltxtra loads fontspec (the usual way to specify fonts with xetex) and that appears to be incompatible with revtex. Your example as posted can not be used but this cut down example generates the same error.

\documentclass[aps,pra,12pt]{revtex4-1}   
%\usepackage[no-sscript]{xltxtra}    
\usepackage{fontspec}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
See Figure. 

\begin{figure}[ht] 
\end{figure}
\end{document}

So it seems that you want to either use revtex with pdftex or use a different class with xetex.

! Missing number, treated as zero.
<to be read again> 
                   \aftergroup 
l.12 \end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .