diff --git a/config/packages.tex b/config/packages.tex index 720470fb0..57d7288c6 100644 --- a/config/packages.tex +++ b/config/packages.tex @@ -34,3 +34,4 @@ \usepackage[chapter]{algorithm} \usepackage{algorithmic} \usepackage{mathptmx} % Use times font in equation env (#426 #425) +\usepackage{datatool} % Use DTLloaddb DTLsort DTLforeach for auto-sorted abbreviations diff --git a/page/graduate/abbreviations.csv b/page/graduate/abbreviations.csv new file mode 100644 index 000000000..87802aebd --- /dev/null +++ b/page/graduate/abbreviations.csv @@ -0,0 +1,9 @@ +abbrev,english,chinese +ZJU,Zhejiang University,浙江大学 +ZJG,Zi Jin Gang,紫金港 +YQ,Yu Quan,玉泉 +XX,Xi Xi,西溪 +HJC,Hua Jia Chi,华家池 +ZJ,Zhi Jiang,之江 +ZS,Zhou Shan,舟山 +HN,Hai Ning,海宁 diff --git a/page/graduate/term-translation.tex b/page/graduate/term-translation.tex index 8d6e1c1d1..4f3afc8b6 100644 --- a/page/graduate/term-translation.tex +++ b/page/graduate/term-translation.tex @@ -1,5 +1,6 @@ \cleardoublepage \chapternonum{缩略词表} + \begin{center} % uncomment line 5 if you want to set the fontsize of the table. % \zihao{-4} @@ -19,6 +20,11 @@ \endfoot \bottomrule \endlastfoot + % ================================================= + % Abbreviations table: + % + % Option 1: Manual input (for few abbreviations) + % Example: ZJU&Zhejiang University&浙江大学\\ ZJU&Zhejiang University&浙江大学\\ ZJU&Zhejiang University&浙江大学\\ @@ -27,5 +33,22 @@ ZJU&Zhejiang University&浙江大学\\ ZJU&Zhejiang University&浙江大学\\ ZJU&Zhejiang University&浙江大学\\ + % + % Option 2: Auto-read from CSV (recommended for many abbreviations) + % - Usage: comment lines 28-35 (Manual input abbreviations) and uncomment lines 45-52, add abbreviations in + % page/graduate/abbreviations.csv + % - File: page/graduate/abbreviations.csv + % - Columns: abbrev, english, chinese + % - LaTeX will automatically sort by 'abbrev' and output the table. + % + % Example usage (auto-sorted CSV): + % \DTLloaddb{abbr}{page/graduate/abbreviations.csv} + % \DTLsort{abbrev}{abbr} + % \DTLforeach*{abbr}{\abbrev=abbrev,\english=english,\chinese=chinese}{% + % \abbrev & \english & \chinese + % \DTLiflastrow{}{ + % \\ + % } + % } \end{longtable} -\end{center} \ No newline at end of file +\end{center}