-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Escapeinside content is misplaced in pygtex file for nodejsrepl type #388
Comments
Adding You can then set left margin with \documentclass{article}
\usepackage{minted}
% for debugging
\setminted{frame=single}
\begin{document}
Before
\begin{minted}[escapeinside=@@]{nodejsrepl}
> testa;
@\textit{Test}@
\end{minted}
After (with \texttt{autogobble})
\begin{minted}[escapeinside=@@, autogobble]{nodejsrepl}
> testa;
Test
\end{minted}
After v2 (with \texttt{autogobble, xleftmargin=2em})
\begin{minted}[escapeinside=@@, autogobble, xleftmargin=2em]{nodejsrepl}
> testa;
@\textit{Test}@
\end{minted}
\end{document} |
Hmm. For some reason, that doesn't fix my actual test, though it does fix the MWE. I'm not sure why. As a workaround, I'm just injecting the correct output into a minted "text" environment: \begin{minted}[escapeinside=@@]{text}
@\PYG{g+gp}{\PYGZgt{}}\PYG{+w}{ }\PYG{n+nb}{document}\PYG{p}{.}\PYG{n+nx}{querySelector}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}tbody tr:nth\PYGZhy{}child(4)\PYGZdq{}}\PYG{p}{)}\PYG{p}{;}
% etc ...
\PYG{p}{]}@
\end{minted} This works adequately for my purposes, since I don't expect the example to change. |
From highlighting result, indented lines are not valid Example showing
|
Can you provide a new reproducible example? |
\documentclass{report}
\usepackage[outputdir=build]{minted}
\begin{document}
\begin{minted}[autogobble,escapeinside=@@]{nodejsrepl}
> test2;
NodeList (6) [
@\textit{Test2}@
]
\end{minted}
\end{document} I can see forbidding indentation of the
|
Then this is indeed a https://github.com/pygments/pygments problem.
I also found LaTeX example and CLI stdins
\documentclass{report}
\usepackage[cachedir=_minted_cache]{minted}
\begin{document}
\begin{minted}[escapeinside=@@]{text}
# expected
> a
[ @\textit{1}@, 2 ]
\end{minted}
\begin{minted}[escapeinside=@@]{nodejsrepl}
> a
[ @\textit{1}@, 2 ]
\end{minted}
\begin{minted}[escapeinside=@@]{nodejsrepl}
> ab
[ @\textit{1}@, 2 ]
\end{minted}
\begin{minted}[escapeinside=@@]{nodejsrepl}
> abc
[ @\textit{1}@, 2 ]
\end{minted}
\end{document}
|
I have opened pygments/pygments#2666 for this issue. |
Minimal example:
This produces the following pygtex file:
The
\PYG{esc}{\textit{Test}}
should end up on the previous line. In its current position, it doesn't render in the output.The text was updated successfully, but these errors were encountered: