![在表格中显示参考资料](https://linux22.com/image/334663/%E5%9C%A8%E8%A1%A8%E6%A0%BC%E4%B8%AD%E6%98%BE%E7%A4%BA%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99.png)
更新 1 我使用 biblatex 和 bibber 创建参考书目。参考部分包含所引用文章的列表。如何更改参考部分,使参考出现在表格中。参考部分是手动的吗?相应的 latex 代码将如下所示
\section{Reference}
\begin{tabularx}{\textwidth}{||c|X||}\hline\hline
cite1 & Title, author etc\\ \hline
cite2 & Title, author etc\\ \hline
cite3 & Title, author etc\\ \hline \hline
\end{tabularx}
字符串 citeX 可以是普通字符串 [citeX] ,也可以是 XYZ 形式,其中 X、Y、Z 为数字。
更新 2(和 3)
从style=authoryear 在参考书目列表前面添加额外块MWE 修改为
\documentclass{article}
\usepackage{longtable}
\usepackage[citestyle=authoryear-comp, bibstyle=authortitle, sorting=nyt, dashed=false,%
maxcitenames=1]{biblatex}
\DeclareNameAlias{sortname}{first-last}
\addbibresource{biblatex-examples.bib}
\makeatletter
% user-level command for printing tabular bibliography
\let\printbibtabular\printbibliography
\patchcmd{\printbibtabular}{\blx@printbibliography}{\bbx@printbibtabular}{}{}
\patchcmd{\printbibtabular}{\blx@printbibliography} {\bbx@printbibtabular}{}{}
\let\bbx@printbibtabular\blx@printbibliography
\patchcmd{\bbx@printbibtabular}{\blx@bibliography}{\bbx@bibtabular}{}{}
\patchcmd{\bbx@printbibtabular}
{\def\blx@theenv{bibliography}}{\def\blx@theenv{bibtabular}}{}{}
% underlying macros
\def\bbx@bibtabular#1{%
\blx@bibheading\blx@theheading\blx@thetitle
\blx@bibnote\blx@theprenote
\begingroup
\blx@bibinit
\let\@noitemerr\@empty
\let\blx@noitem\blx@warn@bibempty
\ifnum\bibinitsep=\z@
\let\blx@initsep\relax
\fi
\ifnum\bibnamesep=\z@
\let\blx@namesep\relax
\fi
\csuse{blx@hook@bibinit}%
% copy filtered list of entries to internal list macro
\def\blx@do##1{%
\blx@ifdata{##1}{%
\begingroup
\blx@getdata{##1}
\blx@bibcheck
\iftoggle{blx@skipentry}{}{%
\global\let\blx@noitem\@empty
\listadd\blx@tempa{##1}}%
\endgroup}{}}
\let\blx@done\relax
\blx@listloop{#1}
% tabular output for each item in list macro
\def\do##1{\bbx@tab@label{##1} & \bbx@tab@item{##1} \\ \hline}
\csuse{blx@env@\blx@theenv}%
\dolistloop{\blx@tempa}
\csuse{blx@endenv@\blx@theenv}%
\blx@bibnote\blx@thepostnote
\endgroup}
\def\bbx@tab@label#1{%
\begingroup
\blx@getdata{#1}%
\blx@setoptions@type\abx@field@entrytype
\blx@setoptions@entry
\blx@thelabelnumber
\blx@addprefixnumber
\addtocounter{instcount}\@ne
\csuse{bbx@tabenv@\blx@theenv}\relax
\endgroup}
\def\bbx@tab@item#1{%
\begingroup
\blx@getdata{#1}%
\blx@setoptions@type\abx@field@entrytype
\blx@setoptions@entry
\csuse{blx@item@\blx@theenv}\relax
\blx@initsep
\blx@namesep
\csuse{blx@hook@bibitem}%
\blx@execute
\blx@initunit
\blx@anchor
\blx@beglang
\bibsentence
\blx@pagetracker
\blx@driver\abx@field@entrytype
\blx@postpunct
\blx@endlang
\endgroup}
% user-level command for defining tabular bibliography format
\newrobustcmd*{\defbibtabular}[5]{%
\long\csdef{blx@env@#1}{#2}%
\long\csdef{blx@endenv@#1}{#3}%
\long\csdef{bbx@tabenv@#1}{#4}%
\long\csdef{blx@item@#1}{#5}}
\makeatother
\newcounter{mymaxcitenames}
\AtBeginDocument{%
\setcounter{mymaxcitenames}{\value{maxnames}}%
}
\newbibmacro*{bibcite}{%
\defcounter{maxnames}{\value{mymaxcitenames}}%
\iffieldundef{shorthand}
{\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
{\usebibmacro{cite:label}%
\setunit{\addspace}}
{\printnames{labelname}%
\setunit{\nameyeardelim}}%
\usebibmacro{cite:labelyear+extrayear}}
{\usebibmacro{cite:shorthand}}}
\defbibtabular{bibtabular}
{\begin{longtable}{|p{0.2\textwidth}|p{0.8\textwidth}|}\hline}
{\end{longtable}}
{\usebibmacro{bibcite}}
{}
\begin{document}
Some text \autocite{sigfridsson, geer, nussbaum, worman, knuth:ct:b, knuth:ct:c}.
\printbibtabular
\end{document}
修改是
\defbibtabular{bibtabular}
{\begin{longtable}{|p{0.2\textwidth}|p{0.8\textwidth}|}\hline}
{\end{longtable}}
{\usebibmacro{bibcite}}
{}
并参见 Guido 的评论
答案1
在收到的评论的帮助下
\documentclass{article}
\usepackage{longtable}
\usepackage[citestyle=authoryear-comp, bibstyle=authortitle, sorting=nyt, dashed=false,%
maxcitenames=1]{biblatex}
\DeclareNameAlias{sortname}{first-last}
\addbibresource{biblatex-examples.bib}
\makeatletter
% user-level command for printing tabular bibliography
\let\printbibtabular\printbibliography
\patchcmd{\printbibtabular}{\blx@printbibliography}{\bbx@printbibtabular}{}{}
\patchcmd{\printbibtabular}{\blx@printbibliography} {\bbx@printbibtabular}{}{}
\let\bbx@printbibtabular\blx@printbibliography
\patchcmd{\bbx@printbibtabular}{\blx@bibliography}{\bbx@bibtabular}{}{}
\patchcmd{\bbx@printbibtabular}
{\def\blx@theenv{bibliography}}{\def\blx@theenv{bibtabular}}{}{}
% underlying macros
\def\bbx@bibtabular#1{%
\blx@bibheading\blx@theheading\blx@thetitle
\blx@bibnote\blx@theprenote
\begingroup
\blx@bibinit
\let\@noitemerr\@empty
\let\blx@noitem\blx@warn@bibempty
\ifnum\bibinitsep=\z@
\let\blx@initsep\relax
\fi
\ifnum\bibnamesep=\z@
\let\blx@namesep\relax
\fi
\csuse{blx@hook@bibinit}%
% copy filtered list of entries to internal list macro
\def\blx@do##1{%
\blx@ifdata{##1}{%
\begingroup
\blx@getdata{##1}
\blx@bibcheck
\iftoggle{blx@skipentry}{}{%
\global\let\blx@noitem\@empty
\listadd\blx@tempa{##1}}%
\endgroup}{}}
\let\blx@done\relax
\blx@listloop{#1}
% tabular output for each item in list macro
\def\do##1{\bbx@tab@label{##1} & \bbx@tab@item{##1} \\ \hline}
\csuse{blx@env@\blx@theenv}%
\dolistloop{\blx@tempa}
\csuse{blx@endenv@\blx@theenv}%
\blx@bibnote\blx@thepostnote
\endgroup}
\def\bbx@tab@label#1{%
\begingroup
\blx@getdata{#1}%
\blx@setoptions@type\abx@field@entrytype
\blx@setoptions@entry
\blx@thelabelnumber
\blx@addprefixnumber
\addtocounter{instcount}\@ne
\csuse{bbx@tabenv@\blx@theenv}\relax
\endgroup}
\def\bbx@tab@item#1{%
\begingroup
\blx@getdata{#1}%
\blx@setoptions@type\abx@field@entrytype
\blx@setoptions@entry
\csuse{blx@item@\blx@theenv}\relax
\blx@initsep
\blx@namesep
\csuse{blx@hook@bibitem}%
\blx@execute
\blx@initunit
\blx@anchor
\blx@beglang
\bibsentence
\blx@pagetracker
\blx@driver\abx@field@entrytype
\blx@postpunct
\blx@endlang
\endgroup}
% user-level command for defining tabular bibliography format
\newrobustcmd*{\defbibtabular}[5]{%
\long\csdef{blx@env@#1}{#2}%
\long\csdef{blx@endenv@#1}{#3}%
\long\csdef{bbx@tabenv@#1}{#4}%
\long\csdef{blx@item@#1}{#5}}
\makeatother
\newcounter{mymaxcitenames}
\AtBeginDocument{%
\setcounter{mymaxcitenames}{\value{maxnames}}%
}
\newbibmacro*{bibcite}{%
\defcounter{maxnames}{\value{mymaxcitenames}}%
\iffieldundef{shorthand}
{\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
{\usebibmacro{cite:label}%
\setunit{\addspace}}
{\printnames{labelname}%
\setunit{\nameyeardelim}}%
\usebibmacro{cite:labelyear+extrayear}}
{\usebibmacro{cite:shorthand}}}
\defbibtabular{bibtabular}
{\begin{longtable}{|p{0.2\textwidth}|p{0.8\textwidth}|}\hline}
{\end{longtable}}
{\usebibmacro{bibcite}}
{}
\begin{document}
Some text \autocite{sigfridsson, geer, nussbaum, worman, knuth:ct:b, knuth:ct:c}.
\printbibtabular
\end{document}