How can I determine a file extension given a file name in LaTeX?
- by Frank
I am attempting to write a LaTeX package which leverages the minted package's \inputminted command. My \mycommand command takes two parameters, the first being a path to a file, and I want to pass the file's extension to the \inputminted command:
\newcommand\mycommand[2]{
\inputminted{#1}{...}
}
Note that the above won't work since the full path is passed to \inputminted.
Example:
\mycommand{/path/to/Test.java}{blah}
should invoke
\inputminted{java}{...}