PythonTEX 无法在当前 Overleaf 编译器上运行

PythonTEX 无法在当前 Overleaf 编译器上运行

有没有办法让 PythonTEX 在 Overleaf V2 中编译?

\documentclass[]{article}
\usepackage[utf8]{inputenc}
\usepackage{pythontex}

\begin{document}
\begin{pyverbatim}
def calc_ellipticity(theta, delta):
    theta = np.deg2rad(theta)
    psi = np.arcsin(np.sin(2*theta) * np.sin(delta))/2
    return np.tan(psi)
\end{pyverbatim}
\end{document}

编译得到:?PythonTEX?

答案1

(Overleaf 支持团队的 Tom 就在这里。)

遗憾的是,该pythontex软件包目前不支持 Overleaf v2。这是因为 Overleaf v2 中的安全模型发生了变化(与 v1 不同)。

也可以看看https://www.overleaf.com/learn/how-to/Overleaf_v2_FAQ

答案2

Pythontex 和 SageTex 都受 CoCalc 安全模型支持,因此您可以尝试一下。https://cocalc.com/features/latex-editor

(我研究 CoCalc,它是 Overleaf 的替代品。)

相关内容