.bib 内のエントリの逆順の参考文献

.bib 内のエントリの逆順の参考文献

次のように入力すると:

@ARTICLE{article1,
  author  = {AAA}, 
  title = {New Method1},
  year    ={2013},
  journal = {SuperJournal},
}

@ARTICLE{article2,
  author  = {BBB}, 
  title = {New Method2},
  year    ={2013},
  journal = {SuperJournal},
}

望ましい順序は

[1] BBB、第2条、...

[2] AAA、第1条、…

言い換えれば、私は\bibliographystyle{unsrt}与えられたものの反対のものを望んでいます。誰かいますか?

編集。さらに情報を追加して質問を拡張します。multibib パッケージを使用して publications.bib からファイルをインポートしたいと思います。

 documentclass[11pt,a4paper,sans]{moderncv}
 \moderncvstyle{classic}                            
 \moderncvcolor{blue}                             

\makeatletter
\renewcommand*{\bibliographyitemlabel}{\@biblabel{\arabic{enumiv}}}
\makeatother
\renewcommand*{\bibliographyitemlabel}{[\arabic{enumiv}]}

% bibliography with mutiple entries
\usepackage{multibib}

\newcites{article}{{Articles}}

.
.
.

\section{Publications}

\nocitearticle{article1, article2}
\bibliographystylearticle{unsrt}
\bibliographyarticle{publications}  

\end{document}

答え1

参考文献スタイル を使用できますplain。編集手順は の規則に従って示されますarara

% arara: pdflatex
% arara: bibtex
% arara: pdflatex
% arara: pdflatex
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@ARTICLE{article1,
  author  = {AAA}, 
  title = {New Method1},
  year    ={2013},
  journal = {SuperJournal},
}

@ARTICLE{article2,
  author  = {BBB}, 
  title = {New Method2},
  year    ={2013},
  journal = {SuperJournal},
}
\end{filecontents}

\begin{document}
\cite{article2} and \cite{article1}
\bibliography{\jobname}
\bibliographystyle{plain}
\end{document}

結果: ここに画像の説明を入力してください

答え2

.bibファイルに異常がない場合、つまり@articleまたは@bookエントリのみが含まれている場合 (すべての種類のエントリがサポートされていますが、 または はサポートされていません@STRING) @COMMENT、次のようにします。

.bib逆の順序でキーのリストを構築してファイルを読み取り、関連する\nociteコマンドを発行します。

\begin{filecontents*}{\jobname.bib}
@ARTICLE{article1,
  author  = {AAA}, 
  title = {New Method1},
  year    ={2013},
  journal = {SuperJournal},
}

@ARTICLE{article2,
  author  = {BBB}, 
  title = {New Method2},
  year    ={2013},
  journal = {SuperJournal},
}

@ARTICLE{article3,
  author  = {CCC}, 
  title = {New Method2},
  year    ={2013},
  journal = {SuperJournal},
}

@ARTICLE{article4,
  author  = {DDD}, 
  title = {New Method2},
  year    ={2013},
  journal = {SuperJournal},
}

@ARTICLE{article5,
  author  = {EEE}, 
  title = {New Method2},
  year    ={2013},
  journal = {SuperJournal},
}
\end{filecontents*}

\documentclass{article}
\usepackage{xparse}
\ExplSyntaxOn
\NewDocumentCommand{\readbib}{ m }
 {
  \makaroni_readbib:n { #1 }
 }
\clist_new:N \g_makaroni_keys_clist

\group_begin:
\char_set_catcode_active:n { `\^^A }
\cs_new_protected:Npn \makaroni_readbib:n #1
 {
  \group_begin:
  \char_set_catcode_active:n { `\@ }
  \group_begin:
  \char_set_lccode:nn { `\^^A } { `\@ }
  \tl_to_lowercase:n
   {
    \group_end:
    \cs_set_eq:NN ^^A \__makaroni_active_at:w
   }
  \input{#1.bib}
  \group_end:
  \exp_args:Nx \nocite { \g_makaroni_keys_clist }
 }
\group_end:

\cs_new_protected:Npn \__makaroni_active_at:w #1#
 {
  \__makaroni_process_entry:n
 }
\cs_new_protected:Npn \__makaroni_process_entry:n #1
 {
  \__makaroni_add_key:w #1 \q_stop
 }
\cs_new_protected:Npn \__makaroni_add_key:w #1 , #2 \q_stop
 {
  \clist_gput_left:Nn \g_makaroni_keys_clist { #1 }
 }
\ExplSyntaxOff

\begin{document}

\readbib{\jobname}

\bibliographystyle{unsrt}
\bibliography{\jobname}

\end{document}

このfilecontents*環境は、例を自己完結型にするためだけのものです。

ここに画像の説明を入力してください

この方法は、 で使用されている方法と似ていますusebib.sty。 が@アクティブになり、最初の中括弧まで読み取るように定義されます。次に、エントリ全体を吸収する別のマクロが呼び出され、キーを分離してコンマ リスト変数の左側に追加する別のマクロが呼び出されます。次に、読み取り対象のファイルを終了した後、\nocite(展開された) clist の内容を引数としてコマンドが発行されます。

関連情報