# Tag Info

1

[moved from a comment] Just to provide additional context to already given answers: You can not, in general, hope to pass to some LaTeX command expecting something like a filename, a macro as argument; at best (and not always) the command will be of the type which attempts to expand its argument, and as soon as this argument does unexpandable things, it ...

2

If the file shellout.tex just contains one line with the file name of the generated file, then \usepackage{catchfile} \newcommand{\includeplot}[2][]{% \immediate\write18{python pytexplot.py #2}% \CatchFileDef\plotpath{shellout.tex}{\endlinechar=-1 }% \includegraphics[#1]{\plotpath}% } in the preamble, with \includeplot{plot1} in the document or ...

4

When you've got a shell command which creates plot1 in shellout.tex file, then you can simply modify this shell command in order it creates \includegraphics{plot1} instead simple plot1 in the shelloupt.tex file. And you can simply use \input shellout But if you insist on the idea that your shell command creates only plot1 in your shellout.tex file then ...

3

I have added basic bash support to pythontex...ended up taking less than 20 lines of code. To use this, you will need the latest version from GitHub. You will need to use the standard pythontex 3-step compile whenever you have new bash code that needs to be executed (run LaTeX, run the PythonTeX script, run LateX). When you don't have new code that needs ...

10

\documentclass{article} \begin{document} \immediate\write18{echo pwd > /tmp/zzpipe} \texttt{\input{result.txt}} \immediate\write18{echo cd > /tmp/zzpipe} \immediate\write18{echo pwd > /tmp/zzpipe} \texttt{\input{result.txt}} \immediate\write18{echo 'FOO=wibble' > /tmp/zzpipe} \immediate\write18{echo 'echo FOO is \$FOO' > /tmp/zzpipe} ...

Top 50 recent answers are included