使用 multibib 套件的書目標題和內容之間的文本

使用 multibib 套件的書目標題和內容之間的文本

我想在參考書目標題和內容之間寫一些文字。

我試圖解決這個解決方案但它不適用於 multibib 套件。謝謝。

% arara: xelatex
% arara: bibtex: { files: [ main, B , A ] }
% arara: xelatex
% arara: xelatex
% arara: clean1

\documentclass{report}

\usepackage{etoolbox}
\newcommand{\bibpreface}[1]{\patchcmd{\thebibliography}{\list}{#1\list}{}{}}

\usepackage[resetlabels,labeled]{multibib}

\usepackage{xepersian}
\settextfont{XB Niloofar}
\newcommand{\ReferenceDocuments}{\rl{مستندات مرجع}}
\newcommand{\RelevantDocumentation}{\rl{مستندات ذیربط}}
\newcites{A,B}{\ReferenceDocuments%
,
\RelevantDocumentation}
\begin{document}
یک استناد به مستندات مرجع
 \cite{bb} 
 یک استناد به مستندات ذیربط
  \citeA{aa}
  یک استناد به مراجع اصلی
 \citeA{cc}
 یک استناد دیگر 
 \citeB{dd}

\renewcommand{\refname}{\rl{مراجع}}
\bibpreface{مقداری متن قبل از محتویات\\}
\bibliographystyle{plain-fa}
\bibliography{lit}

\bibliographystyleA{plain}
\bibliographyA{lit}         

\bibliographystyleB{plain}
\bibliographyB{lit}          

\end{document}

lit.bib

@Article{aa,
  author =   {Author, A.},
  title =    {Title},
  journal =  {Journal},
  year =     2000
}

@ARTICLE{bb,
  AUTHOR =  {واحدی, مصطفی},
  TITLE =  {درختان پوشای کمینه دورنگی مسطح},
  JOURNAL =  {مجله فارسی نمونه},
  VOLUME =  {1},
  YEAR =  {1387},
  NUMBER =  {2},
  MONTH =  {آبان},
  PAGES =  {22-30},
  LANGUAGE =   {Persian}
}

@ARTICLE{dd,
  AUTHOR =  {بهبودی‌فام, حسین},
  TITLE =  {یک عنوان درست و درمون},
  JOURNAL =  {مجله فارسی نمونه},
  VOLUME =  {1},
  YEAR =  {1387},
  NUMBER =  {2},
  MONTH =  {آبان},
  PAGES =  {22-30},
  LANGUAGE =   {Persian}
}

@ARTICLE{cc,
  AUTHOR =  {بهبودی, احمد},
  TITLE =  {یک عنوان درست و درمون},
  JOURNAL =  {مجله فارسی نمونه},
  VOLUME =  {1},
  YEAR =  {1387},
  NUMBER =  {2},
  MONTH =  {آبان},
  PAGES =  {22-30},
  LANGUAGE =   {Persian}
}

答案1

一種選擇是使用 biblatex 的「內部結構」:

\documentclass{report}

\usepackage{hyperref}
% \usepackage{xepersian}
% \settextfont{XB Niloofar}

% bibliography
\usepackage[natbib = true,         % true allows usage of citet, citep etc. commands
    style = authoryear,             % numeric, % trad-plain: use old bibtex plain style
    backend = biber,                %
    hyperref = true,                % 
    giveninits = true,              % first names are reduced to initials
    maxbibnames = 8, maxcitenames = 2, %
    uniquename = init, 
    uniquelist = minyear, 
    doi = false, url = false, isbn = false, eprint = false] % supress all id numbers
    {biblatex} %
\addbibresource{lit.bib}

% categories
\DeclareBibliographyCategory{published}
\DeclareBibliographyCategory{conf}

% add papers to categories
\addtocategory{published}{aa}
\addtocategory{published}{dd}
\addtocategory{conf}{bb}
\addtocategory{conf}{cc}

% 
\defbibfilter{pub}{category=published}
\defbibfilter{conf}{category=conf}

\begin{document}
    \nocite{*}

    \defbibnote{A}{During the course of this thesis my research has contributed to the following publications:}
    \defbibnote{B}{Conference papers}

    \printbibliography[
        title = {Peer-reviewed journals},
        heading=subbibliography,
        filter = pub,
        prenote = A
        ]
    \printbibliography[
        title = {Conference contributions},
        heading=subbibliography,
        filter = conf,
        prenote = B
    ]
\end{document}

您必須使用 biber 而不是 bibtex 來編譯它,最好latexmk也可以根據需要經常編譯文件(並且您不必關心如何呼叫 biber)。指令很簡單latexmk -pdf -xelatex <yourfile>

很抱歉,我必須更改參考書目,因為我缺少波斯字體:

@Article{aa,
  author =   {Author, A.},
  title =    {Title A},
  journal =  {Journal},
  year =     2000
}

@ARTICLE{bb,
  AUTHOR =  {Author, B.},
  TITLE =  {Title B},
  JOURNAL =  {Journal B},
  VOLUME =  {1},
  YEAR =  {1387},
  NUMBER =  {2},
  MONTH =  {آبان},
  PAGES =  {22-30},
  LANGUAGE =   {Persian}
}

@ARTICLE{dd,
  AUTHOR =  {Author, C.},
  TITLE =  {Title C},
  JOURNAL =  {Journal C},
  VOLUME =  {1},
  YEAR =  {1387},
  NUMBER =  {2},
  MONTH =  {آبان},
  PAGES =  {22-30},
  LANGUAGE =   {Persian}
}

@ARTICLE{cc,
  AUTHOR =  {Author, D.},
  TITLE =  {Title D},
  JOURNAL =  {Journal D},
  VOLUME =  {1},
  YEAR =  {1387},
  NUMBER =  {2},
  MONTH =  {آبان},
  PAGES =  {22-30},
  LANGUAGE =   {Persian}
}

輸出: 在此輸入影像描述


編輯:使用 bibtex 和 multibib (注意這感覺像是一個殘酷的黑客,可能是...):

\documentclass{report}

\usepackage{hyperref}
% \usepackage{xepersian}
% \settextfont{XB Niloofar}

\usepackage[resetlabels,labeled]{multibib}
\newcites{A,B}
{{BibTitle A\newline\vspace{2ex}\newline\mdseries\normalsize Description text for this bibliography A},% 
 {BibTitle B\newline\vspace{2ex}\newline\mdseries\normalsize Description text for this bibliography B}%
}

\begin{document}

    \nociteA{aa,cc}
    \bibliographystyleA{plain}
    \bibliographyA{lit}         

    \nociteB{bb,dd}
    \bibliographystyleB{plain}
    \bibliographyB{lit}
\end{document}

您可以嘗試調整標題和文字之間新增的垂直距離。然而我在 multibib 手冊中沒有找到解決方案。似乎只有標題,沒有介紹文字。
輸出(僅 fpr Bib A,因為另一個被設定為報告類別中的新頁面):

在此輸入影像描述

答案2

另一種方法(我認為更輕量級)是使用此技術刪除標頭:使用沒有額外標題的多書目

然後在適當的地方手動添加標題。

相關內容