Minted escapeinside 在字符串中不起作用

Minted escapeinside 在字符串中不起作用

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}

相关内容