The bibliography environment results in a list.
However, I want to produce a tabular with two columns. The first column is the id, like 1, 2..., and the second column is the content of the bib.
Any one have a solution?
This result should look like:
----------------------
| 1 | this is bib one |
----------------------
| 2 | this is bib two |
----------------------
UPDATE:
I try to code from scratch, and get a workable solution.
\documentclass{article}
\usepackage{array}
\usepackage{tabularx}
\makeatletter
\renewcommand\@biblabel[1]{#1}
\newenvironment{tablebibliography}%
{\center\tabularx{\textwidth}{|c|X|}\hline%
\setcounter{enumiv}{0}%
\let\p@enumiv\@empty%
\renewcommand\theenumiv{\@arbic\c@enumiv}}%
{%\\\hline
\endtabularx\endcenter}
\def\@@preparetbibitem{%
\addtocounter{enumiv}{1}%
\ifnum\the\value{enumiv}>1\\\hline\fi}
\def\tbibitem{\@ifnextchar[\@tlbibitem\@tbibitem}
\def\@tlbibitem[#1]#2{\@@preparetbibitem\@biblabel{#1} & \if@filesw%
{\let\protect\noexpand\immediate\write\@auxout%
{\string\bibcite{#2}{#1}}}\fi\ignorespaces}
\def\@tbibitem#1{\@@preparetbibitem\@biblabel{\the\value{enumiv}} & \if@filesw%
\immediate\write\@auxout%
{\string\bibcite{#1}{\the\value{enumiv}}}\fi\ignorespaces}
\makeatother
\begin{document}
This is reference\cite{itemone}, this is another reference\cite{itemtwo}.
\begin{tablebibliography}
\tbibitem{itemone} first item
\tbibitem[label]{itemtwo} second item
\tbibitem{itemthree} 3rd item \\\hline
\end{tablebibliography}
\end{document}
However, there are two issues:
- the 1st cell of the 1st line is not center-aligned.
- I must add
\\\hlineat the end of the last item, because I can't put it before\endtabularx, or it will complain\hline noalign.
How to solve these problems?
UPDATE:
I replace tabularx with tabu, and the problems metioned above are solved. But the \cite link is broken. I don't kown how the \bibitem defines the link destination, so, what is the \label counterpart for \cite as to \ref?
\usepackage{longtable}
\usepackage{tabu}
\newenvironment{tablebibliography}%
{\center\longtabu to \textwidth{|X[-1,c]|X[1,p]|}\hline%
\setcounter{enumiv}{0}%
\let\p@enumiv\@empty%
\renewcommand\theenumiv{\@arbic\c@enumiv}}%
{\\\hline
\endlongtabu\endcenter}
UPDATE:
I solved the link problem.
\def\@tbiblink#1{%
\Hy@raisedlink{\hyper@anchorstart{cite.#1}\relax\hyper@anchorend}}
So \cite or \hyper@link links to \@tbiblink.


bibtex. You just need to replace some commands in*.bblfile after thebibtexcompile pass. – Martin Wang Mar 06 '14 at 19:53