escapeinside=||
通常可以工作但在我的编程语言(SAS)的字符串中不行:
\documentclass[a4paper,12pt]{book}
\usepackage{minted}
\usemintedstyle{vs}
\newcommand{\sasinline}[1]{\mintinline{sas}{#1}}
\newenvironment{sas}{\VerbatimEnvironment
\begin{minted}[escapeinside=||]{sas}}
{\end{minted}}
\begin{document}
Is it possible to write \emph{percorso fisico} in italics here?
\begin{sas}
libname <|\emph{nome logico}|> '<|\emph{percorso fisico}|>' <|\emph{eventuali opzioni}|>;
\end{sas}
Leaving this as is:
\begin{sas}
libname corso '/projects/corsosas';
\end{sas}
\end{document}
答案1
我知道你会愿意接受这个答案:
\documentclass[a4paper,12pt]{book}
\usepackage{minted}
\usemintedstyle{vs}
\newcommand{\sasinline}[1]{\mintinline{sas}{#1}}
\newenvironment{sas}{\VerbatimEnvironment
\begin{minted}[escapeinside=||]{sas}}
{\end{minted}}
\begin{document}
Is it possible to write \emph{percorso fisico} in italics here?
\begin{sas}
libname <|\emph{nome logico}|> |\PYG{l+s}{\PYGZsq{}<}\PYG{l+s}{\emph{pineapple pizza}}\PYG{l+s}{>\PYGZsq{}}| <|\emph{eventuali opzioni}|>;
\end{sas}
Leaving this as is:
\begin{sas}
libname corso '/projects/corsosas';
\end{sas}
\end{document}