0

I have am using the macro below and sometimes I the content I pass in via the third argument contains a minted environment. However, the code doesn't compile. How can I fix this issue?

\newcommand{\customsubsection}[3]{
    \only<#1>{
        {\Large \purplebold{#2}}
        \vspace{1em}
        #3
        \vspace{1em}
    }
}
0

1 Answer 1

2

Use a custom environment and not a macro:

% !TeX program = txs:///arara
% arara: pdflatex: {synctex: on, interaction: nonstopmode, shell: yes}

\documentclass{beamer}

\usepackage{minted}

\newenvironment<>{customsubsection}[1]{%
  \begin{onlyenv}#2
  {\Large \textbf{#1}\par}%
  \vspace{1em}%
}{%
  \vspace{1em}% 
  \end{onlyenv}%
}

\begin{document}
    
\begin{frame}[fragile]
    abc
  
\begin{customsubsection}<2->{some text}
\begin{minted}{python}
  something verbatim
\end{minted}  
\end{customsubsection}
\end{frame}
    
\end{document}

You must log in to answer this question.

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