我想在我的 baposter 海报中包含列表,但如果我这样做,我会收到以下错误:
! Paragraph ended before \lst@next was complete.
<to be read again>
\par
l.288 }
我怎样才能包含列表而不出现错误?
一个例子:
\documentclass[portrait,final,a0paper]{baposter}
\usepackage{listings}
\usetikzlibrary{calc}
\begin{document}
\begin{poster}{}{}
\textsc{}
\headerbox{Problem}{name=problem,column=0,row=0}{
\iffalse
\begin{lstlisting}
Test
\end{lstlisting}
\fi
}
\end{poster}
\end{document}
一旦我删除 \iffalse 和 \fi,它就会停止编译。
编辑:将示例变为 MWE。
答案1
Listings
posterbox
在环境中运行良好。posterbox
替换headerbox
以允许使用verbatim
环境。
这是 MWE 及其输出。
\documentclass[landscape,a0paper]{baposter}
\usepackage{listings}
\lstset{%
basicstyle=\scriptsize\ttfamily,
language=[LaTeX]{TeX}
}
\begin{document}
\begin{poster}{
grid=false,
columns=2,
colspacing=4.2mm,
headerheight=0.07\textheight,
background=none,
eyecatcher=false,
%posterbox options
headerborder=closed,
borderColor=red,
headershape=rectangle,
headershade=plain,
headerColorOne=blue,
textborder=rectangle,
boxshade=plain,
boxColorOne=white,
headerFontColor=white,
headerfont=\color{white}\large\bfseries\sffamily,
textfont=\normalsize\sffamily,
linewidth=1pt
}
{} % Left / top logo
{Title}
{\textsc{Author}}
{} % Right logo
\begin{posterbox}[name=box1,column=0,column=0,row=0,span=1]{Title}
\lstinputlisting{\jobname.tex}
\end{posterbox}
\begin{posterbox}[name=box1,column=0,column=1,row=0,span=1]{Title}
\begin{lstlisting}
\documentclass[landscape,a0paper]{baposter}
\usepackage{listings}
\lstset{%
basicstyle=\small\ttfamily,
language=[LaTeX]{TeX}
}
\begin{document}
\end{document}
\end{lstlisting}
\end{posterbox}
\end{poster}
\end{document}