In a document embedding java code (actually processing) I can successfully embed listings using:
\begin[language=java]{lstlisting}
...
\end{lstlisting}
In an attempt to increase convenience, I wrote a new command that abbreviates this to:
\java
\end{lstlisting}
This works fine. However, in many instances it would be better to keep the listing external. This should be:
lstinputlisting[language=java]{code/openglprocessing/s00trianglegouraud.pde}
which I abbreviate:
\newcommand{\incjava}{\lstinputlisting[language=Java]}
\incjava{code/openglprocessing/s00trianglegouraud.pde}
Both formulations result in the following error:
! Undefined control sequence.
l.160 \incjava
{code/openglprocessing/s00trianglegouraud.pde}
While on the subject, is there any way to define a standard directory to avoid having to repeatedly refer to code/openglprocessing, in a similar manner to the graphics path for \includegraphics?
\graphicspath{ {img/} }