diff --git a/Makefile b/Makefile index 3799cf6e..9f72f712 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ endif .PHONY: all cls doc clean FORCE_MAKE copy $(PACKAGE).pdf: cls FORCE_MAKE - $(LATEXMK) -xelatex $(PACKAGE).dtx + @$(LATEXMK) -xelatex $(PACKAGE).dtx $(CLSFILE): $(SOURCES) yes y | xetex $(PACKAGE).ins @@ -70,13 +70,19 @@ copy: cls # Generate scaffolds for overleaf overleaf: doc FORCE_MAKE + # if $version is not specified, alert the user. + @if [ -z "$$version" ]; then \ + echo -e "\e[32mPlease specify the version of the template you want to generate.\e[0m"; \ + echo -e "\e[32mFor example: make overleaf version=1.0.0\e[0m"; \ + exit 1; \ + fi git clean -fdx ./templates/ rm -rf overleaf make copy mkdir overleaf ls templates | \ xargs -I {} bash -c \ - "cp -r ./templates/{} overleaf && cp $(PACKAGE).pdf ./overleaf/{} && zip -r ./overleaf/{}.zip ./overleaf/{}" + "cp -r ./templates/{} overleaf && cp $(PACKAGE).pdf ./overleaf/{} && zip -r ./overleaf/BIThesis-{}-v$(version).zip ./overleaf/{}" dev: ls bithesis.dtx | entr -s 'yes y | make doc && make copy' diff --git a/bithesis.dtx b/bithesis.dtx index 7669b656..f34e8fa9 100644 --- a/bithesis.dtx +++ b/bithesis.dtx @@ -2229,7 +2229,7 @@ \RequirePackage{tikz} \RequirePackage{etoolbox} % Hide color and border in hyperref. -\RequirePackage[hidelinks]{hyperref} +\RequirePackage[hidelinks,bookmarksnumbered]{hyperref} \RequirePackage{xcolor} \RequirePackage{caption} \RequirePackage{array} @@ -3594,6 +3594,7 @@ \chapter{\c_@@_label_abstract_tl} } { \chapter*{\c_@@_label_abstract_tl} + \currentpdfbookmark{\c_@@_label_abstract_tl}{ch:abstract} } } \vspace*{1mm} @@ -3664,6 +3665,7 @@ \chapter{\c_@@_label_abstract_en_tl} } { \chapter*{\c_@@_label_abstract_en_tl} + \currentpdfbookmark{\c_@@_label_abstract_en_tl}{ch:abstract:en} } } } @@ -4034,7 +4036,7 @@ % \end{environment} % \begin{environment}{symbols} -% 生成主要术语对照包。 +% 生成主要术语对照表。 % \begin{macrocode} \NewDocumentEnvironment {symbols} {} { @@ -4042,6 +4044,7 @@ \chapter{\c_@@_label_symbols_tl} } { \chapter*{\c_@@_label_symbols_tl} + \currentpdfbookmark{\c_@@_label_symbols_tl}{ch:symbols} } \zihao{-4} \begin{itemize}[ diff --git a/templates/graduate-thesis/bithesis.cls b/templates/graduate-thesis/bithesis.cls index 8943863b..4306607e 100644 --- a/templates/graduate-thesis/bithesis.cls +++ b/templates/graduate-thesis/bithesis.cls @@ -418,7 +418,7 @@ \RequirePackage{multirow} \RequirePackage{tikz} \RequirePackage{etoolbox} -\RequirePackage[hidelinks]{hyperref} +\RequirePackage[hidelinks,bookmarksnumbered]{hyperref} \RequirePackage{xcolor} \RequirePackage{caption} \RequirePackage{array} @@ -1480,6 +1480,7 @@ \chapter{\c__bithesis_label_abstract_tl} } { \chapter*{\c__bithesis_label_abstract_tl} + \currentpdfbookmark{\c__bithesis_label_abstract_tl}{ch:abstract} } } \vspace*{1mm} @@ -1544,6 +1545,7 @@ \chapter{\c__bithesis_label_abstract_en_tl} } { \chapter*{\c__bithesis_label_abstract_en_tl} + \currentpdfbookmark{\c__bithesis_label_abstract_en_tl}{ch:abstract:en} } } } @@ -1861,6 +1863,7 @@ \chapter{\c__bithesis_label_symbols_tl} } { \chapter*{\c__bithesis_label_symbols_tl} + \currentpdfbookmark{\c__bithesis_label_symbols_tl}{ch:symbols} } \zihao{-4} \begin{itemize}[ diff --git a/templates/paper-translation/bithesis.cls b/templates/paper-translation/bithesis.cls index 8943863b..4306607e 100644 --- a/templates/paper-translation/bithesis.cls +++ b/templates/paper-translation/bithesis.cls @@ -418,7 +418,7 @@ \RequirePackage{multirow} \RequirePackage{tikz} \RequirePackage{etoolbox} -\RequirePackage[hidelinks]{hyperref} +\RequirePackage[hidelinks,bookmarksnumbered]{hyperref} \RequirePackage{xcolor} \RequirePackage{caption} \RequirePackage{array} @@ -1480,6 +1480,7 @@ \chapter{\c__bithesis_label_abstract_tl} } { \chapter*{\c__bithesis_label_abstract_tl} + \currentpdfbookmark{\c__bithesis_label_abstract_tl}{ch:abstract} } } \vspace*{1mm} @@ -1544,6 +1545,7 @@ \chapter{\c__bithesis_label_abstract_en_tl} } { \chapter*{\c__bithesis_label_abstract_en_tl} + \currentpdfbookmark{\c__bithesis_label_abstract_en_tl}{ch:abstract:en} } } } @@ -1861,6 +1863,7 @@ \chapter{\c__bithesis_label_symbols_tl} } { \chapter*{\c__bithesis_label_symbols_tl} + \currentpdfbookmark{\c__bithesis_label_symbols_tl}{ch:symbols} } \zihao{-4} \begin{itemize}[ diff --git a/templates/undergraduate-thesis-en/bithesis.cls b/templates/undergraduate-thesis-en/bithesis.cls index 8943863b..4306607e 100644 --- a/templates/undergraduate-thesis-en/bithesis.cls +++ b/templates/undergraduate-thesis-en/bithesis.cls @@ -418,7 +418,7 @@ \RequirePackage{multirow} \RequirePackage{tikz} \RequirePackage{etoolbox} -\RequirePackage[hidelinks]{hyperref} +\RequirePackage[hidelinks,bookmarksnumbered]{hyperref} \RequirePackage{xcolor} \RequirePackage{caption} \RequirePackage{array} @@ -1480,6 +1480,7 @@ \chapter{\c__bithesis_label_abstract_tl} } { \chapter*{\c__bithesis_label_abstract_tl} + \currentpdfbookmark{\c__bithesis_label_abstract_tl}{ch:abstract} } } \vspace*{1mm} @@ -1544,6 +1545,7 @@ \chapter{\c__bithesis_label_abstract_en_tl} } { \chapter*{\c__bithesis_label_abstract_en_tl} + \currentpdfbookmark{\c__bithesis_label_abstract_en_tl}{ch:abstract:en} } } } @@ -1861,6 +1863,7 @@ \chapter{\c__bithesis_label_symbols_tl} } { \chapter*{\c__bithesis_label_symbols_tl} + \currentpdfbookmark{\c__bithesis_label_symbols_tl}{ch:symbols} } \zihao{-4} \begin{itemize}[ diff --git a/templates/undergraduate-thesis/bithesis.cls b/templates/undergraduate-thesis/bithesis.cls index 8943863b..4306607e 100644 --- a/templates/undergraduate-thesis/bithesis.cls +++ b/templates/undergraduate-thesis/bithesis.cls @@ -418,7 +418,7 @@ \RequirePackage{multirow} \RequirePackage{tikz} \RequirePackage{etoolbox} -\RequirePackage[hidelinks]{hyperref} +\RequirePackage[hidelinks,bookmarksnumbered]{hyperref} \RequirePackage{xcolor} \RequirePackage{caption} \RequirePackage{array} @@ -1480,6 +1480,7 @@ \chapter{\c__bithesis_label_abstract_tl} } { \chapter*{\c__bithesis_label_abstract_tl} + \currentpdfbookmark{\c__bithesis_label_abstract_tl}{ch:abstract} } } \vspace*{1mm} @@ -1544,6 +1545,7 @@ \chapter{\c__bithesis_label_abstract_en_tl} } { \chapter*{\c__bithesis_label_abstract_en_tl} + \currentpdfbookmark{\c__bithesis_label_abstract_en_tl}{ch:abstract:en} } } } @@ -1861,6 +1863,7 @@ \chapter{\c__bithesis_label_symbols_tl} } { \chapter*{\c__bithesis_label_symbols_tl} + \currentpdfbookmark{\c__bithesis_label_symbols_tl}{ch:symbols} } \zihao{-4} \begin{itemize}[