I have seen similar questions (a, b, c) but this one is a bit different.
Yesterday I was so excited to start learning latex and quick enough I discovered packages that can render any source code. But in my program, there are some Unicode (multibyte) characters that are not rendered with standard font families. So I used emoji package for this. And soon after that I couldn't render these special characters inside (TypeScript) string which is inside minted block.
Surely I can escape by using the same type of quotes around the latex code inside string: "string "|\escaped|" string"
, but this will render another pair of quotes in PDF, so this won't work.
AFAIK, I should use another package, but minted is soo good. How can I solve the problem without ditching minted package?
Here is a short example:
\documentclass[a4paper]{article}
\usepackage[cachedir=../.cache, outputdir=output]{minted}
\usepackage{emoji}
\def\done{\emoji{check-mark-button}}
\begin{document}
\noindent It shows here (outside minted) -> \done
\begin{minted}[escapeinside=||]{typescript}
...
hbs.registerHelper("list", function(this: any) {
...
entries.forEach(entry => {
|It shows here (inside minted) -> \done|
rows += `
|But not in here (inside minted and backticks) -> \done|
...
`
})
...
});
...
\end{minted}
\end{document}
\PYG
doesescapeinside=||
doesn't seem to work when escape characters (start|
and end|
) are placed on different lines.escapeinside
comments and strings is a GitHub issue, according to the documentation.minted
doc p24 links to: GitHub