Thứ Sáu, 30 tháng 11, 2012

Sử dụng BibTex trong Latex để add references

Source: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=usebibtex
1. BibTeX bibliography (đuôi file .bib), file .bib nên để cùng thư mục với file source code latex, cấu trúc file ví dụ như sau:

@article{Aggrarwal2007,
author = {V. Aggarwal and A. Feldmann and C. Scheideler},
title = {Can ISPs and P2P users cooperate for improved performance?},
journal = {ACM SIGCOMM Comput. Commun. Rev.},
volume = {37},
number = {3},
pages = {29-40},
month = {July},
year = {2007}
}


@inproceedings {Seedorf2009,
author={J. Seedorf and S.Kiesel and M.Stiemerling},
title = {Traffic localization for P2P-applications: the ALTO apprach},
booktitle = {IEEE Int. Conf. Peer-to-Peer Comput. (P2P2009)},
pages = {171-177},
month = {Sept.},
year = {2009}
}

article cho journal và inproceedings cho conferences

2. Trong file source latex cần có các lệnh cite và gọi đến bibtex

ví dụ:
~\cite{Aggarwal2007}

\bibliographystyle{plain}
\bibliography{HiephvBibAll}

--> Chú ý thay plain bằng file format của hội thảo hoặc tạp chí tương ứng

3. Dịch file source code latex
latex myfile

As LaTeX processes the file, the \bibliographystyle command writes a note of the style to the .aux file; each \cite command writes a note of the citation to the .aux file, and the \bibliography command writes a note of which .bib file is to be used, to the .aux file.
Note that, at this stage, LaTeX isn’t “resolving” any of the citations: at every \cite command, LaTeX will warn you of the undefined citation, and when the document finishes, there will be a further warning of undefined references.
4. Chạy lệnh bibtex
bibtex myfile

BibTeX will scan the .aux file; it will find which bibliography style it needs to use, and will “compile” that style; it will note the citations; it will find which bibliography files it needs, and will run through them matching citations to entries in the bibliography; and finally it will sort the entries that have been cited (if the bibliography style specifies that they should be sorted), and outputs the resulting details to a .bbl file.

5. Chạy Latex một lần nữa
you run LaTeX again. It warns, again, that each citation is (still) undefined, but when it gets to the \bibliography command, it finds a .bbl file, and reads it. As it encounters each \bibitem command in the file, it notes a definition of the citation.

6. Chạy Latex một lần nữa
you run LaTeX yet again. This time, it finds values for all the citations, in its .aux file. Other things being equal, you’re done… until you change the file.



2 nhận xét: