Skip to content

Commit

Permalink
change punctuation after author to comma (period before)
Browse files Browse the repository at this point in the history
  • Loading branch information
wonrax committed Nov 26, 2021
1 parent bb4ff76 commit 1f335e5
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 62 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
# 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.
For example, if you put the `vietnumeric.bst` in the same directory with your `.tex` file, specify the bibliography style with this command:
```
\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
Expand Down
File renamed without changes.
7 changes: 4 additions & 3 deletions test/test.tex → example/example.tex
Original file line number Diff line number Diff line change
@@ -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}
Binary file removed test/test.pdf
Binary file not shown.
85 changes: 30 additions & 55 deletions vietnumeric.bst
Original file line number Diff line number Diff line change
Expand Up @@ -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,,{}')
%% ----------------------------------------
%% *** ***
%%
Expand Down Expand Up @@ -139,7 +139,7 @@ FUNCTION {add.blank}

FUNCTION {date.block}
{
new.block
skip$
}

FUNCTION {not}
Expand Down Expand Up @@ -457,7 +457,6 @@ FUNCTION {format.isbn}
{ isbn "isbn" bibinfo.check
duplicate$ empty$ 'skip$
{
new.block
"ISBN " swap$ *
}
if$
Expand All @@ -467,7 +466,6 @@ FUNCTION {format.issn}
{ issn "issn" bibinfo.check
duplicate$ empty$ 'skip$
{
new.block
"ISSN " swap$ *
}
if$
Expand All @@ -477,7 +475,6 @@ FUNCTION {format.doi}
{ doi empty$
{ "" }
{
new.block
"\doi{" doi * "}" *
}
if$
Expand Down Expand Up @@ -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
Expand All @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand All @@ -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$
Expand All @@ -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
}
Expand All @@ -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
Expand All @@ -1121,9 +1111,8 @@ FUNCTION {incollection}
}
if$
format.doi output
new.block
format.url output
new.block
new.sentence
format.note output
fin.entry
}
Expand All @@ -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
Expand All @@ -1155,9 +1143,8 @@ FUNCTION {inproceedings}
}
if$
format.doi output
new.block
format.url output
new.block
new.sentence
format.note output
fin.entry
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
Expand All @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions vietnumeric.dbj
Original file line number Diff line number Diff line change
Expand Up @@ -522,15 +522,15 @@ 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
%------\ans=*(==)-------
%>>PUNCTUATION BETWEEN SECTIONS (BLOCKS):
%<<PUNCTUATION BEFORE NOTES (if not using \newblock)
% %: (def) Notes have regular punctuation like all other blocks
% blknt,%: Notes preceded by period
blknt,%: Notes preceded by period
%------\ans=*(==)-------
%>>PUNCTUATION BEFORE NOTES (if not using \newblock)
%<<PUNCTUATION AFTER AUTHORS:
Expand Down

0 comments on commit 1f335e5

Please sign in to comment.