由于“\nobibliography”,我在两个段落之间出现了空白

由于“\nobibliography”,我在两个段落之间出现了空白

我的简历中两段之间有 5 或 6 行空白。此空白是由于参考行造成的:

\nobibliography{publications.bib}
\bibliographystyle{unsrt}

如果我删除这两行,空格就会消失,但我也无法使用引用。有什么好方法可以保留我的引用并且不显示这一行?我的文档如下所示:

在此处输入图片描述


下面显示了一个显示此问题的最小短文件。我只在 overleaf 上编译过此文件,我不确定其他地方是否也存在此问题,或者这是否重要。

该 .tex 文件包含以下行:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%   PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\documentclass{resume} % Use the custom resume.cls style
\usepackage[compact]{titlesec}
\titlespacing{\section}{0pt}{*0}{*0}
\titlespacing{\subsection}{0pt}{*0}{*0}
\titlespacing{\subsubsection}{0pt}{*0}{*0}

\usepackage{enumitem}
\usepackage[bottom]{footmisc}



%%%%%%%%%%%%%%%%%%
\usepackage{hyperref}
\hypersetup{
    colorlinks = true,
    linkbordercolor = {white},
    urlcolor = blue,
}
%%%%%%%%%%%%%%%%%%%
\usepackage[left=0.4in,top=0.4in,right=0.4in,bottom=0.4in]{geometry} % Document margins

\name{First Name Last Name} % Your name
 % Your address


\address{Address}

\address{
}

% \address{(618)~$\cdot$~525~$\cdot$~0387 \\ [email protected]}  
\address{( \\ \href{}{Email:email}}  


%%-------------------------------------------------------------------------
%%  BIBLIOGRAPHY PACKAGE DELETE THESE IF COMPILE ERROR ------------
\usepackage{apacite}
\usepackage[left=2.5cm,right=2.5cm,top=1.5cm,bottom=2.5cm]{geometry}

\usepackage{bibentry}
% \usepackage{cite}
\makeatletter\let\saved@bibitem\@bibitem\makeatother
\usepackage[colorlinks=true]{hyperref}
\makeatletter\let\@bibitem\saved@bibitem\makeatother

\usepackage{hanging}
\newcommand\publication[1]{%
    \smallskip\par\hangpara{1.5em}{1}\bibentry{#1}\smallskip
}

%%-------------------------------------------------------------------------


\begin{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%   EDUCATION SECTION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{rSection}{Education}

{\bf University} \hfill {} \\ 
\end{rSection}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%------------------------Work and Industrial Experience
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{rSection}{Experience}

\begin{rSubsection}{BAU}{Oct 2015 - Nov 2015}{Industrial Trainee}{}
\item Learned the basic operation.
\end{rSubsection}

\end{rSection}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%------------------ Leadership
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{rSection}{Leadership}

\begin{rSubsection}{ Volunter etc}{July 2016 - Oct 2016}{Instructor}{Location}
\item Developed and instructed a two month-long programming and signal processing course.
\end{rSubsection}

\begin{rSubsection}{Chief Organizer}{September 2016}{Competition}

\item Organized and directed the coding contest 2016 - a large scale EE event.
\item Set the contest problems and judged the event.
\end{rSubsection}
\end{rSection}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%------------------ PUBLICATIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\nobibliography{publications.bib}
\bibliographystyle{unsrt} 

\begin{rSection}{Publications}

\begin{rSubsection}{Peer-Reviewed Publications}{}{}{}
\publication{Author1t2018}

\publication{Author22018}

\publication{Author32018}

\end{rSubsection}


\end{rSection}
\end{document}

.cls 文件在这里:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Medium Length Professional CV - RESUME CLASS FILE
%
% This template has been downloaded from:
% http://www.LaTeXTemplates.com
%
% This class file defines the structure and design of the template. 
%
% Original header:
% Copyright (C) 2010 by Trey Hunner
%
% Copying and distribution of this file, with or without modification,
% are permitted in any medium without royalty provided the copyright
% notice and this notice are preserved. This file is offered as-is,
% without any warranty.
%
% Created by Trey Hunner and modified by www.LaTeXTemplates.com
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\ProvidesClass{resume}[2010/07/10 v0.9 Resume class]

\LoadClass[9pt,letterpaper]{article} % Font size and paper type

\usepackage[parfill]{parskip} % Remove paragraph indentation
\usepackage{array} % Required for boldface (\bf and \bfseries) tabular columns
\usepackage{ifthen} % Required for ifthenelse statements

\pagestyle{empty} % Suppress page numbers

%----------------------------------------------------------------------------------------
%   HEADINGS COMMANDS: Commands for printing name and address
%----------------------------------------------------------------------------------------

\def \name#1{\def\@name{#1}} % Defines the \name command to set name
\def \@name {} % Sets \@name to empty by default

\def \addressSep {$\diamond$} % Set default address separator to a diamond

% One, two or three address lines can be specified 
\let \@addressone \relax
\let \@addresstwo \relax
\let \@addressthree \relax

% \address command can be used to set the first, second, and third address (last 2 optional)
\def \address #1{
  \@ifundefined{@addresstwo}{
    \def \@addresstwo {#1}
  }{
  \@ifundefined{@addressthree}{
  \def \@addressthree {#1}
  }{
     \def \@addressone {#1}
  }}
}

% \printaddress is used to style an address line (given as input)
\def \printaddress #1{
  \begingroup
    \def \\ {\addressSep\ }
    \centerline{#1}
  \endgroup
  \par
  \addressskip
}

% \printname is used to print the name as a page header
\def \printname {
  \begingroup
    \hfil{\MakeUppercase{\namesize\bf \@name}}\hfil
    \nameskip\break
  \endgroup
}

%----------------------------------------------------------------------------------------
%   PRINT THE HEADING LINES
%----------------------------------------------------------------------------------------

\let\ori@document=\document
\renewcommand{\document}{
  \ori@document  % Begin document
  \printname % Print the name specified with \name
  \@ifundefined{@addressone}{}{ % Print the first address if specified
    \printaddress{\@addressone}}
  \@ifundefined{@addresstwo}{}{ % Print the second address if specified
    \printaddress{\@addresstwo}}
     \@ifundefined{@addressthree}{}{ % Print the third address if specified
    \printaddress{\@addressthree}}
}

%----------------------------------------------------------------------------------------
%   SECTION FORMATTING
%----------------------------------------------------------------------------------------

% Defines the rSection environment for the large sections within the CV
\newenvironment{rSection}[1]{ % 1 input argument - section name
  \sectionskip
  \MakeUppercase{\bf #1} % Section title
  \sectionlineskip
  \hrule % Horizontal line
  \begin{list}{}{ % List for each individual item in the section
    \setlength{\leftmargin}{1.5em} % Margin within the section
  }
  \item[]
}{
  \end{list}
}

%----------------------------------------------------------------------------------------
%   WORK EXPERIENCE FORMATTING
%----------------------------------------------------------------------------------------

\newenvironment{rSubsection}[4]{ % 4 input arguments - company name, year(s) employed, job title and location
 {\bf #1} \hfill {#2} % Bold company name and date on the right
 \ifthenelse{\equal{#3}{}}{}{ % If the third argument is not specified, don't print the job title and location line
  \\
  {\em #3} \hfill {\em #4} % Italic job title and location
  }\smallskip
  \begin{list}{$\cdot$}{\leftmargin=0em} % \cdot used for bullets, no indentation
   \itemsep -0.5em \vspace{-0.5em} % Compress items in list together for aesthetics
  }{
  \end{list}
  \vspace{0.5em} % Some space after the list of bullet points
}

% The below commands define the whitespace after certain things in the document - they can be \smallskip, \medskip or \bigskip
\def\namesize{\huge} % Size of the name at the top of the document
\def\addressskip{\smallskip} % The space between the two address (or phone/email) lines
\def\sectionlineskip{\smallskip % The space above the horizontal line for each section 
\def\nameskip{\bigskip} % The space after your name at the top
\def\sectionskip{\medskip} % The space after the heading section

最后,参考书目 .bib 文件在这里:

@article{Author1t2018,
  title={Title of the paper in Conference},
  author={FirstName LastName and FirstName LastName and FirstName LastName },
  journal={IEEE ICEECS 2018, Conference.},
  year={2018}}

@article{Author22018,
  title={Title of the paper in Conference},
  author={ FirstName LastName and FirstName LastName and FirstName LastName},
  journal={IEEE R10HTC 2017, Conference},
  year={2017},
  publisher={IEEE}}

 @article{Author32018,
  title={Metal nanoparticle enhanced light absorption in GaAs thin-film solar cell.},
  author={FirstName LastName and FirstName LastName and FirstName LastName},
  volume={3},
  year={1998},
  publisher={Pearson Education}}

答案1

natbib之前导入的版本bibentry已修复了 overleaf 上的错误。

\usepackage{natbib}
\usepackage{bibentry}

相关内容