0

I'm using minted and for each inline code, I have to use \mintinline{python}{} which is quite long to type or copy for the whole big book.

Is there any way to rewrite this command into something like shcode{}?

Here is my MWE:

\documentclass{article}   
\usepackage{minted}
\newminted{py}{bgcolor=gray!5, breakline = true}
\begin{document}
Inline code goes here: \mintinline{python}{tuple()}
% Can we make it as \shcode{tuple()}
\end{document}

Please help me.

Thanks

1 Answer 1

2

Just like you use \newminted to define new minted environment, you can use \newmintinline to define a new inline macro:

% !TeX program = txs:///arara
% arara: pdflatex: {synctex: on, interaction: nonstopmode, shell: yes}
\documentclass{article}   
\usepackage{minted}
\newminted{py}{bgcolor=gray!5, breakline = true}

\newmintinline[shcode]{python}{}
\begin{document}
Inline code goes here: \mintinline{python}{tuple()}
 Can we make it as \shcode{tuple()}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .