是否可以结合pythontex

问题描述

我正在尝试将在 pysub 环境(来自 pythontex 包)中生成的 tikz 图片外部化。

在这里使用的不同编译步骤是:

  1. Lualatex
  2. Pythontex
  3. Lualatex

如果我不激活外化,通过注释 \tikzexternalize[] 命令,一切正常。

当我在没有任何放置在 pysub 环境中的情况下外部化 tikz 图片时,一切也正常。

所以问题实际上是关于在 pysub 环境中使用的 tikzpicture。 “问题”已于 2016 年 here 提出。

我有点希望有人能在此期间找到解决方案。

% arara: lualatex: {shell: true}
% arara: pythontex
% arara: lualatex: {shell: true}

\documentclass[a4paper,10pt]{article}

\usepackage{pythontex}
\usepackage{tikz}
\usepackage{pgfplots}
\usepgfplotslibrary{external}
% \tikzexternalize[prefix=tikz/]
\tikzset{external/system call={lualatex \tikzexternalcheckshellescape -interaction=nonstopmode -jobname "\image" "\texsource"}}
%\tikzexternalize[]

\begin{document}

\begin{pycode}
from sympy import *
x=Symbol('x')
f1=2*x-2
xmin,xmax,ymin,ymax=-3.5,3.5,-3.5,3.5
\end{pycode}
%
\begin{pysub}
\begin{tikzpicture}[]
  \begin{axis}[scale=.8,xmin=!{xmin},xmax=!{xmax},ymin=!{ymin},ymax=!{ymax},domain=!{xmin}:!{xmax},restrict y to domain=!{ymin}:!{ymax},]
    \addplot[] (x,{!{f1}});
  \end{axis} 
\end{tikzpicture}
\end{pysub}

\end{document}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)