Vu Anh commited on
Commit
049405b
·
1 Parent(s): ab8fd53
Files changed (4) hide show
  1. paper/.gitignore +1 -0
  2. paper/main.bib +21 -20
  3. paper/main.tex +22 -28
  4. paper/scripts/format_bbl.py +124 -0
paper/.gitignore CHANGED
@@ -3,5 +3,6 @@
3
  !main.text
4
  !main.bib
5
  !main.bst
 
6
  !scripts/*
7
  !plainnat-custom.bst
 
3
  !main.text
4
  !main.bib
5
  !main.bst
6
+ !scripts
7
  !scripts/*
8
  !plainnat-custom.bst
paper/main.bib CHANGED
@@ -165,7 +165,8 @@
165
  title = {Vietnamese: An Essential Grammar},
166
  publisher = {Routledge},
167
  year = {2021},
168
- address = {London, UK}
 
169
  }
170
 
171
  @book{nguyen1997,
@@ -174,7 +175,7 @@
174
  year = {1997},
175
  publisher = {John Benjamins},
176
  address = {Amsterdam},
177
- sortkey = {18},
178
  }
179
 
180
  @book{nguyentaican1985,
@@ -183,7 +184,7 @@
183
  year = {1985},
184
  publisher = {{\fontencoding{T5}\selectfont Nhà Xuất Bản Đại học và Trung Học Chuyên Nghiệp}},
185
  address = {{\fontencoding{T5}\selectfont Hà Nội}},
186
- sortkey = {19},
187
  }
188
 
189
  @book{nguyentaican1995,
@@ -192,7 +193,7 @@
192
  year = {1995},
193
  publisher = {{\fontencoding{T5}\selectfont Nhà Xuất Bản Giáo Dục}},
194
  address = {{\fontencoding{T5}\selectfont Hà Nội}},
195
- sortkey = {20},
196
  }
197
 
198
  @book{nguyen2019,
@@ -201,7 +202,7 @@
201
  year = {2019},
202
  publisher = {Vietnam National University Press},
203
  address = {Hanoi, Vietnam},
204
- sortkey = {21},
205
  }
206
 
207
  @book{nguyen2019adv,
@@ -210,7 +211,7 @@
210
  year = {2019},
211
  publisher = {Vietnam National University Press},
212
  address = {Hanoi, Vietnam},
213
- sortkey = {22},
214
  }
215
 
216
  @article{nguyenvanloi1997,
@@ -220,7 +221,7 @@
220
  volume = {28},
221
  pages = {1--18},
222
  year = {1997},
223
- sortkey = {23},
224
  }
225
 
226
  @article{nguyenvanloi2012,
@@ -231,7 +232,7 @@
231
  number = {19},
232
  pages = {54--65},
233
  year = {2012},
234
- sortkey = {24},
235
  }
236
 
237
  @article{pham2006,
@@ -242,7 +243,7 @@
242
  number = {2},
243
  pages = {107--141},
244
  year = {2006},
245
- sortkey = {25},
246
  }
247
 
248
  @misc{phan2022,
@@ -250,7 +251,7 @@
250
  title = {Vietnamese Linguistics. State of the Field},
251
  year = {2022},
252
  note = {Special issue of Journal of Southeast Asian linguistics society},
253
- sortkey = {26},
254
  }
255
 
256
  @book{phan2024vibes,
@@ -260,7 +261,7 @@
260
  publisher = {Cafoscarina Press},
261
  address = {Venice},
262
  url = {https://cafoscarina.it/articoli/vietnamese-vibes-1-2-3-phan-trang-chu-phong-lan/},
263
- sortkey = {27},
264
  }
265
 
266
  @book{phan2024springer,
@@ -269,7 +270,7 @@
269
  year = {2024},
270
  publisher = {Springer Nature},
271
  address = {Singapore},
272
- sortkey = {28},
273
  }
274
 
275
  @misc{phan2025lang,
@@ -277,7 +278,7 @@
277
  title = {Current Issues in Vietnamese Linguistics},
278
  year = {2025},
279
  note = {Special issue of Languages},
280
- sortkey = {29},
281
  }
282
 
283
  @misc{phan2025tjl,
@@ -285,7 +286,7 @@
285
  title = {Further advances in Vietnamese linguistics},
286
  year = {2025},
287
  note = {Special issue of Taiwan Journal of Linguistics. forthcoming},
288
- sortkey = {30},
289
  }
290
 
291
  @misc{phung2025,
@@ -293,7 +294,7 @@
293
  title = {Intermediate Vietnamese Taskbook},
294
  year = {2025},
295
  url = {https://doi.org/10.17605/OSF.IO/JHQ6N},
296
- sortkey = {31},
297
  }
298
 
299
  @article{shimizu2022,
@@ -304,7 +305,7 @@
304
  number = {4},
305
  pages = {1--14},
306
  year = {2022},
307
- sortkey = {32},
308
  }
309
 
310
  @article{thompson1959,
@@ -315,7 +316,7 @@
315
  number = {3},
316
  pages = {454--476},
317
  year = {1959},
318
- sortkey = {33},
319
  }
320
 
321
  @book{thompson1984,
@@ -324,7 +325,7 @@
324
  year = {1984--85},
325
  series = {Mon-Khmer Studies XIII-XIV},
326
  publisher = {University of Hawaii Press},
327
- sortkey = {34},
328
  }
329
 
330
  @book{vu2011,
@@ -333,7 +334,7 @@
333
  year = {2011},
334
  publisher = {Vietnam National University Press},
335
  address = {Hanoi, Vietnam},
336
- sortkey = {35},
337
  }
338
 
339
  @book{vuong1994,
@@ -342,5 +343,5 @@
342
  year = {1994},
343
  publisher = {{\fontencoding{T5}\selectfont Giáo dục}},
344
  address = {{\fontencoding{T5}\selectfont Hà Nội}},
345
- sortkey = {36},
346
  }
 
165
  title = {Vietnamese: An Essential Grammar},
166
  publisher = {Routledge},
167
  year = {2021},
168
+ address = {London, UK},
169
+ sortkey = {18}
170
  }
171
 
172
  @book{nguyen1997,
 
175
  year = {1997},
176
  publisher = {John Benjamins},
177
  address = {Amsterdam},
178
+ sortkey = {19},
179
  }
180
 
181
  @book{nguyentaican1985,
 
184
  year = {1985},
185
  publisher = {{\fontencoding{T5}\selectfont Nhà Xuất Bản Đại học và Trung Học Chuyên Nghiệp}},
186
  address = {{\fontencoding{T5}\selectfont Hà Nội}},
187
+ sortkey = {20},
188
  }
189
 
190
  @book{nguyentaican1995,
 
193
  year = {1995},
194
  publisher = {{\fontencoding{T5}\selectfont Nhà Xuất Bản Giáo Dục}},
195
  address = {{\fontencoding{T5}\selectfont Hà Nội}},
196
+ sortkey = {21},
197
  }
198
 
199
  @book{nguyen2019,
 
202
  year = {2019},
203
  publisher = {Vietnam National University Press},
204
  address = {Hanoi, Vietnam},
205
+ sortkey = {22},
206
  }
207
 
208
  @book{nguyen2019adv,
 
211
  year = {2019},
212
  publisher = {Vietnam National University Press},
213
  address = {Hanoi, Vietnam},
214
+ sortkey = {23},
215
  }
216
 
217
  @article{nguyenvanloi1997,
 
221
  volume = {28},
222
  pages = {1--18},
223
  year = {1997},
224
+ sortkey = {24},
225
  }
226
 
227
  @article{nguyenvanloi2012,
 
232
  number = {19},
233
  pages = {54--65},
234
  year = {2012},
235
+ sortkey = {25},
236
  }
237
 
238
  @article{pham2006,
 
243
  number = {2},
244
  pages = {107--141},
245
  year = {2006},
246
+ sortkey = {26},
247
  }
248
 
249
  @misc{phan2022,
 
251
  title = {Vietnamese Linguistics. State of the Field},
252
  year = {2022},
253
  note = {Special issue of Journal of Southeast Asian linguistics society},
254
+ sortkey = {27},
255
  }
256
 
257
  @book{phan2024vibes,
 
261
  publisher = {Cafoscarina Press},
262
  address = {Venice},
263
  url = {https://cafoscarina.it/articoli/vietnamese-vibes-1-2-3-phan-trang-chu-phong-lan/},
264
+ sortkey = {28},
265
  }
266
 
267
  @book{phan2024springer,
 
270
  year = {2024},
271
  publisher = {Springer Nature},
272
  address = {Singapore},
273
+ sortkey = {29},
274
  }
275
 
276
  @misc{phan2025lang,
 
278
  title = {Current Issues in Vietnamese Linguistics},
279
  year = {2025},
280
  note = {Special issue of Languages},
281
+ sortkey = {30},
282
  }
283
 
284
  @misc{phan2025tjl,
 
286
  title = {Further advances in Vietnamese linguistics},
287
  year = {2025},
288
  note = {Special issue of Taiwan Journal of Linguistics. forthcoming},
289
+ sortkey = {31},
290
  }
291
 
292
  @misc{phung2025,
 
294
  title = {Intermediate Vietnamese Taskbook},
295
  year = {2025},
296
  url = {https://doi.org/10.17605/OSF.IO/JHQ6N},
297
+ sortkey = {32},
298
  }
299
 
300
  @article{shimizu2022,
 
305
  number = {4},
306
  pages = {1--14},
307
  year = {2022},
308
+ sortkey = {33},
309
  }
310
 
311
  @article{thompson1959,
 
316
  number = {3},
317
  pages = {454--476},
318
  year = {1959},
319
+ sortkey = {34},
320
  }
321
 
322
  @book{thompson1984,
 
325
  year = {1984--85},
326
  series = {Mon-Khmer Studies XIII-XIV},
327
  publisher = {University of Hawaii Press},
328
+ sortkey = {35},
329
  }
330
 
331
  @book{vu2011,
 
334
  year = {2011},
335
  publisher = {Vietnam National University Press},
336
  address = {Hanoi, Vietnam},
337
+ sortkey = {36},
338
  }
339
 
340
  @book{vuong1994,
 
343
  year = {1994},
344
  publisher = {{\fontencoding{T5}\selectfont Giáo dục}},
345
  address = {{\fontencoding{T5}\selectfont Hà Nội}},
346
+ sortkey = {37},
347
  }
paper/main.tex CHANGED
@@ -5,6 +5,10 @@
5
  \usepackage{tipa}
6
  \usepackage[hyphens]{url}
7
  \usepackage{multirow}
 
 
 
 
8
  \usepackage{hyperref}
9
  \hypersetup{
10
  breaklinks=true,
@@ -27,6 +31,9 @@
27
  \renewcommand\@makefnmark{\hbox{\@textsuperscript{\normalfont\textcolor{magenta}{\@thefnmark}}}}
28
  \makeatother
29
 
 
 
 
30
  \title{IPA Guideline in Vietnamese}
31
  \author{
32
  Trang Phan\\
@@ -49,9 +56,9 @@ The demand of learning Vietnamese as a second language in Vietnam and overseas i
49
 
50
  There is also a growing number of people speaking Vietnamese as a heritage language in the US, Cambodia, France, Australia and other countries. Vietnamese has been officially recognized as a minority language in the Czech Republic since 2013\footnote{\url{https://ec.europa.eu/migrant-integration/news/czech-republic-vietnamese-and-belarusians-recognized-ethnic-minorities_en}}. In Australia, Vietnamese occupies 82.7\% of the main languages spoken at home by Vietnam-born people there, according to the 2016 Census\footnote{\url{https://www.homeaffairs.gov.au/mca/files/2016-cis-vietnam.PDF}}.
51
 
52
- Responding to strong demand, numerous instructional textbooks have been published worldwide, including series by \citet{mai2007a}, \citet{vu2011}, \citet{doan2012,doan2014}, \citet{nguyen2019}, and more recently by \citet{phan2024vibes} and \citet{phung2025}. Additionally, there are descriptive guides to the Vietnamese language including \citet{nguyen1997} by John Benjamins,\footnote{\url{https://benjamins.com/catalog/loall.9}} and \cite{ngo2021} by Routledge.\footnote{\url{https://www.routledge.com/Vietnamese-An-Essential-Grammar/Ngo/p/book/9781138210707}}
53
 
54
- There is also a great leap in Vietnamese linguistic research over the past decade. There are three edited volumes devoted to Vietnamese: \cite{hole2013}, De Gruyter Mouton;\footnote{\url{https://www.degruyter.com/document/doi/10.1515/9783110289411/html?lang=en}} \cite{duffield2019}, John Benjamins;\footnote{\url{https://benjamins.com/catalog/slcs.211}} and \cite{phan2024springer}, Springer. Vietnamese has also been the focus of several special issues in Journal of East Asian Linguistics (2017),\footnote{\url{https://link.springer.com/journal/10831/volumes-and-issues/26-4}} Journal of the Southeast Asian Linguistics Society \cite{phan2022},\footnote{\url{https://evols.library.manoa.hawaii.edu/handle/10524/52500}} Taiwan Journal of Linguistics \cite{duffield2024,phan2025tjl}, and Languages \cite{phan2025lang}.
55
 
56
  However, there is little communication and connection between learning and teaching practice and linguistic research. Our book, therefore, aims to bridge this gap. We tackle one of the most fundamental tasks that are encountered by any speaker, learner, teacher, and researcher of Vietnamese: \textbf{pronouncing Vietnamese syllables}. In particular, the objective of this book is to represent how a native speaker of Vietnamese of different dialects pronouns each syllable in isolation.
57
 
@@ -77,22 +84,22 @@ A Vietnamese syllabe consists of three obligatory elements (an onset, a tone and
77
  \end{tabular}
78
  \end{center}
79
 
80
- For instance, the syllable {\fontencoding{T5}\selectfont toán} (`math') is transcribed as /t\super{w}an\super{34}/, with the onset /t/, the labialized /\super w/, the nuclear vowel /a/, the coda /n/ and the rising tone /\super{34}/.
81
 
82
  \begin{center}
83
  \begin{tabular}{|c|c|c|c|}
84
  \hline
85
  \multicolumn{4}{|c|}{Tone} \\
86
  \hline
87
- \multicolumn{4}{|c|}{Rising /\super{34}/} \\
88
  \hline
89
  Onset & Medial & Nuclear vowel & Coda \\
90
- /t/ & /\super w/ & /a/ & /n/ \\
91
  \hline
92
  \end{tabular}
93
  \end{center}
94
 
95
- There are two mutually intelligible main dialects differing in terms of pronunciation and to a certain extent in vocabulary: Northern Vietnamese and Southern Vietnamese. In the following sections, we present the phonemic system including onsets, medial, nuclear vowels, codas and tones for each dialect. We follow \cite{michaud2004}, \cite{pham2006}, Kirby (2007), \cite{brunelle2015}, and \cite{shimizu2022} for the distinction between the phonemic system of Northern Vietnamese and that of Southern Vietnamese.
96
 
97
  \section{The phonemic system of Northern Vietnamese}
98
 
@@ -135,23 +142,10 @@ Tones &
135
 
136
  \subsection{The onsets of Northern Vietnamese}
137
 
138
- \begin{center}
139
- \begin{tabular}{|l|c|c|c|c|c|c|c|}
140
- \hline
141
- & Labial & Labio-Dental & Dental & Alveolar & Palatal & Velar & Glottal \\
142
- \hline
143
- Plosive & {\fontencoding{T3}\selectfont b} & & {\fontencoding{T3}\selectfont t \hspace{1em} t\super h} & {\fontencoding{T3}\selectfont d} & {\fontencoding{T3}\selectfont \textrtailt\textesh \hspace{1em} c} & {\fontencoding{T3}\selectfont k} & {\fontencoding{T3}\selectfont \textglotstop} \\
144
- \hline
145
- Nasal & {\fontencoding{T3}\selectfont m} & & {\fontencoding{T3}\selectfont n} & & {\fontencoding{T3}\selectfont \textltailn} & {\fontencoding{T3}\selectfont \ng} & \\
146
- \hline
147
- Fricative & & {\fontencoding{T3}\selectfont f \hspace{1em} v} & & {\fontencoding{T3}\selectfont s \hspace{1em} z} & {\fontencoding{T3}\selectfont \textrtails \hspace{1em} \textrtailz} & {\fontencoding{T3}\selectfont x \hspace{1em} \textgamma} & {\fontencoding{T3}\selectfont h} \\
148
- \hline
149
- Approximant & {\fontencoding{T3}\selectfont w} & & & & & & \\
150
- \hline
151
- Lateral approximant & & & {\fontencoding{T3}\selectfont l} & & & & \\
152
- \hline
153
- \end{tabular}
154
- \end{center}
155
 
156
  \subsection{Medial of Northern Vietnamese}
157
 
@@ -228,11 +222,11 @@ Falling & 312 (h{\fontencoding{T5}\selectfont ỏ}i) & \\
228
 
229
  (g: glotalized)
230
 
231
- (adopted from Shimizu 2022 and Kirby 2008)
232
 
233
  \section{The phonemic system of Southern Vietnamese}
234
 
235
- According to the existing literature (\cite{thompson1959}, {\fontencoding{T5}\selectfont Nguyễn} 1971, \cite{thompson1984}, \cite{cao1988}, \cite{hoang2004}, Kondo 2016, \cite{shimizu2022}), the main differences between Northern Vietnamese and Southern Vietnamese are as follows:
236
 
237
  \begin{enumerate}
238
  \item[(i)] Initial consonants in Southern Vietnamese are more conservative than in Northern Vietnamese.
@@ -260,7 +254,7 @@ Tones & 1. ngang \hfill 33 \\
260
  \end{tabular}
261
  \end{center}
262
 
263
- (adopted from Shimizu 2022 and Kirby 2008)
264
 
265
  \subsection{The onsets of Southern Vietnamese}
266
 
@@ -318,7 +312,7 @@ Orthography & North & South \\
318
  \end{tabular}
319
  \end{center}
320
 
321
- (adopted from Shimizu 2022:6)
322
 
323
  \subsection{The codas of Southern Vietnamese}
324
 
@@ -357,7 +351,7 @@ k. kh{\fontencoding{T5}\selectfont ắ}c & {\fontencoding{T3}\selectfont [xak]}
357
  \end{tabular}
358
  \end{center}
359
 
360
- (adopted from Shimizu 2022:4)
361
 
362
  \subsection{Tones of Southern Vietnamese}
363
 
 
5
  \usepackage{tipa}
6
  \usepackage[hyphens]{url}
7
  \usepackage{multirow}
8
+ \usepackage{adjustbox}
9
+ \usepackage{rotating}
10
+ \usepackage[table]{xcolor}
11
+ \definecolor{lightgray}{gray}{0.9}
12
  \usepackage{hyperref}
13
  \hypersetup{
14
  breaklinks=true,
 
31
  \renewcommand\@makefnmark{\hbox{\@textsuperscript{\normalfont\textcolor{magenta}{\@thefnmark}}}}
32
  \makeatother
33
 
34
+ % Custom command for phonetic labels
35
+ \newcommand{\phonlabel}[1]{\scriptsize{#1}}
36
+
37
  \title{IPA Guideline in Vietnamese}
38
  \author{
39
  Trang Phan\\
 
56
 
57
  There is also a growing number of people speaking Vietnamese as a heritage language in the US, Cambodia, France, Australia and other countries. Vietnamese has been officially recognized as a minority language in the Czech Republic since 2013\footnote{\url{https://ec.europa.eu/migrant-integration/news/czech-republic-vietnamese-and-belarusians-recognized-ethnic-minorities_en}}. In Australia, Vietnamese occupies 82.7\% of the main languages spoken at home by Vietnam-born people there, according to the 2016 Census\footnote{\url{https://www.homeaffairs.gov.au/mca/files/2016-cis-vietnam.PDF}}.
58
 
59
+ Responding to strong demand, numerous instructional textbooks have been published worldwide, including series by \citet{mai2007a}, \citet{vu2011}, \citet{doan2012,doan2014}, \citet{nguyen2019}, and more recently by \citet{phan2024vibes} and \citet{phung2025}. Additionally, there are descriptive guides to the Vietnamese language including \citet{nguyen1997} by John Benjamins\footnote{\url{https://benjamins.com/catalog/loall.9}}, and \cite{ngo2021} by Routledge\footnote{\url{https://www.routledge.com/Vietnamese-An-Essential-Grammar/Ngo/p/book/9781138210707}}.
60
 
61
+ There is also a great leap in Vietnamese linguistic research over the past decade. There are three edited volumes devoted to Vietnamese: \cite{hole2013}, De Gruyter Mouton\footnote{\url{https://www.degruyter.com/document/doi/10.1515/9783110289411/html?lang=en}}; \cite{duffield2019}, John Benjamins\footnote{\url{https://benjamins.com/catalog/slcs.211}}; and \cite{phan2024springer}, Springer. Vietnamese has also been the focus of several special issues in Journal of East Asian Linguistics (2017)\footnote{\url{https://link.springer.com/journal/10831/volumes-and-issues/26-4}}, Journal of the Southeast Asian Linguistics Society (\cite{phan2022}\footnote{\url{https://evols.library.manoa.hawaii.edu/handle/10524/52500}}), Taiwan Journal of Linguistics (\cite{duffield2024,phan2025tjl}), and Languages (\cite{phan2025lang}).
62
 
63
  However, there is little communication and connection between learning and teaching practice and linguistic research. Our book, therefore, aims to bridge this gap. We tackle one of the most fundamental tasks that are encountered by any speaker, learner, teacher, and researcher of Vietnamese: \textbf{pronouncing Vietnamese syllables}. In particular, the objective of this book is to represent how a native speaker of Vietnamese of different dialects pronouns each syllable in isolation.
64
 
 
84
  \end{tabular}
85
  \end{center}
86
 
87
+ For instance, the syllable {\fontencoding{T5}\selectfont toán} (`math') is transcribed as /t\super{w}an\super{34}/, with the onset /t/, the labialized \super{/w/}, the nuclear vowel /a/, the coda /n/ and the rising tone \super{/34/}.
88
 
89
  \begin{center}
90
  \begin{tabular}{|c|c|c|c|}
91
  \hline
92
  \multicolumn{4}{|c|}{Tone} \\
93
  \hline
94
+ \multicolumn{4}{|c|}{Rising \super{/34/}} \\
95
  \hline
96
  Onset & Medial & Nuclear vowel & Coda \\
97
+ /t/ & \super{/w/} & /a/ & /n/ \\
98
  \hline
99
  \end{tabular}
100
  \end{center}
101
 
102
+ There are two mutually intelligible main dialects differing in terms of pronunciation and to a certain extent in vocabulary: Northern Vietnamese and Southern Vietnamese. In the following sections, we present the phonemic system including onsets, medial, nuclear vowels, codas and tones for each dialect. We follow \cite{michaud2004}, \cite{pham2006}, \cite{kirby2011}, \cite{brunelle2015}, and \cite{shimizu2022} for the distinction between the phonemic system of Northern Vietnamese and that of Southern Vietnamese.
103
 
104
  \section{The phonemic system of Northern Vietnamese}
105
 
 
142
 
143
  \subsection{The onsets of Northern Vietnamese}
144
 
145
+ \begin{figure}[h]
146
+ \centering
147
+ \includegraphics[width=1\textwidth]{images/onsets_northern.pdf}
148
+ \end{figure}
 
 
 
 
 
 
 
 
 
 
 
 
 
149
 
150
  \subsection{Medial of Northern Vietnamese}
151
 
 
222
 
223
  (g: glotalized)
224
 
225
+ (adopted from \cite{shimizu2022} and \cite{kirby2008})
226
 
227
  \section{The phonemic system of Southern Vietnamese}
228
 
229
+ According to the existing literature (\cite{thompson1959}, \cite{doan1977}, \cite{thompson1984}, \cite{nguyentaican1985}, \cite{nguyentaican1995}, \cite{mai1992}, \cite{vuong1994}, \cite{cao1988}, \cite{nguyen1997}, \cite{hoang2004}, \cite{shimizu2022}), the main differences between Northern Vietnamese and Southern Vietnamese are as follows:
230
 
231
  \begin{enumerate}
232
  \item[(i)] Initial consonants in Southern Vietnamese are more conservative than in Northern Vietnamese.
 
254
  \end{tabular}
255
  \end{center}
256
 
257
+ (adopted from \cite{shimizu2022} and \cite{kirby2008})
258
 
259
  \subsection{The onsets of Southern Vietnamese}
260
 
 
312
  \end{tabular}
313
  \end{center}
314
 
315
+ (adopted from \cite{shimizu2022})
316
 
317
  \subsection{The codas of Southern Vietnamese}
318
 
 
351
  \end{tabular}
352
  \end{center}
353
 
354
+ (adopted from \cite{shimizu2022})
355
 
356
  \subsection{Tones of Southern Vietnamese}
357
 
paper/scripts/format_bbl.py ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """
3
+ Format .bbl file to use Author Year. format instead of {Author} (Year).
4
+
5
+ This script processes the bibliography file generated by BibTeX and reformats
6
+ entries to display as "Author Year." instead of "{Author} (Year)." in the
7
+ references section.
8
+
9
+ Usage:
10
+ python format_bbl.py <bbl_file>
11
+ """
12
+
13
+ import re
14
+ import sys
15
+
16
+
17
+ def format_bibliography(bbl_file):
18
+ """
19
+ Format bibliography entries to Author Year. format.
20
+ Also fixes Vietnamese name order from "Given Family" back to "Family Given".
21
+
22
+ Args:
23
+ bbl_file: Path to the .bbl file to format
24
+ """
25
+ with open(bbl_file, 'r', encoding='utf-8') as f:
26
+ content = f.read()
27
+
28
+ # First, join multiline bibitem entries into single lines
29
+ # Pattern: \bibitem[...](year)]{key} that may span multiple lines
30
+ content = re.sub(r'\\bibitem\[([^\]]+)\]\{([^}]+)\}\s*\n\s*', r'\\bibitem[\1]{\2}\n', content)
31
+
32
+ lines = content.split('\n')
33
+ output = []
34
+ i = 0
35
+
36
+ # Vietnamese family names to detect
37
+ viet_families = ['Cao', 'Đoàn', 'Hoàng', 'Mai', 'Nguyễn', 'Vũ', 'Vương']
38
+
39
+ while i < len(lines):
40
+ line = lines[i]
41
+
42
+ # Match bibitem line with format: \bibitem[{Author}(Year)]{key}
43
+ # Handle various formats including fontencoding
44
+ match = re.match(r'\\bibitem\[(.+?)\((\d+[a-z]?|{\\.+?})\)\]\{([^}]+)\}', line)
45
+ # Also handle bibitem without year (editors)
46
+ if not match:
47
+ match = re.match(r'\\bibitem\[(.+?)\]\{([^}]+)\}', line)
48
+ has_year = False
49
+ else:
50
+ has_year = True
51
+
52
+ if match:
53
+ if has_year:
54
+ author_part = match.group(1).strip()
55
+ year = match.group(2)
56
+ key = match.group(3)
57
+ else:
58
+ author_part = match.group(1).strip()
59
+ year = None
60
+ key = match.group(2)
61
+
62
+ # Write the bibitem line unchanged
63
+ output.append(line)
64
+ i += 1
65
+
66
+ # Next line should be the author - replace with Author Year.
67
+ if i < len(lines):
68
+ next_line = lines[i]
69
+ # Skip if line is empty or starts with \newblock
70
+ if next_line.strip() and not next_line.strip().startswith('\\newblock'):
71
+ # Handle fontencoding patterns
72
+ clean_line = re.sub(r'\{\\fontencoding\{[^}]+\}\\selectfont ([^}]+)\}', r'\1', next_line)
73
+ clean_line = re.sub(r'^\{(.+)\}\.?\s*$', r'\1', clean_line.strip())
74
+
75
+ # Fix Vietnamese name order: "Given~Family" -> "Family Given"
76
+ # and wrap Vietnamese names in T5 encoding
77
+ for family in viet_families:
78
+ # Match "Given~Family" or "Given Family"
79
+ pattern = r'(\S+)~(' + re.escape(family) + r')\b'
80
+ if re.search(pattern, clean_line):
81
+ # Swap to "Family Given" and wrap in T5
82
+ clean_line = re.sub(pattern, r'{\\fontencoding{T5}\\selectfont \2 \1}', clean_line)
83
+
84
+ # Also wrap any remaining Vietnamese family names in T5 if they appear standalone
85
+ for family in viet_families:
86
+ # Match "Family Given" pattern not already wrapped
87
+ pattern = r'\b(' + re.escape(family) + r')\s+(\S+)\b'
88
+ # Only wrap if not already in fontencoding and contains Vietnamese characters
89
+ if re.search(pattern, clean_line) and 'fontencoding' not in clean_line:
90
+ # Check if the second part contains Vietnamese characters
91
+ match = re.search(pattern, clean_line)
92
+ if match:
93
+ given = match.group(2)
94
+ # Check for Vietnamese characters
95
+ if any(c in given for c in 'ạảãàáâậầấẩẫăặắằẳẵêệềếểễôộồốổỗơởỡớờợưựứừửữđíìịỉĩóòỏõọúùủũụýỳỷỹỵ'):
96
+ clean_line = re.sub(pattern, r'{\\fontencoding{T5}\\selectfont \1 \2}', clean_line, count=1)
97
+
98
+ # Add year with period
99
+ if has_year and year and not clean_line.endswith(year + '.') and 'natexlab' not in clean_line:
100
+ clean_line = clean_line.rstrip('.') + ' ' + year + '.'
101
+
102
+ output.append(clean_line)
103
+ i += 1
104
+ else:
105
+ output.append(next_line)
106
+ i += 1
107
+ else:
108
+ output.append(line)
109
+ i += 1
110
+
111
+ # Write back the formatted content
112
+ with open(bbl_file, 'w', encoding='utf-8') as f:
113
+ f.write('\n'.join(output))
114
+
115
+ print(f"Formatted bibliography in {bbl_file}")
116
+
117
+
118
+ if __name__ == '__main__':
119
+ if len(sys.argv) != 2:
120
+ print("Usage: python format_bbl.py <bbl_file>")
121
+ sys.exit(1)
122
+
123
+ bbl_file = sys.argv[1]
124
+ format_bibliography(bbl_file)