我在这里学习了如何向 TeXstudio 添加用户命令:http://texstudio.sourceforge.net/manual/current/usermanual_en.html
然后,我形成了如下结构和视图:
txs:///pdflatex | txs:///pythontex | txs:///pdflatex | txs:///biber | txs:///pdflatex | txs:///view-pdf-internal
我已经确认pythontex.exe
系统已经知道这一点,只需在控制台中运行该命令并注意以下输出:
usage: pythontex.py [-h] [--version] [--encoding ENCODING]
[--error-exit-code {true,false}] [--runall [{true,false}]
| --rerun {never,modified,errors,warnings,always}]
[--hashdependencies [{true,false}]] [-j N] [-v]
[--interpreter INTERPRETER]
[--debug [<family>:<session>:<restart>] | --interactive
[<family>:<session>:<restart>]]
TEXNAME
pythontex.py: error: too few arguments
C:\texlive\2016\bin\win32\runscript.tlu:679: command failed with exit code 2:
python.exe c:\texlive\2016\texmf-dist\scripts\pythontex\pythontex.py
因此,我决定在一个简单的文档上尝试我的设置:
\documentclass[12pt,letterpaper]{article}
\usepackage{pythontex}
\begin{document}
\begin{pycode}
print(r'\begin{center}')
print(r'\textit{A message from Python!}')
print(r'\end{center}')
\end{pycode}
\end{document}
但是,当我点击构建和查看按钮时,一切都挂起了,并且日志显示以下错误(行号对应于文件pythontex.sty
):
line 284: Use of \@xs@StrSubstitute@@ doesn't match its definition. \StrSubstitute{\pytx@jobname}{"}{}
line 284: Use of \\lstinline doesn't match its definition. \StrSubstitute{\pytx@jobname}{"}{}
line 284: Undefined control sequence. \StrSubstitute{\pytx@jobname}{"}{}
line 284: Undefined control sequence. \StrSubstitute{\pytx@jobname}{"}{}
line 284: Undefined control sequence. \StrSubstitute{\pytx@jobname}{"}{}
line 284: Undefined control sequence. \StrSubstitute{\pytx@jobname}{"}{}
line 284: Undefined control sequence. \StrSubstitute{\pytx@jobname}{"}{}
line 284: Undefined control sequence. \StrSubstitute{\pytx@jobname}{"}{}
line 284: Use of \@ doesn't match its definition. \StrSubstitute{\pytx@jobname}{"}{}
发生什么问题了?