Minted
Minted is a package that allows formatting and highlighting source code in LaTeX. Some minted documentation may be found at Overleaf or through the original package documentation.
Info |
---|
Remember to include the Minted package: \usepackage{minted} |
We will only use the option of including code through external files, but you may also include code directly. An example is shown below.
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Minted may also be applied to a single word or phrase in the middle of a text.
Expand | ||
---|---|---|
| ||
|
Styles
Minted offers a number of different styles. To change the style, include the command \usemintedstyle( style ) when including the package Minted. Differnt styles may be found at the Overleaf documentation linked above.
Code Block |
---|
\usemintedstyle{borland} \inputminted[breaklines]{C++}{isPrime.cpp} \usemintedstyle{rrt} \inputminted[breaklines]{C++}{isPrime.cpp} |
BibTeX Display Table |
---|