如何使用 XeLaTeX 来包含由 svg 文件(包括 amstex 代码)生成的 pdf_tex 图形文件,并使用 PADF+LaTeX 选项使用 Inkscape (v48.2) 导出?(问题与所选的 pdf_tex 文件无关)。我使用 TeXShop v2.47 和 MacTeX 以及 TeX-Live 2013。
一位 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}
我在编译 tex 文件时得到以下提示:
................
(/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
以下又是 tex 文件:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% !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}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
一切正常。但是在编译过程中出现以下消息(输入第 26 行的内容是 \begin{document} 命令):
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Package frenchb.ldf Warning: Add \usepackage{xltxtra} to the
(frenchb.ldf) preamble of your document, on input line 26.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
但是,如果我尝试将该包包含在 tex 文件中,则会发生冲突,并出现以下指示:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
(/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}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
单独使用 polyglossia 包(不使用 xltxtra 和 babel)不起作用。那么?
答案1
正如评论中所述,您的输入混合了旧式字体和使用 xetex 的编码处理。特别是 xltxtra 加载 fontspec(使用 xetex 指定字体的常用方法),这似乎与 revtex 不兼容。您发布的示例无法使用,但这个简化的示例会产生相同的错误。
\documentclass[aps,pra,12pt]{revtex4-1}
%\usepackage[no-sscript]{xltxtra}
\usepackage{fontspec}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
See Figure.
\begin{figure}[ht]
\end{figure}
\end{document}
因此看起来您要么想要将 revtex 与 pdftex 一起使用,要么想要将不同的类与 xetex 一起使用。
! Missing number, treated as zero.
<to be read again>
\aftergroup
l.12 \end{document}