运行 xelatex,从终端和 python 运行的结果不同

运行 xelatex,从终端和 python 运行的结果不同

晚上好!

我想运行一些生成具有动态内容的图像的服务。使用命令行一切都运行正常,但当我使用以下命令从 Python 代码调用编译器时,问题就开始了:subprocess.call("xelatex -output-directory %s %s" % (dirpath, texf), shell=True)

我将非常感激任何可以找到解决方案的线索

这是乳胶文件:

% Ensure that you compile using XeLaTeX !!! PDFTex has problems with some of the pakages used

% Document is made such that you just type what you want, and only include space between paragraphs
% Note that it is necessary to be on a new line before you can use `skiptonext' or `bigskiptonext'
% I hope this is in order.....

\documentclass{article}
\usepackage[english]{babel}
\usepackage[top=5cm,bottom=4cm,left=10cm,right=10cm,paperheight=1620pt,paperwidth=2880pt]{geometry}
\usepackage[pages=some]{background}
\usepackage{fontspec}
\usepackage{color}
\usepackage{lmodern}
\usepackage{lipsum}

% Your font specificantion ----------------------------------------------------------
\usepackage{paratype}
\renewcommand*\familydefault{\sfdefault}
\usepackage[T1]{fontenc}
% -----------------------------------------------------------------------------

\backgroundsetup{
scale=1,
color=black,
opacity=1.0,
angle=0,
contents={%
  \includegraphics[ width=\paperwidth,height=\paperheight]{/Users/artur/projs/ela-web/ela/pymov/back.jpg}
  }%
}

\newcommand\invisiblesection[1]{%
  \refstepcounter{section}%
  \addcontentsline{toc}{section}{\protect\numberline{\thesection}#1}%
  \sectionmark{#1}}

\newcommand*{\skiptonext}{\vspace{3cm}} % USE THIS TO ENSURE SPACING BETWEEN PARAGRAGHS
\newcommand*{\bigskiptonext}{\vspace{5cm}} % USE THIS TO ENSURE SPACING BETWEEN PARAGRAPHS

% USE THIS TO ADJUST LINE SPACING BY THE FACTOR YOU WILL SPECIFY. 1.5 IS 1.5 x THE DEFAULT FACTOR
\linespread{1.5}
%------------------------------------------------------------------------------------------------------------------

\newcommand{\vstretch}[1]{\vspace*{\stretch{#1}}}

\begin{document}
\color{white}
\BgThispage
% ----- USED TO SET FONT SIZE, ADJUST AS REQUIRED ----------
\fontsize{3cm}{2cm}\selectfont
%-------------------------------------------------------------------------
\topskip0pt
\vstretch{1}

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

%\skiptonext
%
%Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
%
%\bigskiptonext
%
%Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.


\vstretch{1}

\clearpage
\end{document}

相关内容