Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am using the minted package to highlight source code in LaTeX. It works well for a piece of code embedded in \begin{minted} ... \end{minted}. Now the question is if it is possible to highlight a whole file whose path is specified in .tex. Going further, is it possible to let minted to choose an appropriated lexer to use in according to the suffix of a file?

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

To quote the manual:

Finally, there’s the comment \inputminted command to read and format whole files. Its syntax is \inputminted[options]{language}{filename}.

share|improve this answer
    
Thanks for your comment... Do you have any idea about my last question? –  SoftTimur Dec 14 '11 at 13:18
    
@SoftTimur Sorry, no, if I did I would have said so. I've never used minted. –  Torbjørn T. Dec 14 '11 at 13:28
1  
@SoftTimur: You could try to be clever with the \IfEndWith command of xstring or something like that, if you really can't select the lexer yourself every time. –  You Dec 14 '11 at 14:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.