1

\mintinline inside of an environment created by \NewEnviron of environ package seems to be strange. There are some unintended blank spaces, after the macros followed by \.

result

What should I do to fix it?

MWE:

\documentclass[11pt,a4paper]{book}
\usepackage{minted}
\usepackage{environ}
\usemintedstyle{manni}

\begin{document}
\NewEnviron{Par}{%
    \BODY%
}

\begin{Par}
    \mintinline{latex}{\usepackage{stackoverflow}\no\space\in\code}
\end{Par}
\end{document}

add: \def\c{\mintinline{latex}{\macros\something}} \c produces the same error. So is it a problem related verbatim-like things?

  • Welcome to TeX.SE! What did you expect? Can you please explain better what you want? – Kurt Dec 28 '18 at 12:38
  • @Kurt, I think the problem is the extra space in the code produced by mintinline. – Sigur Dec 28 '18 at 12:40
  • @Kurt The picture above has unintended blank spaces, which are not in the code. So I want something like highlighted "\usepackage{stackoverflow}\no\space\in\code" without whitespaces b/w macros. – Kanu Kim Dec 28 '18 at 12:40
  • Okay, and why Par? What should it do? Why not simply use \verb|\usepackage{stackoverflow}\no\space\in\code| ? – Kurt Dec 28 '18 at 12:45
  • 1
    It's not possible to use \mintinline in the argument to a macro, including environments defined with \NewEnviron. It's quite likely that the problem can be solved with a standard environment. Please, write down the specifications. – egreg Dec 28 '18 at 13:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.