![Minted escapeinside 在字符串中不起作用](https://linux22.com/image/359471/Minted%20escapeinside%20%E5%9C%A8%E5%AD%97%E7%AC%A6%E4%B8%B2%E4%B8%AD%E4%B8%8D%E8%B5%B7%E4%BD%9C%E7%94%A8.png)
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}