![为什么我的警报框没有居中?](https://linux22.com/image/379779/%E4%B8%BA%E4%BB%80%E4%B9%88%E6%88%91%E7%9A%84%E8%AD%A6%E6%8A%A5%E6%A1%86%E6%B2%A1%E6%9C%89%E5%B1%85%E4%B8%AD%EF%BC%9F.png)
我正在使用Overleaf 海报模板创建海报。我有四列,我想要一个可以覆盖四列的警告框。我不明白为什么警告框右侧的空间比左侧的空间大。我\centering
之前试过警告框,\begin{center}
但都不起作用。检查模板所基于的 beamerthemeconfposter.sty 中的间距和边距,我仍然没有弄清楚。
这是我的代码:
\documentclass[final]{beamer}
\usepackage[scale=1.24]{beamerposter} % Use the beamerposter package for laying out the poster
\usetheme{confposter} % Use the confposter theme supplied with this template
\setbeamercolor{block title}{fg=ngreen,bg=white} % Colors of the block titles
\setbeamercolor{block body}{fg=black,bg=white} % Colors of the body of blocks
\setbeamercolor{block alerted title}{fg=white,bg=dblue!70} % Colors of the highlighted block titles
\setbeamercolor{block alerted body}{fg=black,bg=dblue!10}
% Define the column widths and overall poster size
% To set effective sepwid, onecolwid and twocolwid values, first choose how many columns you want and how much separation you want between columns
% In this template, the separation width chosen is 0.024 of the paper width and a 4-column layout
% onecolwid should therefore be (1-(# of columns+1)*sepwid)/# of columns e.g. (1-(3+1)*0.024)/3= 0.301
% Set twocolwid to be (2*onecolwid)+sepwid = 0.464
% Set threecolwid to be (3*onecolwid)+2*sepwid = 0.708
% Set fourcolwid to be (4*onecolwid)+3*sepwid = 0.88 + 0.072=
\newlength{\sepwid}
\newlength{\onecolwid}
\newlength{\twocolwid}
\newlength{\threecolwid}
\newlength{\fourcolwid}
\setlength{\paperwidth}{33.1in} % A0 width: 46.8in
\setlength{\paperheight}{46.8in} % A0 height: 33.1in
\setlength{\sepwid}{0.024\paperwidth} % Separation width (white space) between columns
\setlength{\onecolwid}{0.22\paperwidth} % Width of one column
\setlength{\twocolwid}{0.464\paperwidth} % Width of two columns
\setlength{\threecolwid}{0.708\paperwidth} % Width of three columns
\setlength{\fourcolwid}{0.952\paperwidth} % Width of three columns
\setlength{\topmargin}{-0.5in} % Reduce the top margin size
%-----------------------------------------------------------
\usepackage{graphicx} % Required for including images
\usepackage{booktabs} % Top and bottom rules for tables
%----------------------------------------------------------------------------------------
% TITLE SECTION
%----------------------------------------------------------------------------------------
\title{The origin and nature of individual differences in the form of Pavlovian conditioned responding} % Poster title
\author{Adela F.} % Author(s)
\institute{X University} % Institution(s)
\begin{document}
\addtobeamertemplate{block end}{}{\vspace*{2ex}} % White space under blocks
\addtobeamertemplate{block alerted end}{}{\vspace*{2ex}} % White space under highlighted (alert) blocks
\setlength{\belowcaptionskip}{2ex} % White space under figures
\setlength\belowdisplayshortskip{2ex} % White space under equations
\begin{frame}[t] % The whole poster is enclosed in one beamer frame
\begin{columns}[t] % The whole poster consists of four major columns, the second of which is split into two columns twice - the [t] option aligns each column's content to the top
\begin{column}{\sepwid}\end{column} % Empty spacer column
\begin{column}{\fourcolwid} % The first column
\begin{alertblock}{Objectives}
Lorem ipsum dolor sit amet, consectetur, nunc tellus pulvinar tortor, commodo eleifend risus arcu sed odio:
Mollis dignissim, magna augue tincidunt dolor, interdum vestibulum urna
Sed aliquet luctus lectus, eget aliquet leo ullamcorper consequat. Vivamus eros sem, iaculis ut euismod non, sollicitudin vel orci.
Nascetur ridiculus mus.
\end{alertblock}
\end{column}
\end{columns} % End of all the columns in the poster
\end{frame} % End of the enclosing frame
\end{document}
}
谢谢!
答案1
beamerposter
警告块和标题没有居中,因为手动弄乱纸张尺寸是个坏主意 -如果您想更改纸张格式,请使用软件包提供的选项。
并且与代码中的注释相反,graphicx
beamer 不需要它,因为 beamer 已经为您加载了它。
\documentclass[final]{beamer}
\usepackage[scale=1.24,size=a0,orientation=portrait]{beamerposter} % Use the beamerposter package for laying out the poster
\usetheme{confposter} % Use the confposter theme supplied with this template
\setbeamercolor{block title}{fg=ngreen,bg=white} % Colors of the block titles
\setbeamercolor{block body}{fg=black,bg=white} % Colors of the body of blocks
\setbeamercolor{block alerted title}{fg=white,bg=dblue!70} % Colors of the highlighted block titles
\setbeamercolor{block alerted body}{fg=black,bg=dblue!10}
% Define the column widths and overall poster size
% To set effective sepwid, onecolwid and twocolwid values, first choose how many columns you want and how much separation you want between columns
% In this template, the separation width chosen is 0.024 of the paper width and a 4-column layout
% onecolwid should therefore be (1-(# of columns+1)*sepwid)/# of columns e.g. (1-(3+1)*0.024)/3= 0.301
% Set twocolwid to be (2*onecolwid)+sepwid = 0.464
% Set threecolwid to be (3*onecolwid)+2*sepwid = 0.708
% Set fourcolwid to be (4*onecolwid)+3*sepwid = 0.88 + 0.072=
\newlength{\sepwid}
\newlength{\onecolwid}
\newlength{\twocolwid}
\newlength{\threecolwid}
\newlength{\fourcolwid}
%\setlength{\paperwidth}{33.1in} % A0 width: 46.8in
%\setlength{\paperheight}{46.8in} % A0 height: 33.1in
\setlength{\sepwid}{0.024\paperwidth} % Separation width (white space) between columns
\setlength{\onecolwid}{0.22\paperwidth} % Width of one column
\setlength{\twocolwid}{0.464\paperwidth} % Width of two columns
\setlength{\threecolwid}{0.708\paperwidth} % Width of three columns
\setlength{\fourcolwid}{0.952\paperwidth} % Width of four columns
\setlength{\topmargin}{-0.5in} % Reduce the top margin size
%-----------------------------------------------------------
%\usepackage{graphicx} % Required for including images
\usepackage{booktabs} % Top and bottom rules for tables
%----------------------------------------------------------------------------------------
% TITLE SECTION
%----------------------------------------------------------------------------------------
\title{The origin and nature of individual differences in the form of Pavlovian conditioned responding} % Poster title
\author{Adela F.} % Author(s)
\institute{X University} % Institution(s)
\begin{document}
\addtobeamertemplate{block end}{}{\vspace*{2ex}} % White space under blocks
\addtobeamertemplate{block alerted end}{}{\vspace*{2ex}} % White space under highlighted (alert) blocks
\setlength{\belowcaptionskip}{2ex} % White space under figures
\setlength\belowdisplayshortskip{2ex} % White space under equations
\begin{frame}[t] % The whole poster is enclosed in one beamer frame
\begin{columns}[t] % The whole poster consists of four major columns, the second of which is split into two columns twice - the [t] option aligns each column's content to the top
%\begin{column}{\sepwid}\end{column} % Empty spacer column
\begin{column}{\fourcolwid} % The first column
\begin{alertblock}{Objectives}
Lorem ipsum dolor sit amet, consectetur, nunc tellus pulvinar tortor, commodo eleifend risus arcu sed odio:
Mollis dignissim, magna augue tincidunt dolor, interdum vestibulum urna
Sed aliquet luctus lectus, eget aliquet leo ullamcorper consequat. Vivamus eros sem, iaculis ut euismod non, sollicitudin vel orci.
Nascetur ridiculus mus.
\end{alertblock}
\end{column}
\end{columns} % End of all the columns in the poster
\end{frame} % End of the enclosing frame
\end{document}