我正在用baposter.cls类制作海报。这个类有点奇怪,标题输入如下:
{\sf\bf (Poster title)}
我想删除标题并将框移至海报顶部。但是,每当我注释掉上述代码时,我的第一个框中都会出现以下标题消息:
Argument of \headerbox has an extra }.
<inserted text>
\par
l.122 \headerbox
{Some Notation}{name=notation,span=3,row=0,column=0}{
我该如何删除标题并提升区块?
以下是一个例子:
\documentclass[paperwidth=50cm,paperheight=100cm]{baposter}
\usepackage[font=small,labelfont=bf]{caption} % Required for specifying captions to tables and figures
\usepackage{booktabs} % Horizontal rules in tables
\usepackage{relsize} % Used for making text smaller in some places
\graphicspath{{figures/}} % Directory in which figures are stored
\definecolor{bordercol}{RGB}{40,40,40} % Border color of content boxes
\definecolor{headercol1}{RGB}{186,215,230} % Background color for the header in the content boxes (left side)
\definecolor{headercol2}{RGB}{80,80,80} % Background color for the header in the content boxes (right side)
\definecolor{headerfontcol}{RGB}{0,0,0} % Text color for the header text in the content boxes
\definecolor{boxcolor}{RGB}{255,255,255} % Background color for the content in the content boxes
\begin{document}
\background{ % Set the background to an image (background.pdf)
\begin{tikzpicture}[remember picture,overlay]
\draw (current page.north west)+(-2em,2em) node[anchor=north west]
{\includegraphics[height=1.1\textheight]{background}};
\end{tikzpicture}
}
\begin{poster}{
grid=false,
borderColor=bordercol, % Border color of content boxes
headerColorOne=headercol1, % Background color for the header in the content boxes (left side)
headerColorTwo=headercol2, % Background color for the header in the content boxes (right side)
headerFontColor=headerfontcol, % Text color for the header text in the content boxes
boxColorOne=boxcolor, % Background color for the content in the content boxes
headershape=roundedright, % Specify the rounded corner in the content box headers
headerfont=\Large\sf\bf, % Font modifiers for the text in the content box headers
textborder=rectangle,
background=user,
headerborder=open, % Change to closed for a line under the content box headers
boxshade=plain
}
{}
{\sf\bf Title of Poster}
\headerbox{Box title}
{name=title,span=3, row=0,column=0}{
Box body
}
\end{poster}
\end{document}
代码需要类 baposter.cls 才能运行。我也不确定如何修复这个问题,但它还需要一个名为 background.pdf 的文件(可以是任何 pdf,只需命名为 background)。
答案1
baposter.cls
对环境有相当复杂的定义poster
,其中设置了一些长度headerheight
、colheight
等等。如果您将标题参数留空,并将其放在标题框移至顶部\setlength{\colheight}{\textheight}
之后。请尝试下面的代码。\begin{poster}{...}
\documentclass[paperwidth=50cm,paperheight=100cm]{baposter}
\usepackage[font=small,labelfont=bf]{caption} % Required for specifying captions to tables and figures
\usepackage{booktabs} % Horizontal rules in tables
\usepackage{relsize} % Used for making text smaller in some places
\usepackage{lipsum}
\graphicspath{{figures/}} % Directory in which figures are stored
\definecolor{bordercol}{RGB}{40,40,40} % Border color of content boxes
\definecolor{headercol1}{RGB}{186,215,230} % Background color for the header in the content boxes (left side)
\definecolor{headercol2}{RGB}{80,80,80} % Background color for the header in the content boxes (right side)
\definecolor{headerfontcol}{RGB}{0,0,0} % Text color for the header text in the content boxes
\definecolor{boxcolor}{RGB}{255,255,255} % Background color for the content in the content boxes
\begin{document}
%\background{ % Set the background to an image (background.pdf)
%\begin{tikzpicture}[remember picture,overlay]
%\draw (current page.north west)+(-2em,2em) node[anchor=north west]
%{\includegraphics[height=1.1\textheight]{background}};
%\end{tikzpicture}
%}
%%% \begin{baposter}{settings}{Eye Catcher}{Title}{Author}{University Logo}
\begin{poster}{
grid=false,
borderColor=bordercol, % Border color of content boxes
headerColorOne=headercol1, % Background color for the header in the content boxes (left side)
headerColorTwo=headercol2, % Background color for the header in the content boxes (right side)
headerFontColor=headerfontcol, % Text color for the header text in the content boxes
boxColorOne=boxcolor, % Background color for the content in the content boxes
headershape=roundedright, % Specify the rounded corner in the content box headers
headerfont=\Large\sf\bf, % Font modifiers for the text in the content box headers
textborder=rectangle,
background=plain,
headerborder=open, % Change to closed for a line under the content box headers
boxshade=plain
}
{}
{}
{}
{}
%\headerbox{Box title}
%{name=title,span=3, row=0,column=0}{
%Box body
%}
\setlength{\colheight}{\textheight}%
\headerbox{Headerbox 1}{name=H1,column=0,row=0}{%
\lipsum[1]
}
\headerbox{Headerbox 2}{name=H2,column=1,row=0,span=2}{%
\lipsum[2-3]
}
\headerbox{Headerbox 3}{name=H3,column=1,span=2,below=H2,bottomaligned=H1}{%
\lipsum[4]
}
\end{poster}
\end{document}