-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenfoam-highlight.tex
30 lines (25 loc) · 1.01 KB
/
openfoam-highlight.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
\documentclass[9pt]{article}
%% A minimal example of working OpenFOAM highlighting using minted
%% Compiles with all major engines (pdflatex, lualatex and xelatex)
\usepackage{amsmath, amsfonts}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\usepackage[cachedir=_minted-cache]{minted}
\makeatletter
\def\minted@jobname{openfoam-highlight}
\makeatother
%% Step 0: include the provided sty file
\input{minted-openfoam.sty}
\begin{document}
%% Turn on Foam Highlighter in this section
\usefoamhlttrue
%% Use ?? for Tex escape inside the highlighter
\renewcommand{\escapeinsidechar}{?}
\LaTeX code and math mode in OpenFOAM comments
\tikz[remember picture,overlay,baseline=0pt] \draw[->,thick,dashed,blue] (0,-0.5em)
to[bend left] ([shift={(1ex,1ex)}]pic cs:code); and even inline OpenFOAM expressions
\mintinline{cpp}{key val;} get highlighted.
\inputminted[escapeinside=??]{cpp}{of-dicts/sampleDict}
%% Turn if off to render other code snippets normally
\usefoamhltfalse
\end{document}