bashful 包的一个错误

bashful 包的一个错误

我也想使用该bashful包,但出现错误。我写了这个简单的代码(test.tex):

\documentclass{article}
\usepackage{bashful}

\begin{document}
\bash
ls
\END
\end{document}

并且编译失败:

L7: I will now print the contents of file test.stderr (if found)
L7: File test.stderr was empty
L7: Proceeding as usual
L7: Checking whether any listings are required
L7: Nothing has to be listed
L7: Defining macro for the contents of the standard output file
L7: Opened file test.stdout
L7: File test.stdoutwas empty
after EOF
L7: bashStdout :=
\bashStdout 

L7: Closing file test.stdout
L7: Defining macro for the contents of the standard error file
L7: Opened file test.stderr
L7: File test.stdoutwas empty
! Undefined control sequence.
<write> ...nputlineno : bashStderr :=
\bashStderr 

l.7 \END
        ^^M
? 

我不明白。是不是缺少了什么?

答案1

您必须使用带有--shell-escape标志的 latex(否则 bash 将无法运行,并且您会收到显示的错误)

此外,如果您想查看文档中的输出,您需[stdout]要这样做:

\documentclass{article}
\usepackage{bashful}

\begin{document}
\bash[stdout]
ls
\END
\end{document}

相关内容