如何删除空白的摘要和关键词部分的两行?

如何删除空白的摘要和关键词部分的两行?

我怎样才能摆脱由空的抽象和关键字部分产生的两行?谢谢。

在此处输入图片描述

代码如下

\documentclass[preprint,12pt]{elsarticle}

\usepackage[nodots]{numcompress}

\biboptions{sort&compress}

\journal{A Journal}

\begin{document}

\begin{frontmatter}

  \title{My Title}

  \author[myaddr]{Author 1}
  \author[myaddr]{Author 2}
  \address[myaddr]{An Address}

  %% \begin{abstract}                                                                                                                                          
  %%   Here's an abstract.                                                                                                                                     
  %% \end{abstract}                                                                                                                                            

  %% \begin{keyword}                                                                                                                                           
  %%   keyword1 \sep keyword2 \sep keyword3                                                                                                                    
  %% \end{keyword}                                                                                                                                             

\end{frontmatter}
\section{Introduction}
\label{intro}


\end{document}

答案1

我不得不把这个numcompress包注释掉。

相关行包含在 中\pprintMaketitle,是两个\hrule语句。为了快速解决问题,我注释了这些\hrule语句:

\documentclass[preprint,12pt]{elsarticle}

\makeatletter
\long\def\pprintMaketitle{\clearpage
  \iflongmktitle\if@twocolumn\let\columnwidth=\textwidth\fi\fi
  \resetTitleCounters
  \def\baselinestretch{1}%
  \printFirstPageNotes
  \begin{center}%
 \thispagestyle{pprintTitle}%
 \def\baselinestretch{1}%
    \Large\@title\par\vskip18pt
    \normalsize\elsauthors\par\vskip10pt
    \footnotesize\itshape\elsaddress\par\vskip36pt
%    \hrule\vskip12pt
    \ifvoid\absbox\else\unvbox\absbox\par\vskip10pt\fi
    \ifvoid\keybox\else\unvbox\keybox\par\vskip10pt\fi
%    \hrule\vskip12pt
    \end{center}%
  \gdef\thefootnote{\arabic{footnote}}%
  }
\makeatother

%\usepackage[nodots]{numcompress}

\biboptions{sort&compress}

\journal{A Journal}

\begin{document}

\begin{frontmatter}

  \title{My Title}

  \author[myaddr]{Author 1}
  \author[myaddr]{Author 2}
  \address[myaddr]{An Address}

  %% \begin{abstract}                                                                                                                                          
  %%   Here's an abstract.                                                                                                                                     
  %% \end{abstract}                                                                                                                                            

  %% \begin{keyword}                                                                                                                                           
  %%   keyword1 \sep keyword2 \sep keyword3                                                                                                                    
  %% \end{keyword}                                                                                                                                             

\end{frontmatter}
\section{Introduction}
\label{intro}


\end{document}

编辑一个稍微简短的版本,带有xpatch包:

\documentclass[preprint,12pt]{elsarticle}

\usepackage{xpatch}

% Patching the \hrule\vskip12pt out .. do it twice!!!
\makeatletter
\xpatchcmd{\pprintMaketitle}{%
  \hrule\vskip12pt%
}{}{\typeout{Success}}{}

% Injection the date as a replacement of the 2nd `\hrule` stuff
\xpatchcmd{\pprintMaketitle}{%
  \hrule\vskip12pt%
}{\@date}{\typeout{Success}}{}
\makeatother

%\usepackage[nodots]{numcompress}

\biboptions{sort&compress}

\journal{A Journal}

\begin{document}

\begin{frontmatter}
\title{Theory on Brontosaurs}

\author[myaddr]{Anne Elk (Misses)}
\author[myaddr]{Arthur Gumby (Brain specialist)}
\address[myaddr]{Ministry of Silly Walks}

  %% \begin{abstract}                                                                                                                                          
  %%   Here's an abstract.                                                                                                                                     
  %% \end{abstract}                                                                                                                                            

  %% \begin{keyword}                                                                                                                                           
  %%   keyword1 \sep keyword2 \sep keyword3                                                                                                                    
  %% \end{keyword}                                                                                                                                             

\end{frontmatter}
\section{Introduction}
\label{intro}


\end{document}

在此处输入图片描述

相关内容