TransWikia.com

include sql files and use minted for highlighting

TeX - LaTeX Asked on November 19, 2021

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}

Answered by jakun on November 19, 2021

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