# Inline code and short verb with minted

I it possible to use minted for inline code and to add a short verb sing for minted? Like \lstMakeShortInline| in listings.sty?

\documentclass{article}

\usepackage{minted}
\newminted{tex}{}
\newmint[ltx]{tex}{}

\begin{document}
Normal Text \ltx|\inline \Verb \not \inline|
\begin{texcode}
\Display \verbatim
\end{texcode}
Normal Text %|\not \working|
\end{document}


minted supports this since v2.0 (on CTAN since 2015/01/31):

\documentclass{article}

\usepackage{minted}

\begin{document}
You can use \mintinline{latex}{\mintinline{latex}{your $code$ goes here}} of
the minted~2 package to highlight source code inline. If you already use
\mintinline{latex}{\usepackage{minted}}
\end{document}


It is also possible to add a short verb sign:

from the Dokumentation:

\newmintinline['macro name']{'language'}{'options'}. If a 'macro name' is not specified, then the created macro is called \'language'inline

• Thanks that sounds good. Do you know if something like \lstMakeShortInline| is available (or planned) too?
– Tobi
Dec 5 '13 at 16:23
• Now I do ... :) Dec 5 '13 at 17:11
• Thanks but thats not really what I meant. In the above example a short verb would be like X|my $foo =$bar;|X, i.e. only delimited by the pipes …
– Tobi
Dec 5 '13 at 17:43
• @Tobi I intentionally didn’t build this into minted (and neither did Geoffrey, presumably for the same reason) because it’s incredibly bad design in my opinion. LaTeX already has too many “magic” (active) characters, no need to add even more. If anything, users of TeX should disable active characters and math delimiters in general code. Dec 5 '13 at 18:48
• @user : The X is just a normal text character as in my example. @Tobi wanted to be able surround their code by just | and | instead of \perlinline/ and /. or (using the macro name argument) \p/ and / . (saving two keystrokes for every codeblock) Oct 11 '19 at 11:21

So far there is no support for inline code since I (mistakenly, in hindsight) deemed this not important.

If I find some time to work on the next release, support for this may be added (and will probably break backwards compatibility). In the meantime, somebody has posted a patch (be sure to read all the comments!) to make the \mint command inline. You may want to play with that.

• Thank you. I read it and decided to use listings for inline and mint for displayed code. I accept your answer but I still hope that there is a official solution in a future version :-)
– Tobi
Feb 25 '12 at 22:43
• How do I install a patch? Im running OS X 10.6.
– Tobi
Feb 26 '12 at 0:13
• Hi Konrad, I also read that Allow inline code thread but that was old stuff and I'm not sure if the solution sketched there still applies. pygments seems also to be stuck in 2008 with version 1.4 Mar 4 '13 at 18:39