列式参考书目

列式参考书目

困扰我多年的一个问题(http://newsgroups.derkeiler.com/Archive/Comp/comp.text.tex/2008-04/msg01387.html) 已经介绍了如何创建列式参考书目。例如,查看以下参考书目:

http://www.cgd.ucar.edu/staff/trenbert/trenberth.papers/UppalaERA05.pdf

在此处输入图片描述

这就是我想要的!理想情况下,我想要四列(作者、年份、期刊/来源、标题+页数),而不是示例中显示的三列(尽管这只是开始)。

答案1

这只是一个想法,当然可以根据您的需要进行扩展。我使用了该xpatch包。

\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{tabularx}
\usepackage{xpatch}
\usepackage{biblatex}
\addbibresource{biblatex-examples.bib}

\newcommand{\prebiba}{%
  \par\begin{tabularx}{\textwidth}{p{7em}p{2em}X}
    \usebibmacro{author}
    & \printdate
    & \clearname{author}\clearfield{year}}
\newcommand{\prebibe}{%
  \par\begin{tabularx}{\textwidth}{p{7em}p{2em}X}
    \usebibmacro{editor+others}
    & \printdate
    & \clearname{editor}\clearfield{year}}
\newcommand{\patchdrivers}{%
  \xpretobibdriver{article}{\prebiba}{}{}%
  \xapptobibdriver{article}{\end{tabularx}}{}{}%
  \xpretobibdriver{book}{\prebiba}{}{}%
  \xapptobibdriver{book}{\end{tabularx}}{}{}%
  \xpretobibdriver{incollection}{\prebiba}{}{}%
  \xapptobibdriver{incollection}{\end{tabularx}}{}{}%
  \xpretobibdriver{collection}{\prebibe}{}{}%
  \xapptobibdriver{collection}{\end{tabularx}}{}{}%
}
\defbibenvironment{tablebib}
  {\setlength{\parindent}{0pt}%
    \renewcommand*{\labelnamepunct}{}%
    \patchdrivers}
  {}
  {}

\begin{document}
\cite{westfahl:space,sigfridsson,piccato,matuz:doody}%
\printbibliography[env=tablebib]%
\end{document}

在此处输入图片描述

答案2

这是另一种方法,不需要修补 bib 驱动程序。我认为代码很长,但结构很清晰。

\documentclass[10pt,english]{article}
\usepackage[a4paper,margin=1cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage[maxbibnames=99,firstinits=true,backref=true]{biblatex}
\addbibresource{biblatex-examples.bib}

\renewbibmacro*{pageref}{%
  \iflistundef{pageref}
    {}
    {\printtext{%
       \ifnumgreater{\value{pageref}}{1}
         {\ppno\ppspace}
         {\pno\ppspace}%
       \printlist[pageref][-\value{listtotal}]{pageref}}}}
\renewbibmacro*{in:}{}
\renewbibmacro*{issue+date}{%
  \ifthenelse{ \iffieldundef{issue} \and \iffieldundef{date} }
    {}
    {\printtext[parens]{%
      \iffieldundef{issue}
        {\usebibmacro{date}}
        {\printfield{issue}%
         \setunit*{\addspace}%
         \usebibmacro{date}}}%
    \newunit}}
\renewbibmacro*{begentry}{%
  \par\textbf{${@}$\printfield{entrytype}}\hrulefill
  \par%
  \tabular{@{}p{.2\textwidth}p{.05\textwidth}p{.3\textwidth}p{.3\textwidth}p{.15\textwidth}@{}}
    \raggedright\parindent=2em\hangindent=2em\noindent\baselineskip=9pt%
    \ifthenelse{  \ifentrytype{article}
                  \or \ifentrytype{inbook}
                  \or \ifentrytype{incollection}
                  \or \ifentrytype{inproceedings}
                  }
      {\usebibmacro{author/translator+others}}
      {}%
    \ifthenelse{  \ifentrytype{book}
                  \or \ifentrytype{booklet}
                  \or \ifentrytype{misc}
                  \or \ifentrytype{online}
                  }
      {\usebibmacro{author/editor+others/translator+others}}
      {}%
    \ifthenelse{  \ifentrytype{collection}
                  \or \ifentrytype{proceedings}
                  }
      {\usebibmacro{editor+others}}
      {}%
    \ifentrytype{manual}
      {\usebibmacro{author/editor}}
      {}%
    \ifthenelse{  \ifentrytype{patent}
                  \or \ifentrytype{report}
                  \or \ifentrytype{thesis}
                  \or \ifentrytype{unpublished}
                  }
      {\usebibmacro{author}}
      {}%
    \ifentrytype{periodical}
      {\usebibmacro{editor}}
      {}
  & \raggedright\noindent\baselineskip=9pt\printfield{year}
  & \parindent=2em\hangindent=2em\noindent\baselineskip=9pt%
    \usebibmacro{title}%
    \newunit
    \printfield{pages}%
    \finentry
  & \parindent=2em\hangindent=2em\noindent\baselineskip=9pt%
    \renewbibmacro*{pageref}{}%
    \renewbibmacro*{title}{}%
    \clearfield{pages}%
    \clearfield{year}%
    \ifthenelse{  \ifentrytype{article}
                  \or \ifentrytype{inbook}
                  \or \ifentrytype{incollection}
                  \or \ifentrytype{inproceedings}
                  }
      {\renewbibmacro*{author/translator+others}{}}
      {}%
    \ifthenelse{  \ifentrytype{book}
                  \or \ifentrytype{booklet}
                  \or \ifentrytype{misc}
                  \or \ifentrytype{online}
                  }
      {\renewbibmacro*{author/editor+others/translator+others}{}}
      {}%
    \ifthenelse{  \ifentrytype{collection}
                  \or \ifentrytype{proceedings}
                  }
      {\renewbibmacro*{editor+others}{}%
       \renewbibmacro*{byeditor+others}{}}
      {}%
    \ifentrytype{manual}
      {\renewbibmacro*{author/editor}{}}
      {}%
    \ifthenelse{  \ifentrytype{patent}
                  \or \ifentrytype{report}
                  \or \ifentrytype{thesis}
                  \or \ifentrytype{unpublished}
                  }
      {\renewbibmacro*{author}{}}
      {}%
    \ifentrytype{periodical}
      {\renewbibmacro*{editor}{}%
       \renewbibmacro*{byeditor}{}}
      {}%
    \nopunct\bibsentence%
}
\renewbibmacro*{finentry}{%
  \finentry
  & \usebibmacro{pageref}
  \endtabular
}

\defbibenvironment{tablebib}
  {\setlength{\parindent}{0pt}}
  {}
  {}

\DeclareNameAlias{default}{last-first}

\begin{document}
\cite{piccato}\cite{matuz:doody}\cite{westfahl:space}%\cite{murray}
\newpage\cite{matuz:doody}\cite{kant:kpv}\cite{ctan}
\newpage\cite{aksin}\cite{matuz:doody}\cite{moraux}
\newpage\cite{westfahl:space}\cite{ctan}%\cite{murray}\cite{gaonkar:in}
\cite{almendro} %patent
\cite{chiu} %report
\cite{geer} %thesis
\cite{jcg}  %periodical
\cite{cms} %manual
\newpage
\printbibliography[env=tablebib]%
\end{document}

在此处输入图片描述

相关内容