未定义的控制序列 \background{1. 1. 1.}{1. 1. 1.}{0.5}

未定义的控制序列 \background{1. 1. 1.}{1. 1. 1.}{0.5}

我在用MikTex 2.9TeXstudio2.3准备海报a0尺寸使用下面给出的代码

\documentclass[portrait,a0b,final]{a0poster}    
\usepackage[utf8]{inputenc}   
\usepackage{epsfig}   
\usepackage{multicol}   
\usepackage{pstricks,pst-grad}  
\usepackage[english]{babel}  
\usepackage{graphicx}    
\usepackage{amsmath}  
\usepackage{amsfonts}  
\usepackage{amsopn}  
\usepackage{amsbsy}  
\usepackage{color}  
\usepackage{hyperref}  
\hypersetup{  
        colorlinks={true},  
        filecolor={0.19,0.27,0.69},  
        urlcolor={blue},  
        linkcolor={red},  
        citecolor={black},  
        }  
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
\setlength{\columnsep}{1cm}%3  
\setlength{\columnseprule}{2mm}  
\setlength{\parindent}{0.0cm}  
\addtolength{\textwidth}{2cm}  
\addtolength{\textheight}{5cm}  
\addtolength{\hoffset}{-1.25cm}  
%\addtolength{\voffset}{-1.0cm}  
\newcommand\email[1]{{\tt\href{mailto:#1}{#1}}}  
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
%%%               Background                     %%%  
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
\newcommand{\background}[3]{\leavevmode%  
  \newrgbcolor{cgradbegin}{#1}%  
  \newrgbcolor{cgradend}{#2}%  
  \psframe[fillstyle=gradient,gradend=cgradend,  
  gradbegin=cgradbegin,gradmidpoint=#3]  
  (-1in,3.5in)(\paperwidth,-\paperheight)}  
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
 %%%                Poster                        %%%  
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
\newenvironment{poster}  
 {\noindent  
  \begin{minipage}[t]{1\textwidth}}  
 {\end{minipage}}  
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
%%%                pcolumn                       %%%  
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
\newenvironment{pcolumn}[1]{%  
 \begin{minipage}[t]{#1\textwidth}  
 \begin{center}%  
  }{%  
  \end{center}%  
  \end{minipage}%  
 }  
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
%%%                pbox                          %%%  
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
\newrgbcolor{lcolor}{0. 0. 0.80}  
\newrgbcolor{gcolor1}{1. 1. 1.}  
\newrgbcolor{gcolor2}{.80 .80 1.}  
\newcommand{\pbox}[4]{%  
  \psshadowbox[#3]{%  
   \begin{minipage}[t][#2][t]{#1}#4\end{minipage}}}  
\begin{document}  
\background{0.3 0.4 0.7}{0.3 0.7 0.3}{0.3}  
%{0.2 0.3 0.8}{0.1 0.6 0.2}{0.3} - 3  
%{0.3 0.4 0.7}{0.3 0.7 0.3}{0.3} - 2  
%{0.3 0.7 0.3}{0.3 0.7 0.9}{0.3} - 1  
%{0.2 0.7 0.9}{0.3 0.7 0.3}{0.5}  
%\vspace*{2cm}  
\newrgbcolor{lightblue}{0. 0. 0.80}  
\newrgbcolor{white}{1. 1. 1.}  
\newrgbcolor{whiteblue}{.80 .80 1.}  
\begin{poster}  
\begin{center}  
 \begin{pcolumn}{0.98}  
  \pbox{0.965\textwidth}{}{linewidth=2mm,framearc=0.3,linecolor=lightblue,  
   fillstyle=gradient,gradangle=0,gradbegin=white,gradend=whiteblue,  
   gradmidpoint=1.0,framesep=1em}  
  {  
     \begin{minipage}[c][9.5cm][c]{0.78\textwidth}  
     \begin{center}  
      {\sc \Huge Title}\\[3mm]  
      {\sc \Huge More Title }\\[4mm]  
      {\Large \textbf{Author}}\\[6.5mm]  
        \textit{$^1$ Filliation }\\[4mm]  
    \end{center}  
   \end{minipage}  
  }  
  \end{pcolumn}  
  \end{center}  
\begin{center}  
\begin{pcolumn}{0.32}  
   \pbox{0.9\textwidth}{40.25cm}                                                      {linewidth=2mm,framearc=0.1,linecolor=lightblue,  
  fillstyle=gradient,gradangle=0,gradbegin=white,gradend=white,  
  gradmidpoint=1.0,framesep=1em}  
{  
  \begin{center}  
    \pbox{0.8\textwidth}    {}{shadow=true,shadowsize=1mm,linewidth=2mm,framearc=0.5,  
      linecolor=lightblue,fillstyle=gradient,gradangle=0,gradbegin=white,  
      gradend=whiteblue,gradmidpoint=1.0,framesep=1em}  
    {  
      \begin{center}  
        \bf{Motivation}  
      \end{center}  
    }  
  \end{center}  
  \vspace{1.25cm}  
  % 
  Text here. Use Maldacena conjecture \cite{Maldacena98}.  
  % 
  % 
  blabla  
  % 
}  
\vspace*{1cm}  
\pbox{0.9\textwidth}{53.75cm}      {linewidth=2mm,framearc=0.1,linecolor=lightblue,  
     fillstyle=gradient,gradangle=0,gradbegin=white,gradend=white,gradmidpoint=1.0,  
  framesep=1em}  
{  
    % \vspace{2cm}  
    \begin{center}  
      \pbox{0.8   \textwidth}                                                                 {}{shadow=true,shadowsize=1mm,linewidth=2mm,framearc=0.5,  
      linecolor=lightblue,fillstyle=gradient,gradangle=0,gradbegin=white,  
      gradend=whiteblue,gradmidpoint=1.0,framesep=1em}  
    {  
      \begin{center}  
        \bf{The Model}  
      \end{center}  
    }  
  \end{center}  
  \vspace{1.25cm}  
%  equation  
  %   
  \begin{equation}  
    \label{Intro:N=4metric}  
    a = b  
  \end{equation}  
  %   
  The relations between the parameters are illustrated below.  
  %   
    % 
  }  
  \end{pcolumn}  
 \begin{pcolumn}{0.32}  
\pbox{0.9\textwidth}{48.25cm}{linewidth=2mm,framearc=0.1,linecolor=lightblue,  
fillstyle=gradient,gradangle=0,gradbegin=white,gradend=white,  
gradmidpoint=1.0,framesep=1em}  
  {  
     % \vspace{2cm}  
     \begin{center}\pbox{0.8\textwidth}{}{shadow=true,shadowsize=1mm,linewidth=2mm,  
    framearc=0.5,linecolor=lightblue,fillstyle=gradient,gradangle=0,  
     gradbegin=white,gradend=whiteblue,gradmidpoint=1.0,framesep=1em}  
  {\begin{center}  
      \bf{Distance Function and String Configuration}  
    \end{center}  
  }  
  \end{center}  
  \vspace{1.25cm}  

  }  

\vspace*{1cm}  


 \pbox{0.9\textwidth}{45.75cm}{linewidth=2mm,framearc=0.1,linecolor=lightblue,  
 fillstyle=gradient,gradangle=0,gradbegin=white,gradend=white,gradmidpoint=1.0,  
framesep=1em}  
    {  
     % \vspace{2cm}  
   \begin{center}\pbox{0.8\textwidth}   {}{shadow=true,shadowsize=1mm,linewidth=2mm,  
    framearc=0.5,linecolor=lightblue,fillstyle=gradient,gradangle=0,  
    gradbegin=white,gradend=whiteblue,gradmidpoint=1.0,framesep=1em}  
  {\begin{center}\bf{Screening Distance}\end{center}}\end{center}                  \vspace{1.25cm}  


  }  

    \end{pcolumn}  

  \begin{pcolumn}{0.32}    


   \pbox{0.9\textwidth}{51.25cm}  {linewidth=2mm,framearc=0.1,linecolor=lightblue,  
  fillstyle=gradient,gradangle=0,gradbegin=white,gradend=white,gradmidpoint=1.0,  
framesep=1em}  
     {  
  \begin{center}  
   \pbox{0.8\textwidth}  {}{shadow=true,shadowsize=1mm,linewidth=2mm,framearc=0.5,  
    linecolor=lightblue,fillstyle=gradient,gradangle=0,gradbegin=white,  
      gradend=whiteblue,gradmidpoint=1.0,framesep=1em}  
    {  
      \begin{center}  
       \bf{Phase Structure of the Model}  
     \end{center}  
   }  
  \end{center}  
  \vspace{1.25cm}  

   yet more text  
   }  


    \vspace*{1cm}  


   \pbox{0.9\textwidth}{17.5cm}  {linewidth=2mm,framearc=0.1,linecolor=lightblue,  
  fillstyle=gradient,gradangle=0,gradbegin=white,gradend=white,gradmidpoint=1.0,  
framesep=1em}  
    {  
      % \vspace{2cm}  
   \begin{center}  
    \pbox{0.8\textwidth}   {}{shadow=true,shadowsize=1mm,linewidth=2mm,framearc=0.5,  
    linecolor=lightblue,fillstyle=gradient,gradangle=0,gradbegin=white,  
    gradend=whiteblue,gradmidpoint=1.0,framesep=1em}  
   {  
    \begin{center}  
      \bf{Outlook}  
    \end{center}  
   }  
   \end{center}  
   \vspace{1.25cm}  

    Do stuff in the future:  

   \begin{itemize}  
  \item Do stuff  
  \item Do even more exciting stuff  
   \end{itemize}  
 %  
 %  
 }  


 \vspace*{1cm}  
%   
 \pbox{0.9\textwidth}{22cm}{linewidth=2mm,framearc=0.1,linecolor=lightblue,  
    fillstyle=gradient,gradangle=0,gradbegin=white,gradend=white,gradmidpoint=1.0,  
framesep=1em}  
 {  



  \begin{center}  
  \pbox{0.8\textwidth}{}{shadow=true,shadowsize=1mm,linewidth=2mm,framearc=0.5,  
    linecolor=lightblue,fillstyle=gradient,gradangle=0,gradbegin=white,  
    gradend=whiteblue,gradmidpoint=1.0,framesep=1em}  
  {  
    \begin{center}  
      \bf{References}  
    \end{center}  
  }  
\end{center}  
\vspace{-1.75cm}  

  \renewcommand{\refname}{}  
   \renewcommand{\refname}{\begin{center}\pbox{0.73\textwidth}{}  {shadow=true,shadowsize=1mm,linewidth=2mm,framearc=0.5,linecolor=lightblue,fillstyle=gradient,gradangle=0,gradbegin=white,gradend=whiteblue,gradmidpoint=1.0,framesep=1em}  {\begin{center}\normalsize{\bf References}\end{center}}\end{center}}  

\begin{thebibliography}{99}   
  % \pagestyle{empty}  


 \bibitem {Maldacena98}  
 J.~M.~Maldacena, Adv.\ Theor.\ Math.\ Phys.\  {\bf 2} (1998) 231,    Int.\    J.\ Theor.\ Phys.\  {\bf 38} (1999) 1113 [arXiv:hep-th/9711200]    

 \end{thebibliography}  

 }  
\end{pcolumn}  
\end{center}  
\end{poster}  
\end{document} 

我收到这些错误

行 0:未定义的控制序列
行 71:未定义的控制序列 \background{0.3 0.4 0.7}{0.3 0.7 0.3}{0.3}
行 71:未定义的控制序列 \background{0.3 0.4 0.7}{0.3 0.7 0.3}{0.3}
行 0:未定义的控制序列
行 95:未定义的控制序列 }
行 0:未定义的控制序列
行 95:未定义的控制序列 }
行 95:未定义的控制序列 }
行 71:段落中 \hbox 过满(宽 14.73395pt) 行
0:\output 处于活动状态时发生 \vbox 过满(高 5414.5928pt) []*
运行时pdfLatex

答案1

这不是答案,而是发现错误。改正错误由你决定。

有很多事情需要指出:

  1. 错误

    第 71 行:未定义控制序列 \background{0.3 0.4 0.7}{0.3 0.7 0.3}{0.3}

    源于这样一个事实:你正在使用pdflatex进行编译,而你的\background被定义为

    \newcommand{\background}[3]{\leavevmode%
      \newrgbcolor{cgradbegin}{#1}%
      \newrgbcolor{cgradend}{#2}%
      \psframe[fillstyle=gradient,gradend=cgradend,
       gradbegin=cgradbegin,gradmidpoint=#3]
       (-1in,3.5in)(\paperwidth,-\paperheight)}
    

    使用 pstricks。使用xelatexlatexdviPSpdf

  2. 您正在poster使用以下方式定义环境minipage

     \newenvironment{poster}
       {\noindent
         \begin{minipage}[t]{1\textwidth}}
       {\end{minipage}}
    

    并继续填充文本。这minipage是一个牢不可破的盒子,您的内容在页面下方运行,导致badboxes。

  3. \begin{center}在许多地方都使用了。这会浪费一些额外的垂直空间。您可以\centering在 内改用minipage

xelatex从你的代码中得到了这个:

在此处输入图片描述

第一页为空是因为您的poster环境太大,无法容纳。LaTeX 拼命尝试,将其移动到第二页,使第一页保持空白。

相关内容