{"id":424,"date":"2013-01-22T04:34:25","date_gmt":"2013-01-21T21:34:25","guid":{"rendered":"http:\/\/nvntung.wordpress.com\/?p=424"},"modified":"2013-01-22T04:34:25","modified_gmt":"2013-01-21T21:34:25","slug":"extract-entries-cited-in-a-tex-doc","status":"publish","type":"post","link":"https:\/\/www.itersdesktop.com\/vi\/2013\/01\/22\/extract-entries-cited-in-a-tex-doc\/","title":{"rendered":"Xu\u1ea5t ra nh\u1eefng t\u00e0i li\u1ec7u tham kh\u1ea3o \u0111\u01b0\u1ee3c tr\u00edch d\u1eabn trong m\u1ed9t t\u00e0i li\u1ec7u tex t\u1eeb file .bib chung nh\u1ea5t"},"content":{"rendered":"<p>T\u1ed1i c\u00f3 m\u1ed9t v\u1ea5n \u0111\u1ec1: Trong qu\u00e1 tr\u00ecnh vi\u1ebft b\u00e0i (article, proposal, resume, etc.) t\u00f4i mu\u1ed1n l\u01b0u t\u1ea5t c\u1ea3 t\u00e0i li\u1ec7u tham kh\u1ea3o v\u00e0o m\u1ed9t file .bib duy nh\u1ea5t v\u00ec mu\u1ed1n d\u1ec5 qu\u1ea3n l\u00fd c\u00e1c entry d\u00f9ng c\u00e1c tool nh\u01b0 JabRef. D\u00f9ng \u0111\u01b0\u1eddng d\u1eabn t\u01b0\u01a1ng \u0111\u1ed1i \u0111\u1ec3 ch\u1ec9 ra file .bib trong file .tex. V\u1edbi c\u00e1ch n\u00e0y, ch\u00fang ta s\u1ebd tr\u00e1nh t\u00ecnh tr\u1ea1ng tr\u00f9ng n\u1ed9i dung c\u00e1c entry nh\u01b0ng ch\u1ec9 kh\u00e1c t\u00ean. Tuy nhi\u00ean, m\u1ed9t v\u1ea5n \u0111\u1ec1 ch\u1ea1m \u0111\u1ebfn: khi submit b\u00e1o, m\u1ed9t s\u1ed1 h\u1ed9i th\u1ea3o, t\u1ea1p ch\u00ed y\u00eau c\u1ea7u g\u1edfi c\u1ea3 file .tex v\u00e0 .bib. Th\u1ebf th\u00ec trong tr\u01b0\u1eddng h\u1ee3p n\u00e0y, ch\u00fang ta kh\u00f4ng n\u00ean g\u1edfi c\u1ea3 t\u1eadp tin d\u1eef li\u1ec7u bibtex m\u00e0 ch\u1ec9 n\u00ean l\u1ea5y ra nh\u1eefng entries n\u00e0o tham kh\u1ea3o trong t\u00e0i li\u1ec7u. \u0110\u00e2y ch\u00ednh l\u00e0 ch\u1ee9c n\u0103ng m\u00e0 t\u00f4i c\u1ea7n.<br \/>\nBan \u0111\u1ea7u, t\u00f4i c\u00f3 m\u1ed9t v\u00e0i \u00fd t\u01b0\u1edfng \u0111\u1ec3 l\u00e0m vi\u1ec7c n\u00e0y. \u00a0Ch\u1eb3ng h\u1ea1n nh\u01b0:<\/p>\n<ul>\n<li><span style=\"line-height:13px;\">Vi\u1ebft m\u1ed9t \u00edt code v\u1edbi Python ho\u1eb7c \/C++ g\u00ec \u0111\u00f3 \u0111\u00ea l\u1ea5y t\u1ea5t c\u1ea3 c\u00e1c t\u00ean \u0111\u01b0\u1ee3c cite trong t\u00e0i li\u1ec1u, sau \u0111\u00f3 l\u1ea5y t\u1ea5t c\u1ea3 entries trong .bib d\u1ef1a v\u00e0o c\u00e1c t\u00ean l\u1ea5y \u0111\u01b0\u1ee3c trong t\u00e0i li\u1ec7u.<\/span><\/li>\n<li>Import .bib v\u00e0o m\u1ed9t tool qu\u1ea3n l\u00fd t\u00e0i li\u1ec7u tham kh\u1ea3o m\u00e0 s\u1eed d\u1ee5ng MySQL v\u00e0 PHP. Sau \u0111\u00f3, d\u00f9ng c\u00e2u truy v\u1ea5n tr\u1eeb (ho\u1eb7c n\u1ed1i) \u0111\u1ec3 l\u1ea5y ra nh\u1eefng entries \u0111\u01b0\u1ee3c cite.<\/li>\n<li>C\u00f3 m\u1ed9t ti\u1ec7n \u00edch n\u00e0o \u0111\u00f3 trong h\u1ec7 th\u1ed1ng tex<\/li>\n<\/ul>\n<p>Th\u1ebf l\u00e0, t\u00f4i b\u1eaft \u0111\u1ea7u gooogle \u0111\u1ec3 xem c\u00e1c anh em \u0111\u00e3 x\u1eed l\u00fd v\u1ea5n \u0111\u1ec1 n\u00e0y nh\u01b0 th\u1ebf n\u00e0o. May m\u1eafn, t\u00f4i t\u00ecm ra \u0111\u01b0\u1ee3c bibexport nh\u01b0ng kh\u00f4ng c\u00e0i \u0111\u1eb7t \u0111\u01b0\u1ee3c. Kh\u00f4ng hi\u1ec3u l\u00fd do g\u00ec nh\u01b0ng m\u1ed7i l\u1ea7n ch\u1ea1y pdflatex \u0111\u1ec3 bi\u00ean d\u1ecbch file \u0111\u1ec1u b\u1ecb b\u00e1o l\u1ed7i. T\u00f4i v\u1eabn ki\u00ean tr\u00ec t\u00ecm ki\u1ebfm c\u00f4ng c\u1ee5 kh\u00e1c, v\u00e0 t\u00f4i c\u0169ng c\u00f3 th\u1ea5y bibtool nh\u01b0ng kh\u00f4ng ngh\u0129 n\u00f3 th\u1ec3 l\u00e0m \u0111\u01b0\u1ee3c t\u00ednh n\u0103ng nh\u01b0 t\u00f4i m\u00f4 t\u1ea3 tr\u00ean.<\/p>\n<p>T\u00ecnh c\u1edd ch\u1ea1y ngang qua <a href=\"http:\/\/tex.stackexchange.com\/questions\/43276\/unused-bibliography-entries-how-to-check-which-entries-were-not-used\" target=\"_blank\">trang n\u00e0y<\/a>, t\u00f4i n\u1eafm \u0111\u01b0\u1ee3c t\u00ednh n\u0103ng t\u01b0\u01a1ng t\u1ef1 nh\u01b0 y\u00eau c\u1ea7u c\u1ee7a t\u00f4i \u00a0c\u00f3 trong bibtool. Th\u1ebf l\u00e0 vi\u1ec7c c\u00e0i \u0111\u1eb7t bibtool b\u1eaft \u0111\u00e2u th\u00f4ng qua terminal v\u1edbi l\u1ec7nh <code>sudo apt-get install bibtool<\/code>.<\/p>\n<p>Sau \u0111\u00f3, ch\u1ec9 c\u1ea7n ch\u1ea1y l\u1ec7nh:<\/p>\n<pre><code>bibtool -x paper.aux -o paperrefs.bib\n<\/code><\/pre>\n<p>\u0111\u1ec3 xu\u1ea5t ra c\u00e1c entries \u0111\u01b0\u1ee3c tham kh\u1ea3o trong paper ra m\u1ed9t file paperrefs.bib. \u0110\u1ec3 ki\u1ec3m tra, ch\u1ec9 c\u1ea7n d\u00f9ng l\u00eanh diff:<\/p>\n<pre>diff myreferences.bib paperrefs.bib<\/pre>\n<p>so s\u00e1nh n\u1ed9i dung c\u1ee7a file t\u00e0i li\u1ec7u tham kh\u1ea3o to\u00e0n b\u1ed9 (myreferrences.bib) v\u1edbi file t\u00e0i li\u1ec7u tham kh\u1ea3o c\u1ee7a 1 b\u00e0i b\u00e1o cho tr\u01b0\u1edbc.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>T\u1ed1i c\u00f3 m\u1ed9t v\u1ea5n \u0111\u1ec1: Trong qu\u00e1 tr\u00ecnh vi\u1ebft b\u00e0i (article, proposal, resume, etc.) t\u00f4i mu\u1ed1n l\u01b0u t\u1ea5t c\u1ea3 t\u00e0i li\u1ec7u tham kh\u1ea3o v\u00e0o m\u1ed9t file .bib duy nh\u1ea5t v\u00ec&hellip; <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[40,41,42,73,97],"class_list":["post-424","post","type-post","status-publish","format-standard","hentry","category-latex","tag-bibliography","tag-bibtex","tag-bibtool","tag-latex","tag-reference"],"_links":{"self":[{"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/posts\/424","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/comments?post=424"}],"version-history":[{"count":0,"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/posts\/424\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/media?parent=424"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/categories?post=424"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/tags?post=424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}