我接受\newenvironment{exampletwoup}
来自这里在 beamer 类中使用,我想在 article 类中使用。无法处理图像。
% !TeX document-id = {9c92a2d6-aec3-419c-9803-7504f4517d84}
% !TeX TXS-program:compile = txs:///lualatex/[--shell-escape]
\documentclass{article}
\usepackage{graphicx}
\usepackage{minted}
\newenvironment{exampletwoup}
{\VerbatimEnvironment
\begin{VerbatimOut}{example1.out}}
{\end{VerbatimOut}
\setlength{\parindent}{0pt}
\fbox{\begin{tabular}{l|l}
\begin{minipage}{0.35\paperwidth}
\inputminted[fontsize=\small,resetmargins]{latex}{example1.out}
\end{minipage} &
\begin{minipage}{0.3\paperwidth}
\input{example1.out}
\end{minipage}
\end{tabular}}}
\begin{document}
\begin{exampletwoup}
\begin{itemize}
\item Tea
\item Milk
\item Biscuits
\end{itemize}
\end{exampletwoup}
\vskip 2ex
\begin{exampletwoup}
\begin{equation}
\alpha + \beta + 1
\end{equation}
\end{exampletwoup}
\vskip 2ex
\begin{exampletwoup}
\begin{figure}
\includegraphics[width=1cm]{example-image-a}
\end{figure}
\end{exampletwoup}
\vskip 2ex
\begin{figure}[ht!]
\includegraphics[width=2cm]{example-image-a}
\end{figure}
\end{document}
我被这个错误搞糊涂了。请问您能给我一些建议吗?
(./_minted-main2/CAFE693B42EA6E7531C83238BFBD4D9B3A17687B8B939E33FC53AC4D620A05
FD.pygtex) (./example1.out
! LaTeX Error: Not in outer par mode.
答案1
% !TeX document-id = {9c92a2d6-aec3-419c-9803-7504f4517d84}
% !TeX TXS-program:compile = txs:///lualatex/[--shell-escape]
\documentclass{article}
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{minted}
\newenvironment{exampletwoup}
{\VerbatimEnvironment
\begin{VerbatimOut}{example1.out}}
{\end{VerbatimOut}
\setlength{\parindent}{0pt}
\fbox{\begin{tabular}{l|l}
\begin{minipage}{0.35\paperwidth}
\inputminted[fontsize=\small,resetmargins]{latex}{example1.out}
\end{minipage} &
\begin{minipage}{0.3\paperwidth}
\input{example1.out}
\end{minipage}
\end{tabular}}}
\begin{document}
\begin{exampletwoup}
\begin{itemize}
\item Tea
\item Milk
\item Biscuits
\end{itemize}
\end{exampletwoup}
\vskip 2ex
\begin{exampletwoup}
\begin{equation}
\alpha + \beta + 1
\end{equation}
\end{exampletwoup}
\vskip 2ex
\begin{exampletwoup}
\includegraphics[width=1cm]{example-image-a}
\end{exampletwoup}
\vskip 2ex
\includegraphics[width=2cm]{example-image-a}
\end{document}