参考:

参考:

我想按照相反的顺序对参考书目项目进行编号——使用moderncv参考书目plainnat样式。

参考:

Enrico 的回答:Bibtex 反向编号

我尝试使用 Enrico 的代码,但使用了moderncvplainnat(因为我想要 issn、doi 等)。但是没有任何错误和警告,我无法成功。

这是完全不起作用的代码。抱歉代码很长,但它包含必要的 bib 数据,实际代码在底部,并且很少。这需要该文件modercv.cls.sty文件(来自http://www.LaTeXTemplates.com) 放在同一目录中。

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% "ModernCV" CV and Cover Letter
% LaTeX Template
% Version 1.1 (9/12/12)
%
% This template has been downloaded from:
% http://www.LaTeXTemplates.com
%
% Original author:
% Xavier Danaux ([email protected])
%
% License:
% CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)
%
%% Important note:  %% <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
% This template requires the moderncv.cls and .sty files to be in the same
% directory as this .tex file. These files provide the resume style and themes
% used for structuring the document.

%%%--------------------------Uncomment if bib files are needed---------------------------------%%

%\begin{filecontents}{mypub.bib}
%@Article{johnson-74,
%  author =       "G. B. Johnson",
%  title =        "Enzyme Polymorphism",
%  journal =      "Science",
%  volume =       "184",
%  pages =        "28--37",
%  year =         "1974",
%}
%
%@Article{johnson-howells,
%  author =       "G. B. Johnson and W. W. Howells",
%  title =        "Title title title title title title title title title
%                 title",
%  journal =      "Journal journal journal",
%  year =         "1974",
%}
%
%@Article{johnson-etc,
%  author =       "G. B. Johnson and W. W. Howells and A. N. Other",
%  title =        "Title title title title title title title title title
%                 title",
%  journal =      "Journal journal journal",
%  year =         "1976",
%}
%
%@Manual{anon-67,
%  author =       "Anon.",
%  title =        "Title title title title title title title title title
%                 title",
%  organization = "Organization organization organization",
%  year =         "1967",
%}
%
%@Article{aslin-49,
%  author =       "E. J. Aslin",
%  title =        "Photostat recording in library work",
%  journal =      "Aslib Proceedings",
%  year =         "1949",
%  volume =       "1",
%  pages =        "49--52",
%}
%
%@Article{fletcher-hopkins,
%  author =       "W. M. Fletcher and F. G. Hopkins",
%  title =        "Lactic Acid in Amphibian Muscle",
%  journal =      "J. Physiol.",
%  year =         "1907",
%  volume =       "35",
%  pages =        "247--309",
%}
%
%\end{filecontents}
%%%-conference bib data --------------------------
%\begin{filecontents}{mypub-conf.bib}
%@CONFERENCE{Raja2007a,
%  author = { R. Ganesh and Harish Kumar},
%  title = {Title of the paper Power Industry},
%  booktitle = {39\textsuperscript{th} North American Power Symposium},
%  year = {2007},
%  number = {978-1-4244-1726-1},
%  address = {USA},
%  month = {September 10--14,},
%  organization = {New Mexico State University},
%  publisher = {IEEE},
%  owner = {Anupama},
%  timestamp = {2013.01.26}
%}
%
%@CONFERENCE{Rac2010,
%  author = {R. Rajesh and Harish Kumar},
%  title = {Title of the paper Transfer Capability},
%  booktitle = {International Conference on Computer Applications in Electrical Engineering
%   Recent Advances},
%  year = {2010},
%  address = {Roorkee},
%  month = {February 19--21,},
%  organization = {IIT Roorkee},
%  publisher = {IEEE},
%  owner = {hcl},
%  timestamp = {2013.01.24}
%}
%
%@CONFERENCE{CRa2009,
%  author = {R. Rajesh and Harish Kumar},
%  title = {Title of the paper Using Differential Evolution},
%  booktitle = {International Conference on Control, Automation, Communication and
%   Energy Conservation},
%  year = {2009},
%  address = {Erode},
%  month = {June 4--6,},
%  publisher = {IEEE},
%  owner = {Anupama},
%  timestamp = {2013.01.26}
%}
%
%@CONFERENCE{Raj2007,
%  author = {R. Rajesh and Harish Kumar},
%  title = {Title of the paper deregulated
%   Environment},
%  booktitle = {International Conference on Power Systems},
%  year = {2007},
%  address = {Bangalore},
%  month = {December 12--14,},
%  organization = {Central Power Research Institute},
%  publisher = {IEEE}
%}
%
%@CONFERENCE{CRy2006,
%  author = {R. Rajesh and Harish Kumar},
%  title = {Title of the paper},
%  booktitle = {IEEE Power India Conference},
%  year = {2006},
%  number = {240},
%  address = {New Delhi},
%  month = {April 12--14,},
%  organization = {IIT Delhi},
%  publisher = {IEEE}
%}
%\end{filecontents}

\documentclass[11pt,a4paper,sans]{moderncv}

\moderncvstyle{classic}
\moderncvcolor{orange}
\usepackage{uri}

%----------------------------------------------------------------------------------------
%   NAME AND CONTACT INFORMATION SECTION
%----------------------------------------------------------------------------------------

\firstname{Harish} % Your first name
\familyname{Kumar} % Your last name

% ????????????????? will this be needed???????????????//
\makeatletter
\renewcommand*{\bibliographyitemlabel}{\@biblabel{\arabic{enumiv}}}
\makeatother
%
%% bibliography with mutiple entries
\usepackage{multibib}
\newcites{journal,conference}{{Journals},{Conferences}}
\usepackage{natbib}
%%%------------------------------------------------------------------
%%% Reverse numbering of bibliography: Enrico's code from -- https://tex.stackexchange.com/a/75613/11232
\usepackage{etaremune}
\makeatletter
\long\def\thebibliography#1{%
  \subsection*{\refname}%
  \@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}
  \settowidth{\dimen0}{\@biblabel{#1}}%
  \setlength{\dimen2}{\dimen0}%
  \addtolength{\dimen2}{\labelsep}
  \sloppy
  \clubpenalty 4000
  \@clubpenalty
  \clubpenalty
  \widowpenalty 4000
  \sfcode `\.\@m
  \renewcommand{\labelenumiv}{\@biblabel{\theenumiv}} % labels like [3], [2], [1]
  \begin{etaremune}[labelwidth=\dimen0,leftmargin=\dimen2]\@openbib@code
}
\def\endthebibliography{\end{etaremune}}
\def\@bibitem#1{%
  \item \if@filesw\immediate\write\@auxout{\string\bibcite{#1}{\the\value{enumiv}}}\fi\ignorespaces
}
\makeatother

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

\listfiles

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

\begin{document}

\makecvtitle
%%------------------------------------------------------------------
\section{Publications}
\nocitejournal{*}
\bibliographystylejournal{plainnat}
\bibliographyjournal{mypub}
%
\nociteconference{*}
\bibliographystyleconference{plainnat}
\bibliographyconference{mypub-conf}

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

\end{document}

问题:

moderncv如何使用、、plainnatmultibib所有操作组合在一起来获得按降序编号的参考输出?

答案1

环境natbibthebibliography定义方式截然不同。以下提议有一个限制:不会为设置锚点hyperref,但它可以按要求工作。

\documentclass[11pt,a4paper,sans]{moderncv}

\moderncvstyle{classic}
\moderncvcolor{orange}
\usepackage{uri}

%----------------------------------------------------------------------------------------
%   NAME AND CONTACT INFORMATION SECTION
%----------------------------------------------------------------------------------------

\firstname{Harish} % Your first name
\familyname{Kumar} % Your last name

%% bibliography with multiple entries
\usepackage{multibib}
\newcites{journal,conference}{{Journals},{Conferences}}
\usepackage[numbers]{natbib}
%%%------------------------------------------------------------------
%%% Reverse numbering of bibliography
\usepackage{etaremune,etoolbox}
\makeatletter
\AtBeginDocument{%%% natbib redefines the environment there
\renewenvironment{thebibliography}[1]
 {\bibsection\parindent\z@\bibpreamble\bibfont
  \settowidth{\dimen0}{#1.}%
  \setlength{\dimen2}{\dimen0}%
  \addtolength{\dimen2}{\labelsep}
  \begin{etaremune}[labelwidth=\dimen0,leftmargin=\dimen2]
  \ifNAT@openbib
    \renewcommand\newblock{\par}%
  \else
    \renewcommand\newblock{\hskip.11em \@plus .33em \@minus .07em}%
  \fi
  \sloppy
  \clubpenalty4000
  \widowpenalty4000
  \sfcode`\.\@m
  \let\NAT@bibitem@first@sw\@firstoftwo
  \let\citeN\cite\let\shortcite\cite\let\citeasnoun\cite}
 {\bibitem@fin\bibpostamble
  \def\@noitemerr{\PackageWarning{natbib}{Empty `thebibliography' environment}}%
  \end{etaremune}
  \bibcleanup}
}%%% end of \AtBeginDocument

%%% patch \@lbibitem to use only \item (for etaremune)
\patchcmd{\@lbibitem}{\item[\hfil\NAT@anchor{#2}{\NAT@num}]}{\item}{}{}
\makeatother

\begin{document}

\makecvtitle
%%------------------------------------------------------------------
\section{Publications}
\nocitejournal{*}
\bibliographystylejournal{plainnat}
\bibliographyjournal{mypub}
%
\nociteconference{*}
\bibliographystyleconference{plainnat}
\bibliographyconference{mypub-conf}

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

\end{document}

在此处输入图片描述

相关内容