TransWikia.com

include sql files and use minted for highlighting

TeX - LaTeX Asked by Volker Raschek on October 17, 2020

I write in latex a documentation about a database project.

I would like to include some sql files in my latex document and highlight this files with minted.

My initial approach is the following, but it’s only print my input command.

label{included-sql-files}
section{SQL-Files}
begin{minted}[lineos, framesep=2mm, fontsize=small]{sql}
input{./sql/01.sql}
end{minted}

Maybe anyone else know a good solution for my problem.

Volker

One Answer

You could use inputminted but I would recommend to define your own command with whatever options you like (see minted documentation page 29):

documentclass{article}
usepackage{minted}

newmintedfile[inputsql]{sql}{%
    linenos,
    autogobble,
    breaklines,
}

begin{document}
    inputsql{sql/01.sql}
end{document}

Correct answer by jakun on October 17, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP