I am trying to use a piece of highlighted code using the minted
package inside a tabu
table:
\documentclass{article}
\usepackage{minted}
\usepackage{longtable}
\usepackage{tabu}
\begin{document}
\begin{tabu*}{X[5,l]X[5,l]}
\begin{minted}{matlab}
function out = op(x, y)
out = x + y;
end
\end{minted}
& \\
\end{tabu*}
\end{document}
With the above MWE I tried to place a minted
environment inside a tabu
cell analogously to what was done with the Verbatim
environment explained within the tabu
package documentation in section 1.3 "Inserting Verbatim material (fancyvrb)". However, by compiling the above MWE I get the following error message:
Enter file name:
! Emergency stop.
<read *>
l.15 \end{tabu*}
^^J
*** (cannot \read from terminal in nonstop modes)
If I try to compile the document in scroll mode (-interaction=scrollmode
with XeLaTeX from MiKTeX), I just get a command prompt with Enter file name:
.
How can the minted
environment be used within a tabu
table?
minted
is very different fromVerbatim
, because it has to write its contents in a file, then call an external program and input the resulting file.minted
uses these temporary files. What makes me curious is that if I just press myEnter
key twice inscrollmode
the output is generated as expected without an additional error.tabu
does on cell entries.minted
inside atabu
table on the web.tabu
: the author has long promised a new version, stating it will have a number of incompatibilities with the current one. My advice is to contact the author.