Personal utility package for LaTeX PDF documents
- Download
vutil.styinto your LaTeX TDS as appropriate for your installed distribution. - This package uses
mintedfor syntax highlighting and formatting of code blocks. Ensure the Python packagePygmentsis installed. - Include the package in a
.texfile with\usepackage{vutil}.
Any environment listed below may be used by wrapping raw code text with \begin followed by the environment signature above the text, and \end with the environment name below. Example:
\begin{snippet}[py]
def foo(n: int) -> int:
return n ** 2 + 5 * n + 2
\end{snippet}{snippet}[<language>]: a code block with no title/label. Generally used for short snippets of code (hence the name).{code}[<language>]{<ref>}: a code block with a title/label.
\codet{<text>}: in-line monospaced text.\codeth[<language>]{<text>}: in-line (verbatim) code text with optional syntax highlighting.\codefile[<language>]{<path>}{<caption>}{<ref>}[<first_line>][<last_line>]: a code block directly from a file. The optional<first_line>and<last_line>arguments may be used to only include a particular section of the file.
\lfig{<path>}{<width>}{<caption>}{<ref>}: a figure with a caption/label.\fig{<path>}{<width>}: an uncaptioned figure.
\vtitle{<text>}: simple centered title in Large text.\hdr{<left>}{<right>}: creates a header on the current page with supplied text.\mhdr{<left>}{<right>}: creates a header on every page with supplied text.\ans: sets text color to green.
\p: dynamically-sized parentheses.\b: dynamically-sized square brackets.\c: dynamically-sized curly braces.\abs: absolute value.\norm: vector norm.\f{<numerator>}{<denominator>}: fraction shortcut.\Im,\Re: imaginary/real components in math Roman.