孤独的 \item - 可能缺少列表环境

孤独的 \item - 可能缺少列表环境

我的问题是:

我在 Mac 上使用。在 Linux 中,我的文件moderncv编译正常。然而,在 Mac 中,我运行一切正常,但当我再次运行时,我收到错误splitbibpdflatexbibtexpdflatex

孤独的 \item - 可能缺少列表环境

这是 MWE。第一部分是标准的moderncv,然后我用splitbib它来制作几个部分的参考书目。然后有两个 CV 部分,其中有一个条目只是为了完整性,最后,我链接到 bib 文件。

\documentclass[11pt,a4paper]{moderncv}
\moderncvtheme[blue]{classic}                 % optional argument are 'blue' (default), 'orange', 'red', 'green', 'grey' and 'roman' (for roman fonts, instead of sans serif fonts)
\usepackage[utf8]{inputenc}                   % replace by the encoding you are using
\usepackage{url}
\usepackage[scale=0.8]{geometry}
\AtBeginDocument{\recomputelengths}                     % required when changes are made to page layout lengths

\firstname{MyName}
\familyname{MyLastName}

% SPLITBIB
\usepackage[export]{splitbib} % So I can display publications by categories.
\begin{category}{\subsection{Press}}
\SBentries{press1}
\end{category}
\begin{category}{\subsection{Presentations}}
 \SBentries{pres1,pres2}
\end{category}
\begin{category}{\subsection{Papers}}
 \SBentries{paper1,paper2}
\end{category}

% BEGIN DOC
\begin{document}
\maketitle

\section{Education}
\cventry{2005--2010}{Deg}{Some U}{Someplace}{Computer Science}{Some notes}

\subsection{Professional}
\cventry{2000--2005}{Technical Specialist}{Some company}{Some City}{}{Some description} 

\renewcommand{\listitemsymbol}{-} % change the symbol for lists

\nocite{*}

%BIBLIOGRAPHY
\SBtitlestyle{simple}
%\SBsubtitlestyle{none}
\bibliographystyle{plain}
\bibliography{publications}     % 'publications' is the name of a BibTeX file

\end{document}

为了完整起见,如果有人想尝试一下,这里是与此 MWE 一起使用的示例 publications.bib。

@UNPUBLISHED{pres1,
  author = {John Doe},
  title = {Some title},
  note = {Presentation at XYZ},
  month = {July.},
  year = {2010}
  }

@UNPUBLISHED{pres2,
  author = {First Guy and Second Guy},
  title = {Some title},
  note = {Presentation at some University},
  month = {Nov.},
  year = {2008}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% PAPERS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@inproceedings{paper1,
    author = {Author One and Author Two},
    booktitle = {Anyone can get a Book},
    posted-at = {2010-07-23 15:33:06},
    publisher = {Springer},
    editor = {John Doe and Juan Perez},
    title = {Some Catchy Title},
    year = {2012}
}
@inproceedings{paper2,
  author    = {Author one and Author two},
  title     = {Complicated Title},
  booktitle = {pretentious journal},
  year      = {2011},
  pages     = {568-577}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Press
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %author    = {Phil McKenna},
@misc{press1,
  month     = {March},
  author   = {{New Scientist}},
  title     = {What you thought true is no more},
  howpublished = {\url{http://bit.ly/be0PpB}},
  year      = {2010}
}

答案1

来自文档

由于 [ splitbib] 深度重新定义了\bibitem环境thebibliography,因此必须在重新定义这些命令的包之后加载它......

但是moderncv,版本 2013/02/09 v1.3.0 类确实重新定义了这些命令。另一方面,moderncv设置了一些东西,以便multibib可以工作。您可以使用它来获取文件中的细分书目,bib如下所示:

示例输出

\documentclass[11pt,a4paper]{moderncv}
\moderncvtheme[blue]{classic}
\usepackage[utf8]{inputenc}  
\usepackage{url}
\usepackage[scale=0.8]{geometry}
\AtBeginDocument{\recomputelengths}

\firstname{MyName}
\familyname{MyLastName}

\usepackage{multibib}
\newcites{press}{Press}
\newcites{presentations}{Presentations}
\newcites{papers}{Papers}

% BEGIN DOC
\begin{document}
\nocitepress{press1}
\nocitepresentations{pres1,pres2}
\nocitepapers{paper1,paper2}

\maketitle

\section{Education}
\cventry{2005--2010}{Deg}{Some U}{Someplace}{Computer Science}{Some notes}

\subsection{Professional}
\cventry{2000--2005}{Technical Specialist}{Some company}{Some City}{}{Some description} 

\section{Publications}

\bibliographystylepress{plain}
\bibliographypress{publications} 

\bibliographystylepresentations{plain}
\bibliographypresentations{publications} 

\bibliographystylepapers{plain}
\bibliographypapers{publications} 

\end{document}

通过编译

pdflatex file
bibtex press
bibtex presentations
bibtex papers
pdflatex file
pdflatex file

相关内容