lkmpg/lib/codeblock.tex
Chun-Hung Tseng fdc07d0008 Add inline code blocks by using newmintinline
We can now use \cpp|...| and \sh|...| to add inline code blocks, which
resembles the \verb|...| syntax

Signed-off-by: Chun-Hung Tseng <henrybear327@gmail.com>
2021-08-09 13:17:06 +02:00

38 lines
904 B
TeX

\newminted[code]{c}{frame=single,
framesep=2mm,
baselinestretch=1,
fontsize=\footnotesize,
breaklines,
breakafter=d,
linenos
}
\usemintedstyle{vs}
\NewDocumentCommand{\samplec}{oom}{%
\IfNoValueTF{#1}%
{%
\inputminted[frame=single, framesep=2mm, baselinestretch=1, fontsize=\footnotesize, breaklines, breakafter=d, linenos]{c}{#3}%
}%
{%
\IfNoValueTF{#2}%
{%
\inputminted[frame=single, framesep=2mm, baselinestretch=1, fontsize=\footnotesize, breaklines, breakafter=d, firstline=#1, linenos]{c}{#3}%
}%
{%
\inputminted[frame=single, framesep=2mm, baselinestretch=1, fontsize=\footnotesize, breaklines, breakafter=d, firstline=#1, lastline=#2, linenos]{c}{#3}%
}%
}%
}
\newminted[codebash]{bash}{frame=single,
framesep=2mm,
baselinestretch=1.2,
breaklines,
breakafter=d,
linenos
}
\newmintinline[sh]{bash}{}
\newmintinline[cpp]{c}{}