diff --git a/README.md b/README.md index 49a46e8..52495af 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,16 @@ # vietnamese-bibtex Bibliography in Vietnamese with BibTeX. Currently supports only numeric citation. Made with [custom-bib](https://www.ctan.org/pkg/custom-bib). -View the compiled PDF showcase [here](https://github.com/wonrax/vietnamese-bibtex/blob/main/test/test.pdf). +### Style examples +``` +[1] Leonard Susskind và George Hrabovsky (2014), Classical mechanics: the theoretical minimum (Penguin Random House, New York, NY). + +[2] P. J. Cohen (1963), “The independence of the continuum hypothesis”. Proceedings of the National Academy of Sciences, tập 50, số 6, tr. 1143–1148. + +[3] Jian Tang (1996 Tháng 9), “Spin structure of the nucleon in the asymptotic limit”. Luận văn Thạc sĩ, Massachusetts Institute of Technology, Cambridge, MA. + +[4] Judith Butcher (1981), Copy-editing (Cambridge University Press), 2nd edition. +``` ### How to use Download the file `vietnumeric.bst` and use it within your `.tex` file. @@ -9,7 +18,7 @@ For example, if you put the `vietnumeric.bst` in the same directory with your `. ``` \bibliographystyle{vietnumeric} ``` -Example, compilable code is available under [test/](https://github.com/wonrax/vietnamese-bibtex/tree/main/test). +Example, compilable code is available under [example/](https://github.com/wonrax/vietnamese-bibtex/tree/main/example). ### About book edition translation Book edition (e.g., "3rd edition" or "phiên bản thứ 3") is not translated since it involves deep modification of the code. If you want to customize the style to translate the book edition, please refer to the section [#Customization](#customization) below. ### Customization diff --git a/test/test.bib b/example/example.bib similarity index 100% rename from test/test.bib rename to example/example.bib diff --git a/test/test.tex b/example/example.tex similarity index 56% rename from test/test.tex rename to example/example.tex index cc282a8..4c3faa0 100644 --- a/test/test.tex +++ b/example/example.tex @@ -1,13 +1,14 @@ \documentclass[hidelinks, 11pt, a4paper]{article} \usepackage[a4paper, total={6in, 9in}]{geometry} -\usepackage[numbers]{natbib} +\usepackage[numbers,sort&compress]{natbib} \usepackage[utf8]{inputenc} \usepackage[vietnamese]{babel} \usepackage[unicode]{hyperref} \begin{document} -Example citation: \cite{CitekeyBook,CitekeyArticle}\cite{CitekeyManual}. +Example citation: +\cite{CitekeyBook,CitekeyArticle}\cite{CitekeyManual}\cite{butcher-81,chicago-82,CitekeyIncollection,CitekeyProceedings}. \nocite{*} \bibliographystyle{../vietnumeric} -\bibliography{test} +\bibliography{example} \end{document} diff --git a/test/test.pdf b/test/test.pdf deleted file mode 100644 index de51c95..0000000 Binary files a/test/test.pdf and /dev/null differ diff --git a/vietnumeric.bst b/vietnumeric.bst index 4e5ee59..79ddb40 100644 --- a/vietnumeric.bst +++ b/vietnumeric.bst @@ -4,9 +4,9 @@ %% %% The original source files were: %% -%% merlin.mbs (with options: `head,exlang,seq-no,seq-lab,ed-au,dt-beg,yr-par,dtrev,tit-qq,qx,bt-qq,thtit-a,vnum-nr,volp-com,pgsep-p,jwdpg,jwdvol,pub-par,isbn,issn,doi,english,pp,xedn,and-xcom,etal-xc,url,url-blk,nfss,,{}') -%% vietnamese.mbs (with options: `exlang,seq-no,seq-lab,ed-au,dt-beg,yr-par,dtrev,tit-qq,qx,bt-qq,thtit-a,vnum-nr,volp-com,pgsep-p,jwdpg,jwdvol,pub-par,isbn,issn,doi,english,pp,xedn,and-xcom,etal-xc,url,url-blk,nfss,,{}') -%% merlin.mbs (with options: `tail,exlang,seq-no,seq-lab,ed-au,dt-beg,yr-par,dtrev,tit-qq,qx,bt-qq,thtit-a,vnum-nr,volp-com,pgsep-p,jwdpg,jwdvol,pub-par,isbn,issn,doi,english,pp,xedn,and-xcom,etal-xc,url,url-blk,nfss,,{}') +%% merlin.mbs (with options: `head,exlang,seq-no,seq-lab,ed-au,dt-beg,yr-par,dtrev,tit-qq,qx,bt-qq,thtit-a,vnum-nr,volp-com,pgsep-p,jwdpg,jwdvol,pub-par,isbn,issn,doi,blk-tit,blknt,english,pp,xedn,and-xcom,etal-xc,url,url-blk,nfss,,{}') +%% vietnamese.mbs (with options: `exlang,seq-no,seq-lab,ed-au,dt-beg,yr-par,dtrev,tit-qq,qx,bt-qq,thtit-a,vnum-nr,volp-com,pgsep-p,jwdpg,jwdvol,pub-par,isbn,issn,doi,blk-tit,blknt,english,pp,xedn,and-xcom,etal-xc,url,url-blk,nfss,,{}') +%% merlin.mbs (with options: `tail,exlang,seq-no,seq-lab,ed-au,dt-beg,yr-par,dtrev,tit-qq,qx,bt-qq,thtit-a,vnum-nr,volp-com,pgsep-p,jwdpg,jwdvol,pub-par,isbn,issn,doi,blk-tit,blknt,english,pp,xedn,and-xcom,etal-xc,url,url-blk,nfss,,{}') %% ---------------------------------------- %% *** *** %% @@ -139,7 +139,7 @@ FUNCTION {add.blank} FUNCTION {date.block} { - new.block + skip$ } FUNCTION {not} @@ -457,7 +457,6 @@ FUNCTION {format.isbn} { isbn "isbn" bibinfo.check duplicate$ empty$ 'skip$ { - new.block "ISBN " swap$ * } if$ @@ -467,7 +466,6 @@ FUNCTION {format.issn} { issn "issn" bibinfo.check duplicate$ empty$ 'skip$ { - new.block "ISSN " swap$ * } if$ @@ -477,7 +475,6 @@ FUNCTION {format.doi} { doi empty$ { "" } { - new.block "\doi{" doi * "}" * } if$ @@ -980,7 +977,7 @@ FUNCTION {article} format.date "year" output.check date.block format.title "title" output.check - new.block + new.sentence crossref missing$ { journal @@ -995,9 +992,8 @@ FUNCTION {article} if$ format.issn output format.doi output - new.block format.url output - new.block + new.sentence format.note output fin.entry } @@ -1018,22 +1014,20 @@ FUNCTION {book} format.btitle "title" output.check crossref missing$ { format.bvolume output - new.block + new.sentence format.number.series output - new.sentence format.publisher.address output } { - new.block + new.sentence format.book.crossref output.nonnull } if$ format.edition output format.isbn output format.doi output - new.block format.url output - new.block + new.sentence format.note output fin.entry } @@ -1043,14 +1037,13 @@ FUNCTION {booklet} format.date output date.block format.title "title" output.check - new.block + new.sentence howpublished "howpublished" bibinfo.check output address "address" bibinfo.check output format.isbn output format.doi output - new.block format.url output - new.block + new.sentence format.note output fin.entry } @@ -1074,14 +1067,13 @@ FUNCTION {inbook} { format.bvolume output format.chapter.pages "chapter and pages" output.check - new.block + new.sentence format.number.series output - new.sentence format.publisher.address output } { format.chapter.pages "chapter and pages" output.check - new.block + new.sentence format.book.crossref output.nonnull } if$ @@ -1091,9 +1083,8 @@ FUNCTION {inbook} 'skip$ if$ format.doi output - new.block format.url output - new.block + new.sentence format.note output fin.entry } @@ -1104,14 +1095,13 @@ FUNCTION {incollection} format.date "year" output.check date.block format.title "title" output.check - new.block + new.sentence crossref missing$ { format.in.ed.booktitle "booktitle" output.check end.quote.btitle format.bvolume output format.number.series output format.chapter.pages output - new.sentence format.publisher.address output format.edition output format.isbn output @@ -1121,9 +1111,8 @@ FUNCTION {incollection} } if$ format.doi output - new.block format.url output - new.block + new.sentence format.note output fin.entry } @@ -1133,14 +1122,13 @@ FUNCTION {inproceedings} format.date "year" output.check date.block format.title "title" output.check - new.block + new.sentence crossref missing$ { format.in.ed.booktitle "booktitle" output.check end.quote.btitle format.bvolume output format.number.series output format.pages output - new.sentence publisher empty$ { format.organization.address output } { organization "organization" bibinfo.check output @@ -1155,9 +1143,8 @@ FUNCTION {inproceedings} } if$ format.doi output - new.block format.url output - new.block + new.sentence format.note output fin.entry } @@ -1177,26 +1164,24 @@ FUNCTION {manual} format.date output date.block format.btitle "title" output.check + new.sentence author empty$ { organization empty$ { - address new.block.checka address "address" bibinfo.check output } 'skip$ if$ } { - organization address new.block.checkb organization "organization" bibinfo.check output address "address" bibinfo.check output } if$ format.edition output format.doi output - new.block format.url output - new.block + new.sentence format.note output fin.entry } @@ -1208,14 +1193,13 @@ FUNCTION {mastersthesis} date.block format.title "title" output.check - new.block + new.sentence bbl.mthesis format.thesis.type output.nonnull school "school" bibinfo.warn output address "address" bibinfo.check output format.doi output - new.block format.url output - new.block + new.sentence format.note output fin.entry } @@ -1224,14 +1208,12 @@ FUNCTION {misc} { output.bibitem format.authors output format.date output - title howpublished new.block.checkb format.title output - howpublished new.block.checka + new.sentence howpublished "howpublished" bibinfo.check output format.doi output - new.block format.url output - new.block + new.sentence format.note output fin.entry empty.misc.check @@ -1243,14 +1225,13 @@ FUNCTION {phdthesis} date.block format.title "title" output.check - new.block + new.sentence bbl.phdthesis format.thesis.type output.nonnull school "school" bibinfo.warn output address "address" bibinfo.check output format.doi output - new.block format.url output - new.block + new.sentence format.note output fin.entry } @@ -1271,17 +1252,14 @@ FUNCTION {proceedings} { publisher empty$ 'skip$ { - new.sentence format.publisher.address output } if$ } { publisher empty$ { - new.sentence format.organization.address output } { - new.sentence organization "organization" bibinfo.check output format.publisher.address output } @@ -1291,9 +1269,8 @@ FUNCTION {proceedings} format.isbn output format.issn output format.doi output - new.block format.url output - new.block + new.sentence format.note output fin.entry } @@ -1305,14 +1282,13 @@ FUNCTION {techreport} date.block format.title "title" output.check - new.block + new.sentence format.tr.number output.nonnull institution "institution" bibinfo.warn output address "address" bibinfo.check output format.doi output - new.block format.url output - new.block + new.sentence format.note output fin.entry } @@ -1324,9 +1300,8 @@ FUNCTION {unpublished} date.block format.title "title" output.check format.doi output - new.block format.url output - new.block + new.sentence format.note "note" output.check fin.entry } diff --git a/vietnumeric.dbj b/vietnumeric.dbj index a81a7fc..b6d2578 100644 --- a/vietnumeric.dbj +++ b/vietnumeric.dbj @@ -522,7 +522,7 @@ End of customized bst file % blk-com,%: Comma between blocks % blk-com,com-semi,%: Semi-colon between blocks % blk-com,com-blank,%: Blanks between blocks -% blk-tit,%: Period after titles of articles, books, etc else commas + blk-tit,%: Period after titles of articles, books, etc else commas % blk-tit,tit-col,%: Colon after titles of articles, books, etc else commas % blk-tita,%: Period after titles of articles else commas % blk-tita,tit-col,%: Colon after titles of articles else commas @@ -530,7 +530,7 @@ End of customized bst file %>>PUNCTUATION BETWEEN SECTIONS (BLOCKS): %<>PUNCTUATION BEFORE NOTES (if not using \newblock) %<